Skip to content

MonoGame / XNA

MonoGame is an open-source reimplementation of Microsoft’s XNA 4.0 framework; FNA is another. Their games build content (textures, models, effects, fonts) offline into XNB files, and the game’s ContentManager loads each with a type reader named in the file (XNB containers). The one game documented here is STUNTBOOST (Byting Games, a fingerboard racer), a .NET 8 game on BytingGames’ fork of MonoGame 3.8.1 for DesktopGL, with BytingLib and BytingPipeline libraries. Observed · STUNTBOOST

What the format gives and what the game adds

Section titled “What the format gives and what the game adds”
Layer What Page Confidence
container XNB version 5, uncompressed, with a table of type readers XNB containers Proven · STUNTBOOST
built-in content Texture2D as a raw 8-bit surface, strings, byte arrays, sprite fonts textures Proven · STUNTBOOST
effects MGFX version 12, OpenGL profile: GLSL written by MojoShader MGFX effects Proven · STUNTBOOST
game readers a glTF reader, a QOI image reader, a collision reader, shortcut and animation readers levels Proven · STUNTBOOST
game rules node names that carry gameplay, baked lighting, outlines node names, baked lighting, outlines Observed · STUNTBOOST
derived data collision triangles, ledges and shortcuts, written by the content pipeline collision Proven · STUNTBOOST
custom content player-made maps loaded from the save folder custom maps Sourced · StuntboostTools

The collision files, node names and ledges of STUNTBOOST’s 159 level parts were checked against the game’s own code: a harness runs the game’s parsers (SE.Pipeline.ParsedName, SE.CollisionModel.Load) over every part and compares what they return with what an independent reading of the files gives. All 23,799 node names, all 3,022,926 collision triangles and all 293,944 ledges agree. Proven · STUNTBOOST Every XNB file of the install parses by the container rules, and every effect parses to its last byte. Proven · STUNTBOOST

  • A reader needs the game’s own readers to be named: the container only hands over bytes (GLTFReader and QoiReader are not MonoGame types). Proven · STUNTBOOST
  • The MGFX version differs between forks: upstream releases write 10 and 11; STUNTBOOST’s fork writes 12. Observed · STUNTBOOST
  • Texture sampling is nearest in the levels; a consumer that filters linearly changes the look. Observed · STUNTBOOST
  • The collision file stores grippable-edge bits only for solid triangles; the game’s loader reports zeros for triggers. Proven · STUNTBOOST

Pages

Archives and files

  • XNB containers — The XNA 4.0 content file as XNA and MonoGame games ship it: the header, LZX compression, the type-reader table, the primary object, the built-in readers, and the readers STUNTBOOST adds.

World and streaming

  • STUNTBOOST levels — How STUNTBOOST stores a level: glTF parts wrapped in XNB, their buffers and derived files, the level, room and skybox parts, the sidecar, units, and what the 56 levels hold.

Materials

  • Level materials and transparency — The materials of STUNTBOOST's level glTFs: bake materials, physics materials, prop materials, and the rules for transparent nodes (the Transparent(a) call and its alpha).

Shaders

  • MGFX compiled effects — MonoGame's compiled effect format, version 12 with the OpenGL profile: header, constant buffers, GLSL shaders written by MojoShader, parameters and techniques, and STUNTBOOST's 18 effects.

Textures

  • Textures in XNB files — The two texture encodings in STUNTBOOST's content: XNA's raw Texture2D and the QOI images of the BytingPipeline reader, and the sampler settings its levels use.

Lighting and sky

  • Baked lighting and the level shader — How STUNTBOOST lights a level: lighting baked into atlases, the unlit baked branch of Render.fx, the direct-light mask that gates dynamic shadows, cascaded sun shadows, gamma and fog.

Effects and decals

  • Ink outlines — How STUNTBOOST draws the dark outline around level geometry: an inverted-hull redraw with distance-dependent thickness, the per-vertex shift attribute and the outline colour.

Collision and physics

  • Collision models, ledges and physics materials — STUNTBOOST's derived collision file: solid and trigger triangles, grippable-edge bits, ramps, the grind ledge graph, and the C_ physics materials that decide how a surface behaves.

Gameplay data

  • Node names and gameplay objects — The grammar of STUNTBOOST's glTF node names: visibility and collision characters, code calls that make gameplay objects, the classes the levels use, and how the game draws a node by its name.

Mod loading

  • Custom maps — How STUNTBOOST loads player-made levels: the custom_maps folder, the files a map consists of, the metadata JSON, what the game compiles itself, and the Blender exporter that makes them.

Sources

  • MonoGame — the framework, content pipeline and the XNB and MGFX formats
  • FNA — reads the same XNA 4.0 content files
  • StuntboostTools — the Blender exporter and documentation for STUNTBOOST's levels