Skip to content

Initializing a Module

vampcat edited this page Oct 29, 2018 · 3 revisions

Modules

Modules are the basis of content in the game. Modules can be created by anyone and don't have to be checked by anyone to run in your local game. The official modules are kept in here. Each module contains a faction, which is a group of assets (ships, items, guns), that are related in the game. Usually a module defines a few ships, guns, projectiles, etc, that are aesthetically or thematically cohesive.

Locally, modules in Destination Sol are situated under the /modules/ directory. To add your own module, simply navigate to the root of your Destination Sol workspace, open a command line there. Run ./groovyw module create <module>, where <module> is the namespace of your new module. Note: You might need to change the remote of your new module, because the default remote, origin, points to https://github.com/DestinationSol/<module>

Module JSON

The module.json in the root of your module file contains basic information about the module, like the following required fields:

  • id: a unique string that will be used as the namespace for the module. Note: This must be the same as the name of the directory your module is in
  • version: The current version of your module. Feel free to update this as you feel your module evolves
  • displayName: a user-friendly version of the id, used to represent your module in-game.
  • description: a user-friendly concise description of the contents of the module
  • dependencies: Any module yours uses for assets. Most modules depend on core for some sound assets. Note: Dependencies will be fetched from the official module repositories when invoking ./groovyw module recurse <module>

For this tutorial, we'll use the mechanical module as reference. This is what the module.json file for mechanical looks like:


{
    "id" : "mechanical",
    "version" : "0.0.1",
    "displayName" : "Mechanical Faction",
    "description" : "Ships and other content to enable the mechanical faction in-game.",
    "dependencies" :  [
        {
            "id" : "core"
        },
        {
            "id" : "deepspace"
        },
        {
            "id" : "tribe"
        }
    ]
}

Right now, modules in Destination Sol only support asset files, not code files. All these assets are placed under the assets directory, which is situated in the root directory of your module along with the module.json. The assets folder contains other sub-folders, that contain specific types of assets. Here is what the folder structure for draconic looks like:

draconic
└── assets
    ├── configs
    ├── items
    │   ├── clips
    │   │   └── fireballClip
    │   └── guns
    │       └── scorcher
    ├── ships
    │   ├── draconicCapital
    │   ├── draconicLarge
    │   ├── draconicMedium
    │   ├── draconicStation
    │   └── draconicTiny
    └── textures
        └── projectiles