On this page
What goes into a level
A level is a folder of CON scripts and binary maps that places everything on the other asset pages: the terrain, hundreds of static objects, and per game mode the spawners, control points and spawn points.
BF22142Heroes

| Part | Files | Read by |
|---|---|---|
| terrain (layer by layer) | Heightdata.con, HeightmapPrimary.raw, Terrain.con, colour / detail maps, terraindata.raw | bf2-terrain |
| static objects | StaticObjects.con (Object.create lines over templates like the house) | bf2-editor level.rs LevelData::load |
| game modes | GameModes/<mode>/<size>/GamePlayObjects.con: spawners (the jeep), control points, spawn points | the same |
| overgrowth, undergrowth, water, sky, roads | Overgrowth/*, *.tai, Water.con, sky.con, CompiledRoads.con | bf2-terrain, bf2-render |
| lightmaps | per static object and terrain patch, baked by the 2005 editor | bf2-render |
Read on#
- Level authoring: the folder file by file, with Strike at Karkand.
- Level editor plan: every file of a BF2 / 2142 / Heroes level with its bf2-rs reader, what an editor must write back byte for byte, and the order of the terrain, painter, road and lightmap tools.
- Terrain: the village's heightmap, patch grid, per-patch maps and roads decoded.
- Archives and the file system: how a level's
server.zip/client.zipare mounted, and how a Heroes variant level mounts its base level. - The other asset pages: meshes, textures, materials, sounds, objects, animations, effects.
How it is tested#
- A level's settings (
crates/bf2-editor/tests/level_settings_bf2.rs): one shipped level'sInit.convalues (teams, kits, tickets per size, the view distance) are read, saved and read again. - Every level's parts: the terrain formats (terrain), the simple shadow maps of every level (
crates/bf2-render/tests/retail_shadows.rs), and the pure server's check that every shipped level passes (server start-up). - In play: every scenario loads a level on a real server and client.
No address stands on this page. The level load's order is on frame and tick order and has its own tests there.
In the code#
| What | Where |
|---|---|
| a level's archives and their mounting | crates/bf2-fs |
| terrain, heightmaps, undergrowth and overgrowth files | crates/bf2-terrain (terrain in the engine) |
| the level load's order of scripts on the server | crates/bf2-server (start-up and main loop) |
| a layer's objects for a game mode | game modes |
| drawing the level | crates/bf2-render |
| editing and exporting a level | crates/bf2-editor |
Source:
docs/dev/assets/level.md · built from bf2-rs e3b4f05 · part of the Battlefield 2 / 2142 / Heroes reimplementation. Not affiliated with EA or DICE.