The Ebonheim Chronicle

cpp

I used to be really dogmatic about handcrafting every single component of a game from physics engine to platform modularity under the auspices of learning new things but the truth is that I really just hated CMAKE and would rather get a root canal than integrate giant bloated dependency chains.

Thing is there's a lot of nerds who feel the same way and there's a ton of just fantastic enormous solutions to common game problems that are zero-dependency or header-only.

  • SDL2 – Didnt feel the need for this to be here because it's obvious but it's good! You can use the prebuilt binaries or else if you're using visual studio you can drop the existing project vcproj files directly into your solution and build it alongside your app!
  • ImGui Single-handedly revolutionized how I develop native applications. Works with whatever back end or render library you want, has a ton of support. I actually kind of want to write a blog post about building a game inside ImGui's drawlists, maybe someday!
  • STB – These are public-domain single-file C++ libraries that do everything from STL structure replacements to waveform synthesis. Perlin noises, tile map editors, voxel renderers, you name it. I particularly use stb_image everywhere in all of my code because decoding image formats is a capital-N Nightmare.
  • Single File Libs This is a great index of single-file libraries
  • Recast Navigation Hugely useful and powerful 3D navigation/pathfinding library. It has a Viewer tool that is really impressive!.
  • GameControllersDB This crowdsourced text file loads into SDL to translate all the different scancodes from any gamepad you can think of.
  • cpp-httplib Tiny, perfect little http requests library with a good API. Pair with stb_json or tinyjson!
  • RayLib A ton of games-centric components for getting you up and running with making games! Has great Premake scripts that get you up and running with a project super fast, and can be used as the basis for your own engine. (Thanks @BrodyBr)
  • Soloud A simple portable C++ audio engine by @sol-hsa
  • Sokol An SDL2 alternative for cross-platform game development with STB-style components! (Thanks @heart-full-of-skye)
  • Box2D Venerable 2D physics Engine. Physics is something that can sink a project unless you really like math, Box2D has been around a long time! The readme has cmake and dependencies and all that but it's all for the testbed application, you can drop the source and include files into any barebones build and it'll build with no fuss!
  • Bullet 3D physics engine, same deal as Box2D, source drops into any project easily.

#gamedev #customengine #cpp

I've always had this pipe dream of being able to live-edit all assets in a game project while the game is running and I'm feeling really strong about the progress of this newest project!


Most/all of my personal side-project revolve around C/C++ desktop apps with homespun engines. It's usually as much a journeyman effort for learning more CS as it is a desire to make a game. A big part of solving the issue of finishing a game has to do with having good architecture with a good assets pipeline.

In this example we have:

  • The assets data-catalog is on the top left
  • A running game instance in the top right (can have multiple running in windows independently in the same exe)
  • A tile schema editor for map tiles in the bottom left
  • A homemade pixel image editor in the bottom right.

Any pixel edits to the graphics in the editor live-update anywhere they are used (in this case both the running game and the schema editor) giving you redundancy to test your edits. It also has perfect referential integrity so you never have to worry about your game crashing when an assert comes up missing.

I will have to come up with some thoughtful posts digging into the how's and why's of all of this but the main concepts at play here are:

  • “C-Style” C++
  • Generated reflection code from struct definitions
  • Generic recursive file format
  • Live++
  • Dear ImGui

#gamedev #chron4 #cpp #imgui

| 🌐 | 🙋‍ | @britown@blog.brianna.town