Skip to content
Benjamin Amos edited this page Mar 6, 2022 · 1 revision

Overview

Broadly, Destination Sol can be divided into four distinct areas:

  • Engine
  • Facades
  • Core Module
  • External Modules

The engine is the heart of the game. It contains all the core logic for rendering, UIs, ECS and key game mechanics. It is entirely responsible for controlling the main menu, loading modules, world generation (augmented by modules), asset management and much more. Everything code-wise in Destination Sol is currently held in the engine, although some of this functionality may be moved later into modules. The engine contains its own small internal module for the functionality that it directly manages.

Facades are bootstrap programs that take the game up to the point of running. Facades are responsible for creating a suitable runtime environment for the game to execute in. They are typically initialise platform-specific graphics, provide the libGDX platform and create the initial module environment. Destination Sol currently has two facades: the desktop facade and the Android facade.

The core module contains most of the assets used when playing the game. The base game requires the core module to be present. Whilst no code is currently held in the core module, there is the possibility of moving some engine functionality into there in the future.

Lastly, we have external modules. These modules are not part of the base game but can be added to augment it with new features and content. Modules are usually held under the DestinationSol organisation on GitHub. Anyone can create and share a new module for the game.

The Engine

Structure

  • src/main/java/org/destinationsol - The main engine code
    • SolApplication.java - SolApplication is the entry-point to the game from the facades. Everything that happens in the code starts here, including the update and rendering loops.
    • world/ - The world generation system. Most of the in-game universe is generated by the classes here.
    • ui/ - This stores the core UI classes for both the original built-in UI system and newer NUI UI.
      • SolInputManager.java - This class is responsible for most input handling in the game. It also manages UI screens for the built-in UI system.
      • SolUiScreen.java - The base class for all screens using the built-in UI system.
      • TutorialManager.java - This class manages running the entire tutorial.
      • nui/ - All the newer NUI code is held here.
        • NUIManager.java - The main class for handling NUI screens. This class is also responsible for managing the NUI render/update loop.
        • NUIScreenLayer.java - The base class for all NUI screens.
        • widgets - Destination Sol uses some custom NUI widgets to implement things such as flashing (warning) buttons. The code for these widgets is stored here.
        • screens/ - All NUI screens created so-far are held here
        • screen/mainMenu - All of the main menu screens are held here.
  • src/main/resources/org/destinationsol- The engine module. This holds key assets needed for the engine to operate, such as the main menu screen and cursors.
    • assets/ - This contains the assets for the engine module
      • ui - This contains the layout definitions for the NUI UIs.
      • fonts- This contains the primary game font Jet Set.
      • music - The in-game music is stored here.
      • schemas - JSON schemas used for validation are held here.
    • module.json - The definition of the engine module. This doesn't change much, since all modules implicitly depend on the engine module.

Facades

  • The desktop facade, used for Windows, macOS and Linux, can be found under the desktop root project.
  • The android facade can be found in the DestSolAndroid repository.

Core Module

Structure

  • modules/core - The core module is located here.
  • assets
    • sounds - In-game sounds are stored here. They use the OGG file format.
    • configs - Configuration files for most things are stored here. These are used in world generation, to define factions, planets and much more.
    • emitters - In-game particle emitter definitions are stored here. See Particle Emitters for more information.
    • grounds - The ground tiles for planets are stored here.
    • items - In-game item definitions are stored here. See Adding content to modules for more information.
    • mazes - The layout of in-game mazes is stored here.
    • ships - In-game ship definitions are stored here. See Creating a ship for more information.
    • textures - In-game textures are stored here. They typically use the PNG format.

External Modules

See Adding content to modules for more information.