Built by: Utsav Lal and Jayesh Gajbhar
Library: SDL2, ZeroMQ, nlohmann/json and C++ 20
The engine was started from the template shared by Dr. Alexander Card in moodle and grew from the same template. Current capabilities include:
- A fully functional Entity Component System
- Keyboard movement using WASD
- Physics with customizable gravity in x and y directions
- Collisions between objects with conservation of kinetic energy
- A simple state machine animation controller
- Fully multithreaded engine
- Custom timeline class with ability to pause, play and increase decrease speed.
- Asynchronous networking capabilities using ZMQ for client server and peer to peer between 3 clients.
- A fully functional Event System where you can raise an event immediately or later or send it to the server.
PS: Remember to run the server first and then the clients
- If there is an existing
build
folder runrm -r build
to clear and remove the folder - Run
mkdir build && cd build
from the root to create a new build folder and change directory to it - Run
cmake ..
to generate required make files in build folder - Run
make all
to compile the binaries (this includes the game engine and game binaries) - Run
./shade_engine_server
to start the server for the game engine - Run
./shade_engine
to start the game engine or the game in this version
Please ensure that both the server and the game are started with the same messaging system.
PS: Another way to build the project would be to simply open it in CLion IDE and setting the env variables from the build menu.
No further action is required for building the games. The engine and game are run from the same executable for this version.
- Use
AD
to move the player - Use
Space
to jump - Use
Shift + D
to dash right orShift + A
to dash left
- If you fall down you will die and respawn after 5 seconds.
- If you land on a platform the character will get locked on it unless you move. This is a feature so that player doesn't fall off the platform when it moves.
- If you move towards the right of the screen the camera will pan ahead
- Events: We have the following events in the game: EntityRespawn,
EntityDeath
,EntityCollided
,EntityInput
,EntityTriggered
,MainCharCreated
,PositionChanged
,DashRight
,DashLeft
. There names are self-explanatory. - Delayed Events:
EntityDeath
is a delayed event. It is raised after 5 seconds of the player falling down. - Handlers: Inside
systems/
files which end withhandler
are event handlers. They are responsible for handling the events. For examplecombo_event_handler
is responsible for handling theDashRight
andDashLeft
events. - Networked Events:
MainCharCreated
andPositionChanged
events are networked events - Chords:
DashRight
andDashLeft
are input chord events. They are raised when the player pressesShift + D
orShift + A
respectively.
To clean up
- Run
cd ..
to come back to parent directory - Run
rm -r build
to remove build folder
main.cpp
: This is the main entry point to the codeCMakeLists.cpp
: This is the build file which helps run Cmake and build the projectgame/
: contains the game code (if any) for the projectlib/
: This contains all the source code for the project.core/
: The core elements of the game engine like setting up screen, etcdata_structures/
: The custom data structures for the engineenum/
: Contains all the enumerations for the game engineECS/
: Contains the elements of the Entity Component SystemEMS/
: Contains the elements of the Event Management Systemenum/
: Contains all the enums used in the projectgame/
: This contains game specific code. One such is aGameManager
which is a singleton containing variables shared between the enginegeneric/
: This contains generic classes which might be used by us in the futurehelpers/
: This contains helper functions like random, constants, etcmodels/
: This contains the models for the game engine like theComponent
andData Model
server
: This contains a file calledworker.cpp
which is the main worker for the server.strategy/
: All the classes for strategy pattern (in our case we use it for selecting messaging by JSON or array of vectors)systems/
: All the systems for the game engine likePhysicsSystem
,CollisionSystem
, etc. Systems that end withhandler
are event handlers.