My contribution to the project primarily focused on the engine. Initially, I researched potential libraries for both physics and audio integration into the engine. We decided to use SDL for graphics, as we were familiar with it from our degree and it posed no limitations for 2D game development.
Once we chose Box2D for physics and SDLMixer for audio, I began setting up the project using Visual Studio 2022. I organized the solution into several projects: physics, audio, input, render, and implemented each of them. I started with the Input project, which took some time as I implemented support for keyboard, controller, and multiple controllers. Once finished, I moved on to the audio project. With the help of SDLMixer documentation, I implemented support for playing sound effects/short sounds and music. Following that, I tackled the physics project, dedicating more time to learn about the library by reading articles and documentation due to its complexity. I also explored the option of visualizing the colliders of physical bodies, a feature beneficial for both engine development and user understanding. While Box2D's documentation had examples using OpenGL for drawing, I had to implement those drawing functions with SDL since our engine uses SDL.
Next, I implemented the ECS (EntityComponent-System) project, crucial for testing and visualizing initial scenes. I also implemented the main loop of the engine with a fixed time interval for the physical world. With the main projects implemented, I started developing the first basic components such as Transform, Image, PhysicBody, and SoundEmitter.
For a period, I focused on expanding and testing the components and functionality implemented in the projects. For example, I added a collision matrix to the physics project for collision filtering, implemented various types of PhysicBody (colliders with special shapes), synchronized physical bodies with entity transformations, collision detection, pixel-to-physics unit conversion, a new ParticleSystem component for particle systems, implemented a resource manager to avoid loading duplicate resources, enhanced sound components to include horizontal panning and 2D sound, among other features.
As the editor progressed, I implemented logic to read the data generated by the editor, such as prefabs. Additionally, I implemented the project management window in the editor, added error handling throughout the engine to ensure continuous and predictable execution by printing errors to the standard output. I also introduced error handling in the editor, logging error information during execution to a log file. I created a directory structure for both the editor and the engine, making the development cycle more comfortable. I implemented a preferences window to adjust engine parameters, such as gravity of the physical world, audio engine frequency, game window size, among many others. I implemented scene flow, saving the last opened scene, displaying the viewport in a special way if no scene is open, and showing the name of the current scene along with its corresponding content in the viewport.
Finally, I changed the SDL usage for controller implementation in the Input project from SDLJoystick to SDLGameController, as it is better suited for controllers. I added more parameters to the preferences window, especially for Input, quick key binding. I also improved the project management window to allow project deletion and sorting projects by last opening order.