Game

Game Project Structure

How a Nevo game project is organized and what each folder is for.

Overview

Nevo-base is the current reference game project. It contains game code, runtime assets, public engine headers copied from Nevo-Engine/shared, and generated engine binaries.

Nevo-base/
  src/
  game/
    assets/
    levels/
    materials/
    shaders/
    systems/
    textures/
  include/
    nevo/
  lib/
  build/
  buildtmp/
  CMakeLists.txt
  build.bat
  build.sh
  run.bat
  run.sh

Code

src/main.cpp is the application entrypoint. The reference flow is:

  1. Set up crash/logging handlers.
  2. Create the singleton Public::Engine.
  3. Pass command-line flags through GetFlagManager().passFlags(argc, argv).
  4. Register custom scene component creators with Engine::RegisterComponent(...).
  5. Call engine.Initialize().
  6. Register custom ECS component types and systems with the Coordinator.
  7. Set system signatures.
  8. Load a scene with engine.LoadScene("scene_name").
  9. Call engine.Loop() while engine.IsActive().
  10. Call engine.Shutdown().

Runtime Assets

game/ is the runtime working directory.

FolderPurpose
game/levelsJSON scene files loaded by Engine::LoadScene.
game/assetsMeshes and model files such as .glb, .gltf, and .obj.
game/materialsMaterial JSON files referenced by mesh renderers.
game/shadersShader JSON metadata plus GLSL/HLSL shader files.
game/texturesPNG textures used by materials and LUTs.
game/systemsGame-owned C++ components and systems, such as Freecam and MonkeyRot.

Scene loading searches in this order:

  1. <name>.json
  2. levels/<name>.json
  3. scenes/<name>.json

So engine.LoadScene("outside") resolves game/levels/outside.json in the reference project.

Public Engine Headers

Game code should include public engine headers from include/nevo after artifacts are synced:

#include <EngineExports.hpp>
#include <ECS/components/Transform.hpp>
#include <ECS/components/Rigidbody.hpp>
#include <ECS/systems/builtin/PhysicsSystem.hpp>

Those files are copied from Nevo-Engine/shared. Avoid including include/internals/** from game code.

Binaries and Generated Output

FolderPurpose
lib/Engine runtime libraries copied from engine builds.
build/Runnable game executable and runtime DLL copy.
buildtmp/CMake intermediate build directory for the game.
include/nevo/build_number.hppGenerated build number header copied from the engine.

Build scripts can rewrite binaries and copied headers. Inspect git status before committing artifacts.

Custom Systems

Game systems are regular C++ types. Nevo-base keeps examples under:

game/systems/freecam/
game/systems/monkeyrot/

A custom component that can be loaded from scene JSON needs two registrations:

engine.RegisterComponent("Freecam", CreateFreecamComponent);
engine.Initialize();

auto& coord = engine.GetCoordinator();
coord.registerComponent<Freecam>();
auto system = coord.registerSystem<FreecamSystem>();

Engine::RegisterComponent maps the JSON "type" string to a creator function. Coordinator::registerComponent registers the C++ component storage.