When our project started to grow, I looked for a good engine that could handle all the features we wanted and was performant enough to handle thousands of bullets in 2D. I couldn't find any - there were either sophisticated, high-speed 3D engines or simple and slow (but easy to use) 2D engines. I could go for 3D engine and just map everything to 2D but I was young and wanted some challenge so I decided to do something you should almost never do as a game dev - develop my own engine in C++.
C++ is still popular among game developers for its amazing performance, but as a language, it has many pitfalls. And I think I’ve fallen in most of them. Object oriented inheritance makes a lot of sense in theory, but it soon starts to get messy and confusing when the project grows bigger. The lesson I’ve learned: “favor composition over inheritance”. I’m not the only one who made this mistake; I recommend reading interesting series of blog posts about making of Starcraft.
I also overused singletons - having everything accessible everywhere also sounded like a good idea and enabled us to do a lot of custom cutscenes behaviour and crazy hacks easily, but after a year or two, it turned into ugly, hard to debug pile of shite where everything could be changed everywhere.
For our graphics, I’ve chosen OpenGL, which is an open alternative to DirectX and will enable us to maybe port the game for other platforms in the future (if you are interested in Linux version - drop us an email). For basic window and input management, I went with GLFW - excellent library and still actively developed, supported by GLEW for detecting which OpenGL features are available on your graphic cards.
To display various text, like dialogs or parts of UI, we use excellent FTGL library, which is based on Freetype 2 project. For sound and music, we went with Audiere, which is a bit dated, but gets the job done and is quite simple to use. To load images as textures we use SOIL, and to load everything from archive files we found PhysFS to be the best choice for us. We also use a bunch of smaller libraries like gzstream, zlib and libjson.
To make our tough C++ life easier, we also included some of the excellent boost C++ libraries.
Our IDE of choice is Code::Blocks. It’s free, lightweight and does the job. I think its development slowed a bit over the years (especially on UI/UX side) and now it feels a bit dated compared to other choices, but I like it for sentimental reasons.
We host our code on bitbucket because it provides free, private code repositories, and use git for version control. I wish I could opensource it, but since it’s my first big project (over 50k lines of code) I’m quite embarrassed to do so.
Once all pull requests are merged and bugs debugged, I hit F9. All four cores of my CPU start working on 100%, fans of my laptop produce helicopter-like noise and after a minute or two, new and shiny Chaosrise.exe is ready. Now we only need to run additional scripts to pack all other assets, include libraries, put it all into one .zip file and upload on our server.
Web stack and final words
Whoa, I think that covers everything. If you have any questions or suggestions about technical side of our project then don’t hesitate to drop us an email at email@example.com!