How bohemiainteractive/cwr works
Purpose and build shape
This is the C++20 remastered engine/game source for Arma: Cold War Assault, centered on the Poseidon runtime. CMake is the top-level build system; Clang presets target Windows x64 and Linux x64. Game assets are external and must be supplied at runtime. Key build roots: CMakeLists.txt, engine/Poseidon/CMakeLists.txt, vcpkg.json.
Executable entry points
The primary client and dedicated-server applications wrap the shared engine:
• Client: apps/cwr/Game/WinMain.cpp, apps/cwr/Game/GameApplication.cpp
• Dedicated server: apps/cwr/Server/ServerMain.cpp, apps/cwr/Server/ServerApplication.cpp
• Demo client variant: apps/cwr/GameDemo/GameDemoApplication.cpp
Other executables expose engine capabilities: evaluator CLI (apps/tools/Evaluator/Cli/main.cpp), Studio asset browser (apps/tools/Studio/main.cpp), and format/tool commands (apps/tools/Tools/main.cpp).
Runtime orchestration, game, and scripting
Platform/application startup establishes global runtime state, configuration, modules, and frame lifecycle. The game loop drives world/UI/network progression; game commands expose behavior to mission scripts.
• engine/Poseidon/Core/Application.cpp
• engine/Poseidon/Core/Game/GameLoop.cpp
• engine/Poseidon/Game/Commands/GameStateExt.cpp
• engine/Evaluator/EvalState.cpp
• engine/Evaluator/SqsRunner.cpp
Control flow is broadly: application startup → config/profile/mod resolution → mission/world loading → per-frame input, simulation/AI/network, render/audio/UI → orderly shutdown.
Content and persistence boundary
The asset layer mounts loose files and packed addon archives, parses legacy configuration and binary formats, and makes models, terrain, audio, and mission content available to runtime systems. Mod selection/install is a core boundary between external game data and engine state.
• engine/Poseidon/Asset/Addon/AddonSystem.cpp
• engine/Poseidon/IO/PackFiles.cpp
• engine/Poseidon/IO/ParamFile/ParamFile.cpp
• engine/Poseidon/Core/ModSystem.cpp
• engine/Poseidon/World/Terrain/WrpReader.cpp
World simulation and presentation
World owns scenes, terrain, entities, animation, collision, and AI; it produces scene inputs for rendering. The graphics abstraction separates engine-facing rendering from the OpenGL 3.3 backend. Input is SDL-oriented, while audio uses interfaces with OpenAL production implementation and dummy/text alternatives.
• engine/Poseidon/World/World.cpp
• engine/Poseidon/World/Simulation/Simul.cpp
• engine/Poseidon/AI/AICenter.cpp
• engine/Poseidon/Graphics/Rendering/Frame/BuildFrame.cpp
• engine/PoseidonGL33/GraphicsBackendGL33.cpp
• engine/PoseidonOpenAL/SoundSystemOAL.cpp
Multiplayer and external services
Networking implements legacy and newer transport/session paths, client/server game replication, mission/custom-asset transfer, authentication, moderation, and voice routing. Clients browse and servers publish through the master-server protocol/service. Voice travels through network transport and Opus/OpenAL capture-playback components.
• engine/Poseidon/Network/Network.cpp
• engine/Poseidon/Network/NetTransportNet.cpp
• engine/Poseidon/Network/MasterServerServiceClient.cpp
• engine/Poseidon/Audio/Voice/VonTransport.cpp
• mserver/MasterService/src/main.rs
The master service is a separate Rust HTTP service with browser web assets; related Rust crates provide client protocol and PBO/archive support: mserver/Client/src/lib.rs, mserver/Archive/src/lib.rs.
Automation and deployment
Trident is a Rust harness that launches/coordinates game instances and scripted integration, multi-client, and stress scenarios. Docker includes master-service and Steam-runtime build images.
• engine/Trident/src/main.rs
• engine/Trident/src/scenarios/integration.rs
• docker/papa-bear-master-service/Dockerfile
• docker/steamrt4/Dockerfile
Main entry points: Application.cpp Application lifecycle · GameLoop.cpp Game loop · World.cpp World simulation · CMakeLists.txt CMake build
Components 19
Build & delivery
- CMake build · Builds C++20 engine, applications, and platform targets.
CMakeLists.txt
Applications
- Game client
apps/cwr/Game/GameApplication.cpp - Dedicated server
apps/cwr/Server/ServerApplication.cpp - Demo client
apps/cwr/GameDemo/GameDemoApplication.cpp - Engine tools · Evaluator, Studio, and format-tool executables expose engine capabilities.
apps/tools/Tools/main.cpp
Poseidon runtime
- Application lifecycle · Establishes global state, configuration, modules, and shutdown.
engine/Poseidon/Core/Application.cpp - Game loop · Advances input, simulation, networking, presentation, and UI each frame.
engine/Poseidon/Core/Game/GameLoop.cpp - Mission scripting · Game commands and evaluator state expose gameplay to mission scripts.
engine/Evaluator/EvalState.cpp - Content & mods · Mounts external loose/addon data and resolves profiles and selected mods.
engine/Poseidon/Asset/Addon/AddonSystem.cpp - Legacy format readers · Reads packed archives, parameter files, and terrain formats.
engine/Poseidon/IO/PackFiles.cpp - World simulation · Owns terrain, entities, collision, animation, AI, and simulation.
engine/Poseidon/World/World.cpp - AI center
engine/Poseidon/AI/AICenter.cpp - Rendering pipeline · Builds scene frames through an engine-facing graphics abstraction.
engine/Poseidon/Graphics/Rendering/Frame/BuildFrame.cpp - Audio & voice · Provides sound output plus voice capture/playback and routing.
engine/PoseidonOpenAL/SoundSystemOAL.cpp - Game networking · Supports legacy/new transport, sessions, replication, transfers, and moderation.
engine/Poseidon/Network/Network.cpp
Online services
- Master service · Provides server publishing and client browsing protocol endpoints.
mserver/MasterService/src/main.rs - Master client & archive crates · Supply master protocol and PBO/archive support.
mserver/Client/src/lib.rs
Automation
- Trident harness · Launches and coordinates integration, multi-client, and stress runs.
engine/Trident/src/main.rs - Container images · Builds master-service and Steam-runtime environments.
docker/papa-bear-master-service/Dockerfile
Connections 25
- CMake build → Game client: builds
- CMake build → Dedicated server: builds
- CMake build → Demo client: builds
- CMake build → Engine tools: builds
- Game client → Application lifecycle: starts
- Dedicated server → Application lifecycle: starts
- Demo client → Application lifecycle: starts
- Engine tools → Application lifecycle: uses engine
- Application lifecycle → Content & mods: resolves config, profiles, mods
- Application lifecycle → Game loop: runs
- Content & mods → Legacy format readers: loads through
- Legacy format readers → World simulation: supplies missions and terrain
- Game loop → Mission scripting: executes
- Mission scripting → World simulation: controls
- Game loop → World simulation: advances
- World simulation → AI center: coordinates
- World simulation → Rendering pipeline: produces scene inputs
- Game loop → Audio & voice: updates
- Game loop → Game networking: updates
- Game networking → Audio & voice: routes voice
- Game networking → Master service: browse and publish
- Master service → Master client & archive crates: uses protocol/archive support
- Trident harness → Game client: launches
- Trident harness → Dedicated server: coordinates
- Container images → Master service: packages