Skip to content

Contributing

ラ⭐ edited this page Jan 26, 2023 · 8 revisions

Project Layout

  • .msvc: These are imports for the Visual Studio build
  • .cmake: These are imports for the CMAKE build (TODO)
  • code: Project module directory
  • conda: Code for the conda cli tool
  • external: Submodules and code for external dependencies
  • test: Testing directory
    • game-test: Tests for specific parts of the game logic
    • common-test: Tests for everything else

Project Modules

  • code/common: OS abstractions and commonly used types and helpers
  • code/graph: Shared graphics types and helpers
  • code/dc2: Engine code and RE (name subject to change)
  • code/host: Host interface. Implements everything for interacting with the host system including input, message pump, logging, etc
  • code/script: RS and SPI scripting engines (note: currently some of the scripting is still in dc2)

Common

  • aligned_allocator: Used when std types (std::vector) need heap allocations aligned to a specific boundary (for use in SIMD, for example)
  • bits: Contains a bunch of helpers for dealing with sign extending, portable booleans and bit manipulation.
  • clock: Wall clock implementation and stopwatch timer class
  • console: Helpers for writing to the debug console (not currently thread-safe)
  • console_logger: Registers the logger with the logging system. Subject to move at a latter time.
  • constants: Bunch of useful constants. Perhaps not my best idea. Subject to remove.
  • data_stream: Various classes for dealing with byte streams.
  • debug: Debugging helpers and macros
  • dynamic_library: Helper class for dealing with .dlls and .sos
  • file_helpers: Number of helper functions for dealing with filesystems
  • helpers: Currently only holds a custom to_underlying function with C++20 support
  • log: The logger. Implemented as a callback system. Register a logger and provide the logic for it in a callback function which gets executed when a log event happens. Also not thread safe yet.
  • macros: A number of preprocessor macros such as ALWAYS_INLINE and MAYBE_UNUSED.
  • math: Math functions
  • platform: Describes the host platform.
  • scoped_function: Helper for RAII-style cleanup of non-RAII-style code
  • strings: Helper functions for dealing with strings
  • synchro: Threading helpers
  • types: Type aliases
  • window_handle: Struct for dealing with window system integration.

Checking Out

TODO

Extracting Game Data

TODO

Building

OpenCloud

  • Open OpenCloud.sln
  • Right click the host project and select Set as Startup Project
  • Build or Debug

Conda

  • Open OpenCloud.sln
  • Right click the conda project and select Set as Startup Project
  • Build or Debug

Coding Guidelines

  • Always use common type (types.h) aliases instead of builtin types
    • uint instead of unsigned int
    • sint instead of int
    • f32 instead of float
    • f64 instead of double
    • u32 instead of uint32_t
  • Do not use std::filesystem
    • use file_helpers.h instead
  • Do not use std::cout or similar C++ style output streams
    • use the various log_{channel} macros (log.h) or console instead
  • Do not use exceptions
    • If the application experiences a fatal error call the panic macro (debug.h) with an apt message
    • panic should be used as close to the actual error as possible.
Clone this wiki locally