jonrob.net



Game Engine Devlog Part 1 - Fundamentals

In my spare time these past 6 months I've been working on a game engine, so far it's largly been learning and building a foundation using concepts which have been written about hundreds of times, but now I'm starting to tackle interesting problems so I figured it's time to start writing about it.
I started graphics programming in December after reading the fantastic Graphics Programming Black Book by Michael Abrash, then working through the great vulkan-tutorial.com, I then ported it to C in January and used it as the starting point for my game engine.

First I created the most basic game I could, by taking the logic from a GTK Game of Life I wrote in November and dumping it directly into the rendering routines.
I then separated the game logic from the rendering logic and implemented Blinn-Phong Lighting:
After this I wanted a more interactive game so decided to make a maze, I added simple 2D collision detection using non rotating square hitboxes, some basic IO, and then manually positioned a lot of walls to make this:
After this I wanted to see how far I could push the engine, I ported it to Windows and animated 4 million polygons. The framerate (and framerate tied movement speed) shows this is struggling:
The main thing I felt missing from the previous scenes has been shadows, so shadow mapping was the next task:
Then bloom (yes it's being applied to fog):
Then I started on UI:
The UI is something I'd never given any thought to, it's made up of polygons just like the 3D realm but it's a dimension short, it's suprisingly expensive to draw, so I accomplish the end result in three render passes: one draws the bulk of the UI which only updates when it needs to, the next pass draws the elements of the UI which update every frame (for now it's just mouse movements), then another pass merges them with the world view to then project to a screen quad.

Originally I wanted to make lots of small projects, finding lots of hills and climbing them, but certain elements were harder than anticipated so instead I now have my eyes on an end goal.

  • I would like a fully 3D city builder.
  • Written in Vulkan because I'm excited about the technology and where I think it's going.
  • Written in C because it's what I'm best at, and it's only me working on it.
  • Not using an COTS products because I enjoy systems programming.

The assets in the above videos which I didn't create are:
Brick texture
Wood texture
Cat model
Placeholder question mark

Stay tuned for further updates.