24,539 ARTICLES
ON THIS WIKI

Twilight Forest Landmarks/Generation


The pseudocode on this page is pseudocode which has been derived from looking at TFFeature.class found within the Twilight Forest mod's ZIP archive as of Twilight Forest version 1.15.4. This explains in slightly technical terms how major landmarks are generated within the game code and what the odds are of getting one landmark as opposed to another.

Click Show to show pseudocode.

place a major landmark at coordinates which are both divisible by 256

import all major landmarks; add parameters for whether "decorations" are enabled or whether generation is disabled to each landmark

import different variables for each landmark (monster spawn lists, size, name, and so forth) and set landmark values

-> based on the landmark names, assign values to variables previously imported

-> based on parameters for "decorations" and generation of the landmark previously set, add "decorations" or disable generation of landmark

--> determine landmark's location in the world, and based on it, determine landmark type

---> if the landmark's spawning location is in a Glacier biome, the landmark must be a Glacier Maze*

---> if the landmark's spawning location is in a Lake biome, the landmark must be a Quest Island**

---> if the landmark's spawning location is in an Enchanted Forest biome, the landmark must be a Quest Grove

---> if the landmark's spawning location is in a Fire Swamp, the landmark must be a Hydra Lair

---> if the landmark's spawning location is in a Clearing or a Clearing Border, the landmark must be a Labyrinth

---> if the landmark's spawning location is in a Dark Forest, there is a 1/3 chance for the landmark to be a Dark Tower; if it is not a Dark Tower, then continue to next line

--> for all other biomes and if the Dark Forest did not spawn a Dark Tower:

---> 6/16 (3/8) chance of a Small Hollow Hill

---> 3/16 chance of a Medium Hollow Hill

---> 2/16 (1/8) chance of a Hedge Maze

---> 2/16 chance of a Lich Tower

---> 1/16 chance of a Large Hollow Hill

---> 1/16 chance of either a Hydra Lair if the landmark is in a Swamp biome, and otherwise, default to a Naga Courtyard

-> add landmark-specific monsters to respective landmarks based on landmark name

*The generation of the Glacier Maze is currently disabled in the mod's code. As such, Glacier Mazes do not generate, and Glacier biomes never contain Major Landmarks.

**Similarly, Quest Island generation is disabled in the mod's code.