Here I am again to talk about Macaw. Actually, here I am to talk about the presentation about Macaw I gave this week at the Cincinnati Golang Meetup!
First of all, I want to give a special thank you to Will Hawkins and Shad Beard for inviting me to this nice event and giving me an opportunity to talk about Macaw. It was an awesome experience! The folks over there were all very friendly and sharp. That’s what you expect from a great community. Two thumbs up! 🙂
I put together a presentation in which I discussed the way Macaw was designed. Within the presentation we discussed the pillars of Macaw which are the SDL library, the Entity Component System (ECS) pattern, the Gameloop, and the Scenes.
I haven’t covered these pillars in detail in my previous post so I thought I should cover them briefly now.
- The SDL library is very important because it abstracts many layers that otherwise would take too much of my develop time. The downside of using SDL is that we are using CGO which causes problems when we try to build the application to different architectures;
- The ECS pattern is very important for several reasons. The main reason is because it separates the data to the behavior, thus cleaner code. The other reason is performance. With ECS we can explore the cache, because we don’t load the whole blob of the game object. Having a higher cache hit, thus not fetching from memory saves a lot of time. We can also use shared variables across entities. Finally, the last part of the performance we can leverage (which we are not using yet) is to use go routines with the systems. (No wonder Unity is pushing this design in their product as well);
- Scenes are important to easily divide the logic of the game code;
- Game loop is a common pattern that we modified slightly. Here we take care of the Input Handler and all of our systems (render and non-render systems).
I also discussed the pros and cons of using Macaw. The pros are that it is simple framework, and it uses go, a compiled and powerful language. The cons are that it is immature (no ecosystem, not many systems developed), lack of documentation, and there is no fancy editor. I didn’t include the garbage collector as an issue, because with the Go compiler we can disable the GC since Go 1.5. Also the GC performance has increased significantly.
Giving that talk motivated me to work on Macaw again (I took a break to focus on other things). I hope people enjoyed the presentation as much as I did. If you want to work on the project don’t be afraid. You can contact me via email (email@example.com) and I will answer it ASAP or you can chat with me at freenode.
I really liked the experience and I’m looking forward to other adventures like this in the future 🙂