Hello there! Have you ever had one of those ideas that bug you just a little every once in a while, maybe for years, and then on a random day this idea suddenly grows up to the point where it to pops up in your head every single day? So do I.
That’s why I bring you the bati-RUST game engine. This project is by far one of the most exciting and fun I’ve ever thought about. I’m thrilled for creating a game engine in Rust from scratch, and from scratch also means that I know nothing about game development.
Motivation
One of my greatest motivators is the story related to Doom (1993), and the Wolfstein3D game engine(1992). John Romero and John Carmack did an amazing job by developing many of the best games at the time, having the challenge related to the very limited resources they had at the time. Not that I know the precise details on how they worked, but back then, the paradigms and tool used not to be as efficient and straightforward as we have today, or as to sound Cliché, programmers no longer code as in the old days. They were really clever when making those games possible and overcame many obstacles in what many people could have consider as impossible, John Carmack even created his own compression algorithm.
Now what most people may say(and already have) is Why don’t you just learn to use Unity or Unreal and create a very nice game? They are right, why would you make your own game engine there are such powerful tools already there to create awesome games?
What do I say? I don’t want to make games (maybe later) with a fully easy-to-use engine, I want to make an engine, code the math, code the renders, if assembly pops up code it as well, make the designs and architecture from a high level of abstraction, etc.
That’s what I’m excited about, the challenge to take a blank project and take it to the point where I’m able to reproduce the engine that would allow a Doom-like game to be developed. And I don’t even have any idea on how a game engine works, which is probably the most exciting part of the challenge, all knowledge will be build from 0, even with Rust.
The toolbox:
- Get Rusty: Learn Rust
- History context: Game Engine Black Book: Wolfenstein 3D
- Learn about the math principles (and code it): Foundations of Game Engine Development, Volume 1: Mathematics
- Learn about the rendering: Foundations of Game Engine Development, Volume 2: Rendering
- Cheat sheet: Rustenstein 3D
Findings and progress will be updated here and finally without further things to say,
The (soon to be) engine:
Project creation
The first step was creating this blank project having the toolbox above as a guide https://github.com/Rbatistab/batiRUST-game-engine
First iteration
Many interesting things have happened in this very first weeks, here is what happened.
As a summary:
The first two topics in my toolbox were for entirely for knowledge gathering:
- Get Rusty: Learn Rust
- History context: Game Engine Black Book: Wolfenstein 3D
- An skeleton of the architecture for my engine: https://github.com/Rbatistab/batiRUST-game-engine
For the first point to a diver deep approach here’s my rust learning sandbox. Here I learn by doing what I find in the documentation and tackling some coding challenges. It’s all unit tested and with a maybe awkward naming and nesting (I want to fix that as well, but is not really important, just odd)
For the second part of this advance I tackled this awesome book, Game Engine Black Book Wolfenstein 3D from Fabien Sanglard which I’m loving since it allows me to get into the context of the challenges that people from id Software had to tackle back in 1991 and also the big picture of the architecture, design and code of Wolfestein3D.
And finally, I have the very abstract picture of a game engine as a system that is heavily dependent on math (mainly linear algebra), physics, renders, music and the engine itself, hence I decided to add a very basic project with a library to host the math, physics, and renders modules.
├── Cargo.lock
├── Cargo.toml
├── .gitignore
├── README.md
├── src
│ ├── bin
│ │ └── engine.rs
│ └── lib
│ ├── lib.rs
│ ├── math
│ │ └── mod.rs
│ ├── physics
│ │ └── mod.rs
│ └── renderers
│ └── mod.rs
└── test
└── lib.rs
Inside each module there is unit testing according to RUSTs standards to have the UT in the same file as the source code.
Also I added a test folder next to source to handle integration testings. So far this is a very humble first step, but I hope to make it possible for it to look every time more like an engine would do.
Regarding the next steps I’ll continue the very same 3 action items as this iteration
- Keep getting rusty: Learn Rust
- More context on how Wolfestein3D worked: Game Engine Black Book: Wolfenstein 3D
- Try to begin to implement some more code, probably math and render module lib functions while at the same time gathering some requirements to prioritize and make better iterations on a more solid roadmap.
Thank you for reading!