World File Format

From Rain World Modding
Jump to navigation Jump to search

Cleanup needed
This article needs structural or tonal clean-up to meet quality standards. Feel free to help improve it.

regionFormat
regionFormat

This page describes worldfile format for RW regions.

The world_XX.txt file is present in every region Rain World loads, and determines various room settings such as their pipe connections, the spawns of enemies, and specific flags like shelters and gates.

NOTE: Creature spawns for the region are generated when you first enter it on a save. Changing room connections or creature spawns in WORLD_XX after that corrupts save data. Reset your saveslot or revert your save to before you entered to avoid bugs.

Comments

Worldfile format supports comments: if a line starts with double slash (//), it is ignored entirely.

Format

Worldfile contains 2 to 4 sections, each with a different purpose. The start and end of each section is defined by a line containing only SECTIONNAME and END SECTIONNAME

The 4 sections are: CONDITIONAL LINKS, ROOMS, CREATURES, and BAT MIGRATION BLOCKAGES.

ROOMS and CREATURES are required, the others are optional.


A full world file with no contents will look like this:

CONDITIONAL LINKS
//conditional links go here
END CONDITIONAL LINKS

ROOMS
//rooms go here
END ROOMS

CREATURES
//creatures go here
END CREATURES

BAT MIGRATION BLOCKAGES
//migration blockages go here
END BAT MIGRATION BLOCKAGES

Room Connections

Room connections section is bounded by ROOMS and END ROOMS tags. These control which pipe entrance leads to what room, and vice versa. Unique room flags that specify certain attributes about the room (such as if it is a shelter or a gate room) are set here as well. The format is as follows:

ROOM : door0, door1, door2, etc : FLAG

Examples

A standard room with two room-connecting pipes. These will form the bulk of your region.

TR_T07 : TR_T01, TR_P02

A standard room, with five doors. However, pipes 1, 2 and 3 have no connection. Each pipe inside a room has a specific number starting from 0. These can be viewed using the Dev Tools' map tab, or by entering the room with dev tools enabled and pressing M.

TR_W19 : TR_L05, DISCONNECTED, DISCONNECTED, DISCONNECTED, TR_W18

A shelter. These rooms will often be copied from other regions when you are first learning how to make a region. All vanilla save rooms have a single door.

TR_S01 : TR_P01 : SHELTER

A region gate. Doors on the other side of the gate are set to DISCONNECTED. They will automatically be shown as connected doors at runtime. If you need to show a save room door specifically on the other side of the gate, you can use the ExitSymbolShelter object, in the dev tool’s object tab to change the door symbols as required.

GATE_SS_TR : DISCONNECTED, TR_L07 : GATE

A swarm room allows batflies to spawn in the room, as long as the map contains bat nests. If the room has bat nests but is not marked as a swarm room, those nests will always be inactive. The dev tools map tab provides the options needed to control where they will migrate and rooms they will avoid.

SU_A06 : SU_A39, SU_A36, SU_A38 : SWARMROOM

A scavenger outpost. Use in conjunction with ScavengerOutpost placedObject to create a scavenger toll.

SU_C02 : SU_A45, SU_A07 : SCAVOUTPOST

Understanding door connections

regionFormatConnection
regionFormatConnection

For a door to be properly connected, both ends must point to each other using valid doors. For this example, both rooms will have two doors. Door0 will be on the left, and door1 on the right. Door indices are decided specifically for your room, so be sure to check in game how your doors have been assigned by the Level Editor. The DT Map tab can also be used to see the links between doors. As in the picture to the right. Properly connected doors will show both lines pointing to the set door on the other end. Doors with incorrect links will point off to the bottom right and a door connected to another room, but that room has no door back (or lacks enough doors!) will point to the center of the room on the map tab page.

RG_ROOM1 : DISCONNECTED, RG_ROOM2
RG_ROOM2: RG_ROOM1

Room1 will have its right hand door connected to Room2. Because of this, we need to use DISCONNECTED as a placeholder for its left hand door, door0. Then set door1 to connect to Room2

Room2 will connect to Room1 using door0. Due to this, we do not need to define the right hand door. It will assume it to be disconnected.

Room Tags

Room tags assign certain properties to rooms depending on what the tag is. Tags are assigned like

[ROOM] : [CONNECTIONS] : [TAG]

Example:

SU_A06 : SU_A39, SU_A36, SU_A38 : SWARMROOM
Tag Function
SHELTER Makes the room a shelter. When there are multiple pipes in the room: the animated door is placed at the bottom right most pipe.
ANCIENTSHELTER Makes the room an Outer Expanse style shelter.
GATE Makes the room a gate. Entrances on the other side of the gate are set to DISCONNECTED, and are shown automatically to be connected.
SWARMROOM Allows batflies to be spawned from batfly hives.
PERF_HEAVY Causes the room to be abstractized quicker when player is not inside, can reduce offscreen performance toll of very large rooms.
SCAVOUTPOST Makes the room into a scavenger outpost. Scavs will spawn here and only let you pass if you have a pearl. The exact outpost location is set by the “ScavengerOutpost” devtools object.
SCAVTRADER Spawns a scavenger merchant into the room. Will trade items with you. The merchant is controlled by the “TradeOutpost” devtools object.
NOTRACKERS Disallows key items from saving in the room (for when the 'Key item tracking' Remix setting is turned on)
ARENA Causes creature spawns in the room to stay in their den until activated by an HRGuard (requires MSC!)

Important quirks to rooms and doors

When setting up your region, be sure that you always use your region’s prefix to help each room have a unique name. If not, Rain World will treat repeated names as being other rooms, and even re-use rooms from other region folders entirely. If you don’t use your region prefix, changes made with devtools can also wind up getting saved to unexpected places. To avoid these problems, always prefix your room with its region code, and give them unique names.

Multiple pipes in a room may all go to the same room. However, these will all act like a single pipe, and you will not be able to set the specific destination pipes. There are no cases in vanilla Rain World where multiple pipes in the current room lead to the same next room. They will all lead to separate rooms. For example, if you had four pipes leading from one room to another. you would need to create a minimum of three unique rooms for each of the other pipes to act as an interconnection.

Creature Spawns

Creature spawn data section is bounded by CREATURES and END CREATURES tags. Rain World only creates creature spawns when you enter a region for the first time on a save. Every creature has an internal codename, and many of them have aliases which can be used interchangeably in the world file. The table below contains all aliases in the same box, with the real name being bolded. First in the box is the alias the vanilla game uses most often.

Lizards Insects Amphibians Flying Plants Other
Pink, PinkLizard Spider Salamander CicadaA PoleMimic, Mimic Scavenger
Green, GreenLizard SmallCentipede Leech CicadaB Tentacle, TentaclePlant, Tentacle Plant Lantern Mouse, LanternMouse, Mouse
Blue, BlueLizard Centipede, Centi, Cent SeaLeech, Sea Leech Vulture Worm, Garbage Worm, GarbageWorm
Yellow, YellowLizard Red Centipede, RedCentipede, RedCenti, Red Centi JetFish, Jet Fish KingVulture, King Vulture Miros, Miros Bird, MirosBird
White, WhiteLizard DropBug, Drop Bug, DropWig, Drop Wig Snail Needle, Needle Worm, BigNeedle, Big Needle, BigNeedleWorm Tube, TubeWorm, Tube Worm
Black, BlackLizard BigSpider, Big Spider Lev, Leviathan, BigEel, Big Eel SmallNeedleWorm, SmallNeedle, Small Needle Bro, BroLongLegs, Bro Long Legs, BrotherLongLegs
Cyan, CyanLizard SpitterSpider, Spitter Spider Centiwing Daddy, DaddyLongLegs, Daddy Long Legs
Red, RedLizard EggBug, Egg Bug Cicada* Deer
More Slugcats Creatures
Lizards Insects Amphibians Flying Other
Caramel, SpitLizard AquaCenti, Aqua Centi, AquaCentipede, Aqua Centipede, Aquapede JungleLeech MirosVulture, Miros Vulture Elite, ScavengerElite, Scavenger Elite, EliteScavenger, Elite Scavenger
Eel, EelLizard MotherSpider, Mother Spider TerrorLongLegs, Terror Long Legs, Terror, Mother, MotherLongLegs, Mother Long Legs
Strawberry, ZoopLizard FireBug, Fire Bug, HellBug, Hell Bug HunterDaddy, Hunter Daddy, Hunter
Train, TrainLizard Yeek Inspector

(*) Switches between CicadaA and CicadaB)


Creature spawns can be specific to a certain character. (White, Yellow) makes something appear for monk and survivor, (Red) only for hunter

(character filter)ROOM : PipeNumber-Creature-{optional flags}-Count


Additionally, an "X-" prefix can be added to slugcat-specific spawn filters to invert the filter. For example (X-White,Yellow)CC_A07 : 3-Mimic-{18} would make the spawner appear on any slugcats except for Survivor and Monk.

Creature Flags

Creature flags set certain properties of the creature. Any flag can be written to any creature, but it will be ignored if they are not one of the following matches:

Flag Description Example
PreCycle Creature wakes during precycles then go back to bed at normal start of cycle LM_D02 : 5-Jet Fish-{PreCycle}
Ignorecycle Creature wakes at normal start of cycle and doesn't return to their den at cycle end\night UW_J01 : 3-Yellow-{Ignorecycle}
Night Creature wakes at start of night UW_A02 : 2-SpitterSpider-{Night}
TentacleImmune Creature doesn't get grabbed by DLLs, protos, or wormgrass (unused in-game) RM_F02 : 6-Inspector-{TentacleImmune}
Lavasafe Creature can swim unharmed in lethal water (unused in-game) HR_R14 : 2-Salamander-{Lavasafe}-3
Voidsea Turns the creature gold and makes them Lavasafe.

Only works on the following creatures: RedLizard, RedCentipede, BigSpider, DaddyLongLegs, BrotherLongLegs, TerrorLongLegs, BigEel, CyanLizard

HR_A04 : 2-RedCentipede-{Voidsea}
Winter Changes the creature's visuals to be more wintery.

Only works on the following creatures: BigSpider, SpitterSpider, Yeek, any lizard

(Saint)VS_C04 : 4-Big Spider-3-{Winter}
AlternateForm changes creature's form, does something completely different for each creature.

SmallCentipede: turns them green DLL\BLL: turns them to a TLL Vulture\King: makes them albino

LC_longori : 4-Small Centipede-3-{AlternateForm}
Mean:<number> Changes the lizard's default like of player and makes it more resilient to change.

The new default will be -Mean2, and the absolute value of the number also determines how strictly it will be influenced towards the new default by multiplying the regional lizard reputation by (1 - Clamp10(|Mean|)) before adding the new default.

Only works on Lizards. <number> should be a value between -1.0 and 1.0. Positive numbers make it more aggressive, negative numbers make it less aggressive.

UW_A09 : 4-White-{Mean:0.7}
<number> Only usable for Pole Plants and Centipedes.

Pole Plant: Determines the length in tiles. <number> should be a non-negative integer Centipede: Determines the size. <number> should be a non-negative value between 0.1 and 1.0

HI_B15 : 3-Centipede-{0.5}

HI_A04 : 2-Mimic-{18}

Seed:<number> Creature will always use the specified seed GW_C02_PAST : 6-Scavenger-{Seed:2837}

Examples

A single green lizard, spawning from pipe 2, on all difficulties.

SU_A10 : 2-Green

A single red lizard, spawning from pipe 3, on Hunter only.

(Red)SU_A10 : 3-Red

A hoard of 5 yellow lizards spawning from pipe 1, on Monk only.

(Yellow)SU_A10 : 1-Yellow-5

A Daddy longlegs spawning from pipe 4, but only on easy and normal difficulties.

(White,Yellow)SU_A10 : 4-Daddy

A very angry white lizard that spawns from pipe 3, on all difficulties.

SU_A10 : 3-White-{Mean:0.9}

Some enemies require a unique room known as OFFSCREEN. These enemies use special doors that are automatically added to your level to move between rooms. These include vultures, scavengers, leviathans, and miros birds. This example spawns two off screen vultures.

OFFSCREEN : 0-Vulture-2

Important quirks

Enemies may be set to spawn from the same nest pipes. However, do not be surprised if they somehow kill each other offscreen very quickly if you do this. A daddy long legs may have no problems consuming an entire hoard of yellow lizards for example.

Enemies will often drag you back to their home nest pipes, but may also choose other pipes they like, even in different rooms.

During the end of a cycle, almost every enemy will rush to a nearby nest, if they spawned from it or not.

Many creatures that would not intuitively appear to nest in pipes, likely does so, you just never reach them before they spawn in game, or their pipes are well hidden. A direct example of this, is that wandering daddy longlegs spawn from pipes, and return to their pipes before the end of a cycle. This includes the daddies inside Five Pebbles, which makes the area significantly easier once the cycle timer has counted down entirely.

It is important to understand various enemy interactions to help you build a cohesive and believable ecosystem for an area. Sandbox mode can help you learn which creature is where on the food chain. As well as looking at the interactions of creatures in other regions.

Some creatures have very specific requirements for rooms they inhabit. A very game breaking example, is that big spiders and spitting spiders require the ability to reach every wall in a room in some fashion. By pole, or by invisible ceilings out of the camera. If they cannot, the game will lag very badly due to the spider’s failed pathfinding.

Some creatures have a heavier performance impact on the game then others. An example is that more then 4 daddy long legs on screen will often lead to lag. Unfortunate development gets around this problem by using the “stuckDaddy” object, as these daddies do not run wandering path finding checks.

All creature types can be configured using the dev tool’s map editor to prefer, avoid, stay or be forbidden inside certain rooms while wandering, using Attraction tool. These spawn entries are simply where they will be created from when the player first enters a region.

The Lineage System

Enemy nests may also be configured to use the lineage system. After being killed, this allows a creature to roll a dice at the end of a cycle, and in a certain percent, respawn as its next entry in the lineage. Due to the format however, you cannot decide how many enemies can spawn from the pipe. So a green lizard cannot turn into a hoard of 3 yellow lizards. Only a single yellow lizard. Enemy flags, and difficulty filters still work however. The format is as follows:

LINEAGE : ROOM : PIPE : STARTENEMY-PERCENT, NEXTENEMY-PERCENT, FINALENEMY-0

PERCENT is a value between 0 and 1, and is the percent chance that the enemy will move onto its next form. You may have as many forms as you need. However, it is important to ALWAYS mark the last enemy in the lineage with a 0 percent chance to move on. Rain World will crash the moment it attempts to move to the next enemy in a lineage from the last.

Examples

A green lizard that spawns from pipe 2, that turns into a blue, and then into a red. With a 5% chance each time.

LINEAGE : SU_B08 : 2 : Green-0.05, Blue-0.05, Red-0

A poleplant, with a specific height of 10 blocks, and spawning from pipe 3. That has a 10% chance to turn into a monster kelp

LINEAGE : SU_A02 : 3 : Mimic-{10}-0.1, TentaclePlant-0

A empty pipe 3, that has a 1% chance to turn into a monster kelp.

LINEAGE : SU_B02 : 3 : NONE-0.01, TentaclePlant-0

Lineage applies to offscreen creatures, as well as difficulties! This example from chimney canopy has a 20% chance to turn a vulture into a king vulture after being killed, but only on normal difficulty.

(White)LINEAGE : OFFSCREEN : 0 : Vulture-0.2, KingVulture-0

Bat Migration Blockages

Bat migration blockages section is bounded by BAT MIGRATION BLOCKAGES and END BAT MIGRATION BLOCKAGES tags. These are used specifically to prevent bat flies from entering a room, or pathing through the region to rooms on the other side of it. These are rarely used. However the room directly after the tutorial area in outskirts is set to be one. The format is simply to list each room line by line between the two tags. There are no unique flags.

For the example in Outskirts, bat flies cannot enter room SU_A22 because it is between the tags:

BAT MIGRATION BLOCKAGES

SU_A22

END BAT MIGRATION BLOCKAGES