Random Maps: Jump to Version 3.0 Upgrade Guide!
First of all, there’s no dedicated algorithm yet to create a village, but that doesn’t mean we cannot make one!
Why is there still no algorithm for that? Because, other than creating a cave that is natural and hence random, a village is hand-made and follows a lot of rules. They have a more or less structural layout when it comes to roads and places where its residents build their houses. And while we already made some rules for the caves, e.g., plants are more likely to appear on grass floors, a village has ore! People have a lot of equipment and tools for daily work, spaces to stow away their goods in boxes and barrels, and even more. People usually put things next to their houses and not randomly on the streets. All in all, making such an algorithm is much more complicated than making an algorithm to create natural things like caves or world maps.
So, what will we build now? We build a village that works as a player’s hub that provides the player standard shops such as the item shop, the weapon smith, the spell shop, an inn, etc. Especially when you want multiple villages in your game, the player will probably forgive the generated maps because it’s „better than no variation at all.“
Space Map
We use „Static Map,“ i.e., we draw the base ourselves.
Hmm, that map looks boring. Do we want to add some high grasses? No, we don’t. We will do that later.
Spawn Location
You need at least one location where the player should spawn.
You may make up to 4 locations – one for each direction. Use those Region IDs for each direction:
Direction | Region ID |
---|---|
North | 14 |
West | 9 |
East | 16 |
South | 6 |
Houses
Create a new Map that is a Child Map of your Space Map, and call it „Assets.“
Go here to learn how the Asset Map works: Post Processing
In the example above, I grouped my houses this way:
- some houses for the residents
- and some churches (the plugin will randomly pick one; therefore, you can draw more, or having only one is also fine)
- and a wooden house (storage? I don’t know)
How many houses? The number of visible houses on this Map does not affect how many houses appear later in the game. We define these numbers in the Plugin Manager later. That means you can have more or fewer houses for each row to have more or less variety. The Plugin will randomly pick every time.
How many groups? It’s up to you what houses you want and how you want to group them. In the Plugin Manager, you will define how many houses will appear for each row. Do you want to 2 churches because you have 2 religions in your game? Do you want a smith, an inn, a spell shop, an item shop, and no houses for residents, just like in any typical JRPG out there? Go for it!
We will look at the Plugin Manager later.
Details
Grass
If you want the Plugin to automatically draw some grass, create a Map, call it „Grass,“ and put it below your Space Map. Draw something like this:
Details
Create a Map, call it „Details,“ and draw something like this:
Click here to learn how this Map works: Post Processing
Plugin Manager
Let’s go into the Plugin Manager.
I added a Template to generate a village for you to kick off with a simple setup. You may want to check it out and adjust it to your needs. If this article is online before the patch that adds my Template, you may not see my Template. No problem, just create a new one!
Parameter | Description |
---|---|
Name | Village |
Base Algorithm | staticMap |
Structures, Details, … | see next chapter |
Shadows? | As you wish |
Houses
Click on „Structures, Details, …“. Here, you will see a list of every task that the Plugin will do for you. A task could be to make houses, add details such as grass, or something different.
The Plugin runs tasks from top to bottom, so the order is relevant.
We make the houses first.
Feel free to double-click any item to edit or to add or remove lines.
- Give it any name
- Select „Asset (x times)“
- Click on „when: Asset (x times)“
Here, you define the Region ID that you used on the Asset Map and how many houses of this category you want to appear in the game.
- Set the Region ID you used for this category
- Pick any „type“, the plugin does not consider this value when making a village
- Select how many houses of this category you want to appear
- Keep the other settings on default