Introduction to the codebase

Welcome to the code! We're going to take a quick look at how things are organized, then in the next tutorial we'll use that knowledge to write a simple system.

1. Understanding the project structure

We could jump straight into writing a system, but learning these four simple concepts will help us frame what we're doing:

  1. Engine/Project
  2. Client/Server
  3. Modules
  4. Module Extensions

Engine/Project

When we look at a repo like Repose, we're looking at a "project". Projects run on top of the "engine". The relationship is as you'd expect: the engine provides as much generic code as it can, and the project holds your specific code and art assets.

Client/Server

The engine and project both split their code into "Client" and "Server". You'll often see similar classes in both, which represent the two sides of our networked system. For example, the Client and Server both have a Simulation class. They're both responsible for managing the world state, but the Server's Simulation is the "real, authoritative" state, and the Client's is just a replication.

Modules

Modules are just a way for us to organize code. The Server has 2 modules: Simulation, and Network. The Client has Simulation, Network, Renderer and UserInterface.

Module Extension Classes

As a project developer, you need places where you can add code to each of the engine's modules. These places are called "extension classes" (e.g. SimulationExtension).
The extension classes provide empty functions that let you add your code into different parts of the engine. They also provide a set of "dependencies" that your code can call to affect the world.

These concepts are powerful, and are what makes The Amalgam Engine so straightforward to learn. There's a defined place for your code to go, and a small set of dependencies to learn how to use.
This is a good time to look around the codebase and see if you can recognize these patterns in the actual project. When you're ready, check out the next tutorial where we'll build a new system!