More students are learning about the world of open source through video games. Open source games like FreeCiv and Minetest invite young gamers to dig into the source code, while projects like SpigotMC empower them to write plugins to extend their favorite games.
Unfortunately, the open source tools used to build games do not share the same prominence. Rochester Institute of Technology student Matt Guerrette hopes to help change that with Hatchit, his open source gaming engine.
Guerrette and fellow student Arsen Tufankjian created Hatchit in February 2016. They felt the popular game engines they used in class and for personal projects were more design-oriented and lacked some technical details they were looking for. Together, they decided to build their own gaming engine with the goal of exposing developers to the technical side of the process. "We want to give you more access to the programming side of the game engine," Guerrette said.
Hatchit is written in C/C++ and licensed in a mix of GPL and LGPL. The project was originally designed to take advantage of the DirectX APIs for development. However, Guerrette and Tufankjian ran into an unexpected event while they were getting started. Nvidia released the Vulkan APIs in competition with the DirectX APIs. They attempted to support both APIs simultaneously, but later opted to focus on Vulkan.
Guerrette wanted to accomplish a specific type of task with Hatchit: He wanted to be able to construct a render pass instead of having the engine handle it internally. An earlier project had motivated the need for this feature. By being able to create the render passes in real time, a developer would be able to create something like a custom shader that bends vertices into straight, geometric shapes in real time. His earlier project, Mineshaft Mayhem, demonstrates this concept with how the mineshaft seems to be warping and turning, but the tunnels are actually straight in the editor.
What's happening now
Since starting the project, Tufankjian graduated and is now working at Amazon Game Design. Over the summer, the community started to show interest in the project. They've received a pull request from one member outside of the core developer team and have several issues filed against the different repositories for the engine.
Guerrette has a few milestones in mind for the project this year. One of the biggest tasks he is working on is getting the Vulkan renderer multi-threaded design implemented and working. This vastly speeds up the render time when working on projects and is also proving to be one of the greatest challenges so far. In addition to the multi-threaded design, he hopes to have game objects and components serialized with JSON. This would make it easier for the editor application to modify game data and manipulate configurations with Qt.
Benefits of working in the open
Working on the project on GitHub has benefited the project in a variety of ways. One of the most clear ways this helped is having people file issues and raise concerns over parts of the code. "Having the world's eyes on your project to catch errors is a good thing," Guerrette said. In one case, someone filed an issue against an older library that made a mathematical error in its calculations. Guerrette found the freedom to use other open source libraries and dependencies for the engine especially useful. All the licenses were compatible and presented no issues.
Some technical challenges were also made easier with open source tooling. One of the greatest challenges for the Hatchit team was writing the build system to use build system generator software and maintain compatibility with both Windows and Linux. Locally linking dependencies in the project was inconvenient and made the project unnecessarily huge. With git, they used submodules to link dependencies in the repository and build them from source when compiling Hatchit. "Being able to link dependency repositories has been really useful, especially for developing on Windows," Guerrette said. Additionally, some of the continuous integration features on GitHub and other services made it easy to quickly test changes for compatibility.
The team has faced some challenges along the way. With the convenience of using git submodules also came a difficulty of tracking upstream changes. On occasion, a dependency might break in the project. The team then has to check if the project has updated or changed upstream, or if a fix needs to be made locally in their project.
Additionally, community outreach is a challenge Guerrette is hoping to focus on as the new project lead. He shares development updates on his YouTube channel and occasionally streams his development on livecoding.tv. One thing that makes it easier for new contributors to get involved is recommending they try building the engine from the source code. This gives potential developers experience with compiling the engine and walks them through a lot of the project's documentation.
The Hatchit team is still working on the game engine and is looking for community participation. To get involved, Guerrette recommends checking out the Hatchit Gitter chat and reviewing the README file on the main repository. Any contributions are welcome, either in the form of pull requests or filing issues.