:
INTRODUCTION
This project is something personal. I always wanted to work on a project that has his own engine and hiw own technologies. I spent a large amount of time on trying to understand how engine like Unreal works. The goal of this project is to make a little game in C++ without using any existing engine. All I use is Raylib for the rendering and Box 2D for the physics.
WHAT I DID
For the moment on this project I've some features that are implemented and that are listed below. I'm planning on making seperate articles to detail them better so everyone can see the evolution.
Delegate and Input system
The first thing I wanted to do was to create an Input system that is easy to use with keyboard, mouse and gamepad inputs. I don't want to have any difficulties to add a feature to the game due to this. I use this to create a Delegate system that will always be useful during game development.
The DelegateBase class is a generic class that can receive a return value and a bunch of arguments. The user just has to create an instance of this class and call Bind to bind a callback function to it with an instance or without. The Invoke function will call this callback function.
Here's the example with the InputComponent class.
What is happening here is that the we have binded an input to a specific event (specified in the InputManager). The Update function of the component (so every frame) will check if the input binded to the event is triggered and then will called the binded callback function.
Here is an example of a binded input for the jump. In the Player:
And how the event has been defined in the InputManager:
Movement system
I wanted the player, and maybe other characters, to have different kind of movement. Right now, the player can run, jump and slide. The player has a Movement Component that is dealing with that. Every Movement type is a specific class that is dealing with the velocity calculation and if we can swtich to it.
Here's an example of the basic MovementModeBase:
All the Movement modes are child of this base class and can override the PerformMovement function.
2D Animation system
Once I had my character in movement, I felt like I wanted to see him moving around with nice and smooth animation. I've implemented a sprite sheet animation system with animation state to switch between.
The rendering component can have a reference to an AnimationManager (I want to have different kind of animation manager in the future not only sprite sheets), that is managing the animation to play and when.
For the moment, the animation manager is creating animation from a spritesheets texture. The user can decide how many frame he wants in the animation, how long an animation frame lasts and if the animation is looping or not. The animation is linked to a state and he can set the current animation state anywhere in runtime or inside the Update function of the manager.
Tile map
It was time to put our character inside a nice environment. I wanted to make a level editor. For that I helped myself using the Tiled software that will help me to create Tile map in XML. All I needed to do was to parse the XML (using the rapidxml library) to import what is created in the editor inside the game.
The idea is that I have a TileMap actor type that has sprite sheet textures and with the information inside the XML layers, knows where to the tiles in the world. The editor can also be used to place collisions, different kind of objects, background textures with parallax effect.
Grappling Hook
The player movement are very basics for now. I want to experience some 3C challenges. That is why I have think of adding a Grappling Hook to the player. For the moemnet the Grappling Hook as to possibilities : Balance the player or giving him a boost toward a specific location.
The player can aim using the mouse (free movement around the screen) or using the gamepad (the aim texture is rotating around the player character sprite).
WHAT I WANT TO DO NEXT
Those are the different stuff that I want to add to this project. If you are reading this article and you want to give me feedback, advices or ideas, please contact me on my
LinkedIn. I'll be more than happy to have an opportunity to improve myself!
Improve movement feeling
I'm currently showing this little prototype to Game Designer friend of mine to have their feedback on how I can improve the global game feel and also if they have any new move set ideas.
Add enemies and obstacles
Once I'm happy with the character movement I would like to create a bunch of enemy types to bring some challenge. I also would like to use the grappling hook as a weapon to beat those enemies.
Add sounds and musics
Raylib supports .wav play files. I would like to use that to add some music and some sound design to the prototype. I'm not decided yet but on a
previous project, I already created a pipeline with WWise, I might do the same here if it is relevant.
Create actors using an external file to "clear the code"
I would like to add something like .uasset and .ini files. Not as complex of course but a file that will contains all the information of an actor for his creation (Stats, Initial Transform, Animation states etc...). I also want external files for inputs.
Make a first prototype
I want to know if my tools and my architecture is "production proof" and I think the best way to know that is to create a small game with something like 2-3 levels, some UI and a boss fight. I think I will see optimization issues, bugs and user issues.
Better separation between "Engine" part and "Project" part
For the moment there is not a real separation between what can be use between every project and what is specific to this project. The goal is to create an Engine project that I can use in different projects to have a code base.
Add a 3D project using bullet
Once I have an "Engine" project, I want to use it to create a 3D project in order to have other challenge and complexities. For the moment, I'm trying to manage everything using 3D vectors and stuff like that so the switch to the 3D part of raylib won't be too difficult.