Manifold

Editor tools for building content for proprietary game formats

Project Overview

Manifold is a suite of tools extending the Unity editor with the capabilities of converting proprietary game binaries into authorable assets and back again. The tools are currently being developed for F-Zero GX (2003, GameCube).

Project Details

Timeline 2018-Present
Role Project owner
Contributors 3

Roles and Contributions

UX Designer
  • Design asset authoring tools and workflow
  • Write usage guides
Programmer
  • Design and implement binary serialization tools
  • Develop various authoring tools
  • Reverse-engineer binaries (model, scene, and gameplay data)
  • Write technical documentation

Built Using

The Objective

Create tools to author custom stages for F-Zero GX (2003, GameCube). Over the course of development, focus shifted a bit to encompass two holistic objectives. Firstly, create a robust asset authoring environment and workflow for stages. The code should include be as reusable as possible to help reverse-engineering other games and enable faster iteration for tools. Secondly, create comprehensive documentation for the data structures. Others should have reference points to help contribute and possibly build their own tools.

As of July 2022, I have built enough tooling to author courses on-par with the content shipped in the game originally. This includes tools which allow creation of animation-based collision data, automatic mesh generation, automatic application of textures with UV-mapping, and embedding special collision data. Users can also place existing models around the stage without the game's usual restrictions. Below is a small demo reel which showcases what the tool can produce.

Editor Tools

Generate Path Animation Curves and Mesh

One of the interesting things about the game data is that it does not store triangle-based collision but 9 animation curves to describe translation, euler rotation, and scale. Thus, to construct data, I have different types of path scripts, each made to easily describe a certain kind of path. This path data can then be sampled to create matrices at set intervals to compute a specific kind of track segment and it's corresponding mesh.

In the video above, I demonstrate the spiral path tool which is useful for rounded corners, loops, and spirals. Independant parameters such as roll and scale are separate, and the start and end radii are parameterized. The TRS animation curves are computed from the specified data.

Apply Mesh and Properties Local to Track

An interesting feature of the game is how it embeds special information local to the track's path transform. It uses 2 animation curves to specify normalized width and offset. I made an editor which will apply the property to the path directly by sampling the path data and programmatically contrusting the desired values. The curves are also renormalized behind the scenes so any curve data will work.

The series typically has these areas to the left, right, or at the center of the track. Therefore, I created some shortcuts to quickly compute the desired offsets so that the user can focus on the width property alone, but also allows for manual offsets if a more complex pattern is desired.

Statistical Analysis

When I began working on the existing codebase in 2018 (after two previous attempts), tools such as Ghidra with modules targeting the GameCube's specific PowerPC architecture did not exist. Rebuilding a symbol map for the game's code was not an option without significant learning and development work. As a result, my approach for uncovering the game assets' structure relied on statistical analysis.

In order to interpret the data, I developed a robust binary serialization library and TSV table writing tools. For any data type I wish to inspect, I write a function which iterates over all the data in every asset of the type the game has and saves it to a spreadsheet. Using Excel, I can quickly assess the data by filtering data columns or using pivot tables. This is particularly useful for asserting all possible values for any given data type and developing new hypotheses. If a theory can hold, I can then read, modify, and write existing files back to disk and see if my theory holds when tested in the game directly.

With enough work, time, and patience, the structures can be well udnerstood. Using this strategy, I have been able to uncover all data structures used in the game's propertietary scene binaries, which the diagram below demonstartes.

Diagram used to visual and compartmentalize the stage file structures.

I see reverse-engineering as a documentation challenge and not a programming challenge. While programming is certainly key to the process, the goal of reverse-engineering is essentially to document a program or file structure so that new data or programs can properly interface with it. To this end, I have created a repository dedicated to documentation for F-Zero GX.

Project Repositories

Below are the repositories related to this project.

Video Development Logs

Here are some select videos from past streams I have done which discuss progress and development of the editor.

Stages I Made

All of this tremendous effort is, of course, so that I may make content for the game. Below are some of the stages that I have made for the game. With the current tooling, a level can be made and iterated on fairly well in about 10 hours, which is a very exciting prospect.

Corrugate Drive

My goal for this course was to have a mix of slip and dirt areas. I also wanted to refrain as much as possible from banking or rotating turns since I've had a habit of doing that with all past courses. The theme ended up forming around these crescent shapes and generally hard-angled turns.

Fire and Ice

I wanted to explore the embedded surface properties available and work the then new spiral path tool through it's paces. I chose to go with the damage and slip areas and tried to find a way to make those areas influence the player's choices differently for between laps.