LittleWorm Engine
Skills: Game Engine, C#, OpenGL, Physics Engine

LittleWorm Engine is a costume game engine I made using C#, OpenGL and BulletPhysics. LittleWorm Engine contains two most important core systems in all game engines, Renderer and Physics Engine. I built LittleWorm Engine based on an architecture similar to Unity. The source code can be found there:https://github.com/VinOuO/LittleWormEngine
You can see in the flowchart that Core is the heart of our game engine, Core is a multi-thread program that has a main program and two threads. 

Main Program
The main program will first create a window for displaying the game using OpenGL, and then it will initialize the setting of OpenGL, after that the main program will create the game scene according to the save files that ResourcesLoader gives it. Then, the main program will start two treads, editor thread and physics world thread, which I am going to talk about in the next sessions. After that, the main program will initialize the scene at the first frame, go into a loop and then start running the game in every frame by updating every Compontent and CustomComponent  attached on every GameObject in the scene. Compontents and CustomComponents are Interfaces that can be implemented into different classes designed to be attached to GameObjects. Just like in Unity, the designer can attach different Components on GameObjects and make them have different behaviors. For example, if the designer wants the GameObject to have a model, then they can attach a MeshRenderer on it. If the designer wants the GameObject to be in the physics simulation, then they can attach Collider on it. Actually, because Collider is an abstract class that is inherited by Colliders with different shapes, the designer should attach those shaped Colliders instead. If the designer wants to use scripts to control the GameObjects, they can attach a DesignerProgram, which is inherited from CostumComponent. The following shows an example of how to use DesignerProgram.
Editor Thread
​​​​​​​In LittleWorm Engine, the designer can make the game with either pure coding or with the help of the editor of LittleWorm Engine. The editor will be operated by the editor thread if the engine is set to editor mode. 
I used webforms as the GUI tool to create LittleWorm's editor. In the editor, the designer can add/delete GameObjects and attach/modify/remove Components and CostumComponents. The change will be saved to the save file and will be loaded the next time the engine starts to run.

Physic World Thread
Finally, let us look at the third thread, the physics world thread. The physics world thread is powered by Bullet Physics SDK and will start a simulation based on the information the colliders on the screen gave it. LittleWorm provides useful physics features including collision detection and recasting. The following shows different colliders with different shapes and configurations, such as Trigger, Static, Mass, Offset, and more.
Demos
Now, let's try out the game engine we just talk about by making a small demo! 

In this demo, I created a prototype of a horror game idea of mine. The idea came from an artist’s twitter. In the twitters, the characters live in a weird apartment. The reason why this apartment is weird is because the apartment is stuck in Limbo. Therefore, sometimes the apartment seems normal but other times the apartment is weird, the wall looks disgusting, tainted by blood and dirt; monstrous creatures appear from time to time; the elevator is covered with different languages and ciphers which can lead the user to the right place or horror places. After reading the twitters, I came up with the idea of a protagonist stuck in a room with a flashlight in his hand, and while the place seems normal, the flashlight reveals the horror beneath the surface, such as mysterious and scary ciphers, blood on the wall, and unspeakable scene in frames.

In the scripts, we first give the Renderer attached to the GameObject the limbo-mode texture that we want the Renderer to render when the player points at the mesh with the flashlight (cursor).
Then we send the position of both MainCamera and Pointer to the shaders via the Renderer attached to the GameObject. By doing so, the shaders can use the information to calculate which texture to use when rendering the scene.

In the shader, we let the shader calculate whether the mesh is under the flashlight’s halo. If so, the shader will render the mesh with the limbo-mode texture that we gave the Renderer. If not, the Renderer will use the default texture.
Finally, we get our great horror game idea demo. 

(Warning: The following video contains uncomfortable/scary picture)
The following is another demo game that showcases the physics engine of LittleWorm Engine.
In addition to that, the following video shows how to use LittleWorm Engine.
Conclusion
By building this project, I have gained a complete understanding about how games and game engines work, including sharders, rendering pipelines, collision detection and physics simulations. With the knowledge and skills I learned, I am confident about my ability as a game engineer.
Back to Top