This repository is a combination of the class library which runs the game, as well as the game server and client libraries.
For additional information on the game server, view the readme in the Server
directory.
Ensure that you have the following programs installed:
- A C# IDE like Jetbrains Rider or Visual Studios Community 2019
- .NET standard 2.0 framework and .Net Core 7.0
- Git
For local server development:
Note: Docker Desktop (available on Windows, Mac, and Linux) includes Docker Compose by default. If this is your first installation of Docker, I would recommend just installing Docker Desktop. Docker Desktop provides a nice GUI that shows you all of your images, running containers, volumes, etc. so that you don't have to remember or worry about any docker CLI commands.
-
Clone this repository:
git clone [email protected]:Subterfuge-Revived/Remake-Core.git
- Add your fork as a remote:
cd Remake-Core
git remote add <yourName> <URL to your fork repository>
-
Using your IDE, open the
SubterfugeRemake.Shared.sln
file. This will open the project within your IDE. -
To verify things worked, run the unit tests. Expand the
Engine
folder and right click onSubterfugeCoreTest
and click "Run unit tests" (or similar). If your IDE does not have the ability to do this, the following command can be executed to run the tests instead:
dotnet test Core/SubterfugeCoreTest
- Watch the tests pass!
Note: The SubterfugeRestApiServerTest
project requires both the database and the server to be running in order to pass.
Please see the Server readme for more information about the server.
The Models project is a class library that contains C# classes that are shared between the server and the client libraries. This project mainly contains Server-client classes that are shared between one another and are generally used to produce network calls, or are class objects that can be sereialized from the server's response. These are mainly networking classes and should be pure classes with only fields and no methods.
The bread and butter. This project contains all of the game logic. Generating the game state, loading a game from the server, creating a new game, launching a sub, specialists, combats, outposts. Anything in-game related is done here. This library is used in Unity to be able to determine what the current state of a game is, and also used to load a gamestate from the network. This project is also used on the server side to validate network requests, verify submitted events, and perform other validation checks, for example, if there is a winner of the game.
Unit tests for Subterfuge Core. This project is purely for unit testing the main game logic. Unit tests ensure that upon future updates, existing code and functionality is not broken when new changes get added to the game. These unit tests get executed on every merge request and are REQUIRED to pass before a merge request can be accepted. Ensure that any new code you write gets a unit test created for it.
A class library that creates database models for MongoDB, and sets up all of the logic for MongoDB around the database models. The data here is all encapsulated by interface methods which make it easy to swap out our database provider with another database if we chose to in the future. Writing to and reading from the database is done here.
A client repository for sending API requests to the server. This client library is used to perform integration tests against the server, but also used by the unity client to make interacting with the server easier.
The subterfuge game server. This project integrates database storage with incoming client API requests to facilitate multiplayer play. The server stores and processes information like: Creating game lobbies, joining game lobbies, submitting game events, adding friends, sending chat messages, and more.
Unit tesets for the Subterfuge Server. This project performs integration tests against the SubterfugeServer and requires a running database. This project tests various server endpoints and validates that all of the required server functionality can be performed as expected.
The unity application makes use of the Engine
projects. Specifically SubterfugeCore
which contains a class library with all of the primary game logic.
Once the SubterfugeCore
project is build, a dll
file is generated which needs to be included in the unity editor (the unity repository has this file committed to ensure devs don't need to have both repos running).
However, when working with the dll
, it is a good idea to view the API documentation on the class library here to understand how to use classes that are avaliable.
For example, how to load a game, parse a gamestate from the server, launch a sub, alter the time machine, etc.