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.
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 for each row will appear in the game. 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.
Inn, Weapon Smith, Shop, etc.
I use some tricks to put signs on any of the residents‘ houses. We look at it in the „Assets“ section below.
Therefore, any resident’s house is converted into a shop, weapon smith’s house, inn, etc. You may prefer it this way, or you can, alternatively, draw your own houses for the shops.
Details
Signs (Inn, Shops, etc.)
So, if you have decided to make custom houses for your shops as described above, you can easily put the signs directly on your houses and skip this chapter. If you want to learn my trick, stay here.
Scroll down on your Asset Map and just add new elements like this:
According to the rules of how Asset Maps work, everything that looks exactly like the tiles on the left is replaced by the tiles on the right (of the blank section) x-times, whereas we will define x as 1 in the Plugin Manager. Well, nothing stops you from having 2 or more item shops, but let’s keep it simple.
You may want to have more or fewer rows, one row for each of your shops.
We will go to the Plugin Manager later.
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 see a list of every task that the Plugin will do for you. A task could be to draw houses, draw details such as signs, grass, or something different.
The Plugin runs tasks from top to bottom, so the order is relevant.
We draw 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
- Right now, you may pick any „type“
- Select how many houses of this category you want to appear
- Keep the other settings on default
Signs
If you have decided to use my trick, you must repeat the last step to draw signs on the houses.
Details
You want to add a new line to draw all the details.