Skip to content

Latest commit

 

History

History
85 lines (68 loc) · 3.43 KB

Home.md

File metadata and controls

85 lines (68 loc) · 3.43 KB

Welcome to the sourcehold-maps wiki!

Current progress

World

Units

  • Manipulate unit type
  • Manipulate unit location
  • Manipulate unit path
  • Manipulate unit checkpoints
  • Manipulate unit health
  • Manipulate unit owner
  • Manipulate unit task
  • Manipulate unit destination
  • Manipulate unit grouping
  • Manipulate items carried by worker

Buildings

  • Manipulate building type
  • Manipulate worker associated with building
  • Manipulate building sleep state (isn't set per building)
  • Manipulate building health/damage
  • Manipulate building on fire

Terrain

  • Manipulate terrain height
  • Manipulate terrain type
  • Manipulate terrain type pattern

General map info

  • Manipulate balanced/unbalanced
  • Manipulate advantage (deathmatch, ...)
  • Manipulate locked state (unlock maps for editor)

General game experience

Getting started with debugging

You are very much invited to file an issue or a pull request to the sourcehold-maps repository explaining what you found.

The general layout of a .map file (and .sav file)

A map file is a zip file with a header and data sections. The header consists of:

  • a preview of the world image
  • a custom description of the map
  • whether the map is considered balanced for all player positions
  • and much more (most of which is unknown)

The data sections are often compressed, and contain, for example:

  • tile data (terrain, terrain height, buildings)
  • unit data (unit locations, unit health)
  • current year
  • player data (resources in stock, etc.)

However, it is currently unclear what some sections represent.

Click on one of the sections in the overview to learn about each section.

Unpacking a map file

Due to compression, you should probably unzip a map file first. To "unzip" (and uncompress) a map file, you can use this online converter.

How to use the specs

We use kaitai to communicate the file format specification for two reasons:

  1. The specs can be used to automagically generate deserialization code in many languages.
  2. They have a nice Web IDE that is easy to use for inspection purposes.

Additionally, specs are sometimes communicated via a C struct like pseudo format.

To view a kaitai specification and its mapping to data, follow these steps:

  1. open the Kaitai Web IDE
  2. download the .ksy file for the section you want to learn about
  3. drag and drop the .ksy file in the IDE
  4. drag and drop a data file in the IDE
  5. inspect the data file

Debugging tips

  • Zero out (wipe) sections to see what disappears. Re-save the map file and see what data is reintroduced.
  • If loading your own modified map file crashed the game, the cause is probably a deserialization issue. In other words, all sections can be wiped to 0's and the game will still happily load the map (but it might be unusable).