top of page

Metroidvania Game Engine

Custom game engine made for creating Metroidvania games. The target game we wanted to recreate is Axiom Verge.

display-code_edited_edited_edited_edited
Gameplay Programmer
people-arrows-left-right_edited_edited_e
6 people
tools_edited_edited_edited_edited_edited
Custom Engine

About Broken Towel Engine

Broken Towel Engine is a custom engine created specifically for making Metroidvania games made by a team of 6 programmers using C++. The engine has a Grid-Based Level Editor system for quick level building, an easy setup for a character including running/jumping/attacking which are characteristic for Metroidvania games and the availability of programming enemy behavior using a state machine. These features together provide an excellent base for creating Metroidvania games with ease for both Windows and Switch platforms.

 

Our engine needs to support both Windows and Nintendo Switch game deployment. We used preprocessor guards to define platform specific operations. The structure of the project has a cross-platform setup.

​

The game we tried recreating is Axiom Verge.

​

We started by creating a detailed Technical Design Document detailing all systems the engine needed, things to consider when implementing them, as well as UML diagrams and pseudocode to help with writing the actual C++ code.

Then, we closely followed the document when creating the engine and made a recreation of Axiom Verge using our engine.

Parts of the Technical Design Document written for the custom engine
The engine is a library used by the Metroidvania Game project which runs on both targeted platforms
image.png

Project Roles & Responsibilities

Gameplay Programmer

  • Contribute to the Technical Design Document.

  • Implement core gameplay systems such as Input, Camera and Character Controller. 

  • Work on platformer gameplay features related to movement.​

code_edited_edited_edited_edited_edited.

Scrum Master

  • Agile Project Management through Atlassian Trello.

  • Establishing an environment where the team can be effective.

  • Addressing team dynamics.

  • Ensuring a good relationship between the team and product owner as well as others outside the team.

  • Protecting the team from outside interruptions and distractions.

Entity Component System

I worked on implementing an Entity Component system for our custom engine. I used the EnTT library as it is a popular solution used by many games including Minecraft.

​

I onboarded the team on how to write systems using composition instead of inheritance which is mostly the norm for Unreal Engine.

​

Entities are just unique IDs which are composed from different components and systems operate on these components. The behavior of an entity can be changed at runtime by systems that add, remove or modify components.

Utility functions for Entitites
Onboarding presentation for my teammates
Transform Component updated by the Transform System
image.png
image.png

Input

Since our engine is cross-platform and supports making games on Windows and Nintendo Switch, the input manager is an overarching interface with the specific methods being implemented in separate children classes.

For Windows, I used the GaInput library. For the Switch, we had access to an SDK and Nintendo Developer Account and I used the provided documentation to write the input functionality.

InputClasses.png
Input Manager with separate implementations depending on platform
image.png
InputFlowchart.png
Input Manager UML and implementation
image.png
Different implementation of the same virtual function
image.png
image.png

AddJoystick is a virtual function in the Input Manager class that is overridden for the Windows and Nintendo Switch platforms with the intended implementation.

Camera

The engine implementation followed the TDD closely, especially the UMLs for the class structure and intended behavior.

​

The game has an orthographic camera that follows the player, as intended in the TDD.

Excerpt from the Technical Design Document about the camera system
image.png
Orthographic Camera UML
image.png
Orthographic Camera Class
image.png
CameraFollowPlayer.gif

Character Controller

As the engine we were working on is made for 2D Metroidvania platformers, one of the most important systems to get right is the player controller. Therefore, I put some thought into planning and creating the needed classes.

​

The character controller has editable variables and allows for walking, jumping and crouching. For improving the game feel, I added coyote time and jump buffering to make the player inputs more forgiving.

​

Then I spent some time fine tuning the movement to accurately match the target game in movement feel and recreated a level from the game in our engine.

Planning the character controller inside the TDD
image.png
Player Controller UML
image.png
image.png
Character Controller Component storing important data
&
Character Controller System updating all Character Controller components
image.png
MovementComparison.gif
Moving, crouching and jumping matches the target game Axiom Verge
Delta time implementation for both Windows and Switch
image.png
JumpBuffering.gif
Character movement feel improved by jump buffering and coyote time
jumpComparison.gif
CoyoteJump.gif
Final result:
bottom of page