Inspiration
Originally we wanted to build a top-down game with wizards (inspired by Tactical Breach Wizards), but then we thought it would be funny if the wizards put their spellbooks in version control. Eventually, this became an idea for an RTS with Git-powered branching & merging.
What it does
How we built it
We decided to use Go for our project for its reputation of a fast learning curve, and because it was a halfway point between our JS and C/C++ experience. The 2D rendering is handled by the ebitengine Go library, which is somewhere between Raylib and PyGame in terms of features.
Challenges we ran into
Originally we used go-git, a fairly accurate Git re-implementation that can run entirely in-memory. It got us to the point of displaying chains of real git commits without files on disk, but things fell apart with branches. As we researched the internals of Git more, it turned out that reconstructing an accurate tree of branches (at least with the go-git API) was fairly complex.
Since we were already having to convert Git's tree into our own structure for real-time rendering, we decided to ditch the real Git and emulate the behaviour we needed. Our game doesn't allow for situations that could create merge conflicts, so branch merging was fairly trivial.
Accomplishments that we're proud of
- Learning a sizable chunk of a new language in a single day
What we learned
- Commits aren't actually tied to any given branch, so with just a commit object it can be difficult to figure out what branch it's "supposed" to be on.
- Re-generating hexagon vertices per frame is really expensive, actually much more than drawing a texture containing a hexagon (We're not sure how much is due to graphics API overhead for extra meshes vs. expanding Go arrays).
- Caching and early loading is great for performance, while lazy/late loading can cause lag spikes at best or massive wastes of frame time at worst.
- Git commits store entire blobs of binary data, not just deltas as you'd think from looking at diffs.
- Golang in general, from syntax to library standard practice
- Writing "meta" code dealing with Git structures that's also under Git version control is really confusing
What's next for Molniya
- There are a few edge case bugs in the game state that can lock things up, we'd love to do some redesign to try to make those states impossible
- As expected, the code is a little messy (state updates in draw() and the like). It'd be nice to clean up some of these code quality problems.
Built With
- ebitengine
- go
Log in or sign up for Devpost to join the conversation.