Skip to content

Spawns Basics

1234567890num edited this page Mar 13, 2021 · 4 revisions

World, Room, and Spawn IDs.

Basically, the game loads stuff like this:

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

Room ID depends World ID; rooms in different worlds can have the same room ID. The last 4 all depends on Room ID. The latter three IDs are collectively called Spawn ID.

World and Room IDs are pretty self-explanatory; they determine where you are. Door ID determines where your party spawns. Map ID determines 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 determines which Spawn ID do what. They determine what are spawned, where they're spawned, etc. This is what we change when we do boss/enemy rando. All spawnscripts for a room is loaded no matter the spawn ID, so we only need the room and world conditionals. It's very complicated, but stuff (potentially) important to us are as follows:

| 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 and a few Spawn ID are determined by the room transition script. However, most of the time the room transition script only determine the Door ID while the Spawn ID is determined the save file when you enter the room. The addresses for them can be found here.

The values there are updated when story flags are tripped. Failure to update these might result in repeated/broken cutscenes, enemies appearing where they're not supposed to, barriers blocking your destinations, etc.

Progress Flags

Progress flags are bitmasks that does various things. Their addresses and values can be seen here.

Most progress flags updated the spawn ID in the save file when tripped by the game. This means that if they are already tripped, those spawn ID won't be updated, which will break some stuff. These progression-based flag will also affect Jiminy's Journal. Non-progression-based flags can affect party members or GoA portal colors.

Some cutscenes won't work properly if the respective progression flags have been tripped. These flags are honestly very weird, so it's not recommended to mess with them too much.