Creating a Rust Game Engine: Part 2

This will be a short blog on some design decisions i have made for the project.

11/2/20242 min read

After some research on reddit and rust forums, what I've realised is that using a dynamic linking is good for reducing the game's build size but might cause a lot of problems in memory management, so due to this reason i've changed the sandbox structure from handling dynamic linking to directly adding the dependency to Cargo.toml for the game engine.

Folder Structure And Runner Component

So, as per the rust documentations and best practice a library module should have lib.rs inside the src folder, so we are going to follow that and also we will be making a folder called core inside src which will contain all core elements of the game engine. Inside core there will be mod.rs, which is required for the rust compiler to understand that this folder is a module.

Now the lib.rs will have all the imports and will not contain any code in itself. Inside the core, we will have multiple folder and files for each core module. We will use a file for module in core when the component doesn't have sub components of its own. For example, we will have a file module for logger , but a folder module for runner.

Now, the runner module, is basically a module with bunch of components and all of them handles the entrypoint of the game engine, and makes sure that every system in the game engine is active, might do a health check (though it's out of scope for this project for now). But in short it's an infinite loop inside which all operations will be taking place.

Note: Sorry i was not able to make a video explaining things as i am kinda busy in diwali, but in next one I will be adding a video for it too.