Metric Panda Games

One pixel at a time.

Custom Tools for Game Development

Rival Fortress Update #23

There’s an excellent chapter in Game Engine Architecture about custom tools that are often developed to aid in the making and debugging of a game engine.

Today I’ll talk about the ones I developed for Metric Panda Engine, the game engine that powers Rival Fortress.

The Shell Swiss Army Knife

I spend most of my development time in the terminal, and the way I interact with the game, engine or other standalone tools is through a multi-purpose shell script.

This is what the output of the panda help command:

Usage: panda <command> [<args>]

build and target management
   init       Initialize all platforms
   compiler   Change current compiler
   clean      Clean all build artifacts
   nuke       Remove build and output folders

switch the active build to the another platform
(*)linux      Compile for Linux
   osx        Cross-compile for OSX
   win        Cross-compile for Windows

running and testing
   game       run game
   server     run server
   assets     run asset preprocesor
   meta       run meta reflector on codebase
   test       run unit tests
   bench      run performance benchmarks
   log        tail game or server log

release and deployment
   release    Build in release mode for all platforms
   deploy     Package and deploy release builds

utility functions
   cloc       Count lines of code
   ctime      Build timings and statistics
   demo       Start the game and capture video
   duplicates Show duplicate symbols between shared libs

See panda help <command> for additional arguments

The script is composed of a handful of small git-style shell scripts that delegate the heavy lifting to the appropriate standalone tool or application.

The Asset Preprocessors

I talked in previous posts about the asset preprocessor. It’s a collection of asset related tools that can be run as a command line utilities or directly from the editor.

The tools operate by parsing a JSON manifest file and are capable of:

  • Parsing OBJ and FBX models and converting them to vertex/index buffer streams,
  • Validating and minifying GLSL shaders and combining them into shader pool
  • Setting up material parameters and default values
  • Packing bitmap fonts into multiple texture atlases for different Unicode ranges along with other UI related textures
  • Combining and compressing textures
  • Converting sound files and packing them based on priority and/or usage order
  • Combining and validating LUA scripts

The Meta Reflector

The meta reflector is a preprocessor that generates all sorts of code, ranging from data structures, boilerplate code, validation and data mappings between .ini configs and runtime data. Take a look at this post for more about it.

The Game Editor

Last but not least is the game editor. This is a module that can be loaded from the game as a dynamic library and allows the interaction with other tools from the GUI as well as manipulation of the game world. I’m still actively iterating on the editor as most of the functionality required surfaces when writing gameplay code.