Skip to content

Spawns Basics

1234567890num edited this page Aug 6, 2021 · 4 revisions

World, Room, and Spawn IDs.

Basically, the game loads stuff like this:

  • World
    • Room
      • Door
      • Map
      • Battle
      • Event

While there are unique World IDs, Room IDs are shared between worlds. A room in one world can have the same Room ID as a room in another world. The Door, Map, Battle, and Event ID's all depend on the Room ID. The latter three IDs are collectively called Spawn ID.

World and Room IDs together determine the currently loaded room. Door ID determines where your party spawns. Map ID controls objects and room transitions (like Central Station's trains). Battle ID determines enemies and partners. Event ID determines NPC and cutscenes.

Spawnscripts

Spawnscripts are what determine which Spawn ID does what. They control what are spawned, where they're spawned, etc. Changing spawnscripts allows for enemy replacement which is used currently for boss/enemy rando. All spawnscripts for a room are loaded no matter the spawn ID, so we only need the room and world conditionals. It's very complicated, but these are some potentially valuable offsets for us:

Offset Type Content
0 Int UCM
4 Float Position X
8 Float Position Y
C Float Position Z
10 Float Rotation X
14 Float Rotation Y
18 Float Rotation Z
20 Int Sub-UCM 1
24 Int Sub-UCM 2
28 Int Talk/Examine Text
2C Int Reaction Command

The spawnscripts are part of ARD files, which also affect event-specific battle level, BGM, party, etc. Further reading can be found here. They are loaded dynamically, but they're usually within 1CXXXXX address.

Spawn ID

The Door ID will always be set by the room transition script while the Spawn ID is usually checked from the save file upon entering the room. The addresses for them can be found here. There are however some cases where the spawn ID is also controlled by the room transition script. In this case, all 3 spawn IDs will have the same value and it will usually be at least 0x33.

The Spawn ID values in the save file are updated when story flags are set. Failure to update these might result in repeated/broken cutscenes, enemies appearing where they're not supposed to, barriers blocking your destinations, or other miscellaneous issues.

Progress Flags

Progress flags are bitmasks that control different aspects of the game. Their addresses and values can be seen here. They have internal codes, which is what they're referred as by the game (in ARD, for example).

Progress Flags are directly connected to spawn IDs and are attached to the save data of the game. Spawn IDs are updated at the same time that a progress flag is set. If a progress flag is already set, the game believes the event already occurred, so the spawn ID will never update even if manually edited. These progression-based flags will also affect Jiminy's Journal. Non-progression-based flags can affect party members or GoA portal colors.

What exactly these flags do are determined in 00progress.bin, but documentation for that doesn't exist yet. These flags are honestly very weird, so it's not recommended to mess with them too much.