Rewrite of a game from my studies: a 2D roguelike in Godot 4 with C#, and an ASP.NET Core score API (JWT accounts, PostgreSQL) that checks every run by replaying it.
DoneSprint S23-S25 · 13 points
In short, no jargonfor non-developersRead the summaryClose
What it is
A dungeon-exploring video game, with an online leaderboard of the best scores; each score is checked by replaying the game, to prevent cheating.
What it is for
The most complete project of the portfolio: a game, a server, player accounts and a database.
What it shows
Running a complete project in C# and .NET, from the game logic to the secured server.
Godot client (Godot 4, C#) → Scores API (ASP.NET Core, JWT): seed, game played
Scores API (ASP.NET Core, JWT) → Rogue.Core (rules, seed, replay): replays the game
Scores API (ASP.NET Core, JWT) → PostgreSQL (ranking in SQL): EF Core
A game in progress
Godot 4 cannot export a C# game to the web: the roguelike runs on the desktop (Windows, Linux, macOS), in a Godot window or in the terminal. Here is a game in progress in the Godot client.
Screenshot taken by the Godot client itself (--screenshot option) after 600 autopilot turns on seed 7, on a virtual screen.
To play at home (.NET 10 SDK; Godot 4.7 .NET for the window; Docker for ranked runs, on the score API):
cd projects/rogue
dotnet run --project src/Rogue.Cli -- --lang en # in the terminal
docker compose up --build rogue-api # the score API, on port 8001
godot --path godot # the Godot window
Tech stack
Godot 4
C#
.NET
ASP.NET Core
EF Core
PostgreSQL
JWT
OpenAPI
xUnit
Docker
Who does what
Godot 4
The desktop client (display, commands, ranked games), exported for Windows, Linux and macOS by CI.
C#
The game rules in a deterministic library, shared by the Godot client, the terminal and the API.
.NET
The common platform: net8.0 for the rules, net10.0 for the rest.
ASP.NET Core
The scores API, which sets the seed of every ranked game and replays it to compute the score itself.
EF Core
Database access and its migrations.
PostgreSQL
Accounts and scores; the leaderboard with DISTINCT ON.
JWT
The accounts' authentication tokens.
OpenAPI
The API description, and Swagger UI to try it.
xUnit
Tests of the rules (generation, field of view, combat, replay) and of the API, on a real PostgreSQL database.
Docker
Runs the API and its database with docker compose.
Definition of Done
Code reviewed, diff by diff
Unit and integration tests green
Green CI on Linux, Windows and macOS when compiled