Persisting your World, a.k.a. use the seedable RNG

First of all, this plugin will never save/load generated maps. To be fair, there’s a tiny exception: When the player saves their game, the current map persists in the save file to load later. Besides that, the plugin does not save any generated map. But that doesn’t mean we could not implement that in our games.

The solution is Seeds. Passing the same seed value to the generator will output the same map.

Passing Seed Variables

Seeds are passed as Variables. If you want to use a fixed value as a seed, simply put that value into a Variable.

This plugin lets you pass multiple values. In that case, all variables must have the same value again to generate the same map. This plugin also uses this information to track Self-Switches.

MV

Use the „seedVariableIds“ parameter. You can pass a single or multiple Variable IDs.

RandomMaps.generate({
  mapId: 1,
  useSnippets: true,
  templateName: 'Imperfect Maze',
  seedVariableIds: [1, 2, 3],
  roomLayout: '5 floor Tower',
  exits: ['top', 'bottom'],
  enterFrom: 'bottom',
});

MZ

Use „Seed Variables“. You can leave it empty (no seed) or pass a single or multiple Variables to it.

Example 1: Magic Tower

In this example, we have a Magic Tower. The player can escape and re-visit it, e.g., to gather supplies from the home base. The tower should stay the same; only once it is completed will it change for the next run.

Let’s create a new Variable, „Seed,“ and use RPG Maker’s random function to set it.

Your tower stays the same as long as you don’t change this Variable. So it’s up to you when you modify this Variable.

Example 2: World Map

Let’s check out scenarios where one uses multiple variables!

In this example, we have a world map (which, by the way, could be generated as well) with multiple villages to visit. Each village should look unique, but of course, it should stay the same when revisited.

A simple way to do so is to pull the event’s position on the world map and use the X and Y values as seeds. This way, all villages automatically get their individual values.

You can pass even more variables, e.g., the variable that was used to generate the world map.

My Village has 2 Transfer Events?

Your village has 2 Events to transfer the player? No problem, all you need to do is to adjust the X (or Y) variable so both of your events will eventually provide the same values again.