Mapping

Master Racer 4 uses func_godot to import .map files for its maps. These are basically brush-based maps like the ones used in Quake.

Setting up the TrenchBroom editor

Master Racer 4 has a bunch of FGD entity definitions to build levels with on TrenchBroom, so a game configuration for it has to be generated.

You should now see a game configration named “Master Racer 4” when you open up the TrenchBroom editor.

Level structure

Master Racer 4 levels are scenes based on res://scenes/levels/_level.tscn, with a root node of Level-extending class. _level.tscn is just a base class, and though not actually abstract, it should probably not be used for making levels. It serves the purpose of allowing levels with different game-modes to exist.

A brief overview of a level:

Currently the only extension to Level (and thus the only kind of levels) is the StreetRace. Street race levels are based on the _level.tscn scene but are of StreetRace class. These are defined by being levels with a finish line, commuter spawners, blast-zones, player lives, and respawning triggered by checkpoints.

Building maps

Building maps should be realtively intuitive if you know your way around TrenchBroom and use the res://assets/maps/sr_testcity.map test map as an example. If you don’t, read up on its manual, it’s brief and helpful.

https://trenchbroom.github.io/manual/latest/

Master Racer 4 currently has some custom FGD entities. func_kill, func_respawn and func_finish are very straightforward, their in-editor descriptions should suffice.

func_commuter_spanwer is a bit trickier: a brush with the origin texture will be used to set the Godot node’s transform origin, and any other brush for the player-detecting area. Do use skip textures on those latter ones.

To build a .map file, you’ll have to add a FuncGodotMap node to your level scene and set its local_map_file to the path of the .map file. Then point your node level’s func_godot_map to that node.

With the map node selected, you should see a “Build” button on the 3D view’s top toolbar. On-build, the level node should call _on_func_godot_build_complete which takes care of doing stuff like finding and setting the finish line node, commuter spawners, their respective level properties, etc.1

Important: it’s known to happen that the editor crashes when saving if you have built a map more than once. To work around this, every time before building, delete all the child nodes from the map node.

Custom FGD entity definitions

https://func-godot.github.io/func_godot_docs/FuncGodot%20Manual/FuncGodot%20Manual.html

Other editors (NetRadiant, JACK, etc.)

You’re on your own.


  1. This all executes without needing to run the project because all scripts involved are tool scripts.

Home