🚀 A 2D shooter game where levels are procedurally generated using graph theory.
Our level generation system is based on three steps:
A graph is first created to structure the level. By using graph theory, we ensure that the player does not have to go through the same corridor twice to explore the entire map. To achieve this, the graph must be Eulerian and planar (otherwise, the edges cross).
🔹 Currently, our implementation generates a linear graph.
📌 Next improvement: Generate more innovative graphs: cycles, semi-Eulerian and Eulerian (non-linear) graphs.
Each edge of the graph is replaced with a corridor, and each node is replaced with a room. We have worked on making the corridors more natural and smooth, inspired by additive synthesis:
🔹 We model a straight line between the rooms to be connected and then add a series of perturbations, with decreasing maximum amplitude at each iteration.
🔹 The perturbations are sinusoidal curves whose frequency is divided by 2 at each iteration.
🔹 Each perturbation is assigned a random amplitude modifier within the range [1;-1], which is a factor of the maximum amplitude of the perturbation. This introduces randomness into the layout.
📌 Next improvement: Generate more complex rooms (circular, rectangular, or more irregular shapes) to diversify environments.
Once the level structure is defined, we add entities inside the rooms:
📌 Next improvement: Place entities and bonuses more realistically, considering room layouts.
Weapons have five characteristics: fire rate, range, firing mode (auto or semi-auto), projectile speed, and damage. The Revolver is the default weapon equipped by the player. The Submachine Gun, Semi-Automatic Rifle, and Bolt-Action Rifle can be found in weapon crates.
When stepping on a weapon crate, you swap your weapon with the one inside. The health crate restores 1 health point if needed. There is one of each type of crate per level.
You complete a level when all enemies have been eliminated. A new level then loads.
You can test the game without needing to install Unity!
- The
build/
folder contains the compiled version of the game (a3112b4
).
- Open the file
My project.exe
. - The game starts immediately, no installation required!
Action | Default Key |
---|---|
Move | W / A / S / D |
Aim | Left Shift |
Shoot | Left Click |
Exit | Escape |
Activate a cheat code | \ |
Regenerate the level | G + E + N |
To use a cheat code, hold the Activate a cheat code key along with the cheat code keys. I was unable to regenerate the level during my last tests (both in the editor and in the compiled version).
❌ The level does not reload in the final build?
Issue: When the last enemy is killed, the level does not reload.
If you have improvement ideas or find a bug, feel free to share them with me 😉.
This project is under the MIT license. You are free to use and modify it, but please credit the original author.