Skip to content
Jakub Baranowski edited this page Jun 28, 2021 · 3 revisions

Guide for Ground Branch Modderes/Contribiutors

If you are looking to create your own game modes here are some of my general recommendations, tips and tricks.

Recommended tools

Visual Studio Code

You can edit lua scripts and csv tables using any text editor but I recommend using Visual Studio Code it's free and has all the features you'll need.

There are hundreds of Lua extensions availble for VS Code, feel free to use any, but I use Lua by sumneko.

Git for Windows

Moreover, I recommend using Git for Windows. Not only will it allow you to clone this repo (or even contribute to it) it will also allow you to easily tail the Ground Branch log file, which in turn will help you debug issue with your game mode (or discover the issue is with Ground Branch ;-) ).

Of course any bash terminal will do. You can probably do all of the stuff described here using PowerShell, however I use Git for Windows, and any "terminal code" mentioned here will be written in bash.

Start simple

If you're creating a new game mode start with the simplest mission set up that fullfills your game mode requirements.

Play test often

Remember to play test often. Hardest mistake to find is the one that you made a long time ago. For example this could look like this:

  1. Create/modify a game mode script,
  2. Create/modify a simple mission for the game mode script,
  3. Play a bit,
  4. Check the log files,

Make this a habbit, prepare a simple mission that will allow you to check if everything works quickly. Don't create elaborate missions or game modes in one go, do it iteratively.

Check log files when debugging

Ground Branch logs are stored in %localAppData%\GroundBranch\Saved\Logs\. If you encounter any issues check the logs. Most probably there's some info on why stuff doesn't work.

Better yet you can "follow" the log while test playing - this will make it easier to find the log that interest you. To do that open Git for Windows (or any other bash terminal) and execute the following command:

tail -f ~/AppData/Local/GroundBranch/Saved/Logs/GroundBranch.log

It may fail if the file does not exist, i.e.: if the game was not started yet. To resolve just launch Ground Branch.

Mirroring AI Loadouts

If you are going to work on AI Loadout it can become tedious to have to copy the loadout files from one folder to the other. That's why I automated the tedious part. To make it work you'll need:

Visual Studio Code - Save and Run extension by wk-j

Visual Studio Code Save and Run extension by wk-j

AI Loadouts Mirroring batch script

I wrote a simple batch script that when placed in the Ground Branch root directory will mirror the contents of GroundBranch\Content\GroundBranch\AI\Loadouts\BadGuys in GroundBranch\Content\GroundBranch\AI\Loadouts\_BadGuys. You can find it on my GitHub gist page. Simply download the file and place it in Ground Branch root directory.

Set up the batch file to run whenever a loadout is saved

In Visual Studio code click on File > Save Workspace As... to create a workspace file. Then open the workspace file and add a configuration for the Save and Run extension to run MirrorAiLoadout.bat whenever an AI Loadout file is saved. Feel free to coppy my settings:

{
  "folders": [
    {
      "path": "."
    }
  ],
  "settings": {
    "saveAndRun": {
      "commands": [
        {
          "match": "GroundBranch\\\\Content\\\\GroundBranch\\\\AI\\\\Loadouts\\\\BadGuys\\\\.*.kit",
          "cmd": "./MirrorAiLoadout.bat",
          "useShortcut": false,
          "silent": false
        }
      ]
    }
  }
}

Ground Branch Tools

I've also created a simple command line tool that can be used to:

  • mirror AI loadouts, and
  • easily package game modes.

It gives a lot more options than the batch file, but is very much a work in progress. Nonetheless, if you are interested please go to Ground Branch Tools GitHub page.