V1.0.1 Handling Unbalanced Tile Distribution with New Parameters


This week, while working on a dungeon map, I noticed a problem:

If the sample map contains too many empty tiles, or certain decorative tiles are used very sparingly, the generated maps often end up with excessive empty space or completely omit those rare tiles.

It’s actually quite similar to an issue you might encounter in machine learning, but for MapToMAP, I decided to tackle it with two simple parameters:

1. **Tile Distribution Balance** – A value from 0 to 1 that linearly balances the probability of all tiles.

2. **Empty Tile Probability Adjustment** – A value from 0 to 1 that linearly reduces the probability of empty tiles (tile ID = 0).

While the first parameter can also reduce empty tiles when they’re overrepresented, sometimes I want fewer empty spaces *without* heavily impacting the probability distribution of other tiles. That’s why I added the second parameter for independent control.


Let’s see how these new parameters work.

For this test, I used a dungeon sample map with:

* Many empty spaces

* Floor and wall tiles in the same layer (with mostly identical floors and a few cracked ones)

* A decoration layer containing a few tables and barrels on the floor, plus flags and skulls on the walls


Old version generation results:


Because the sample had a large number of empty tiles, the generated map heavily favored empty space, while rare tiles like barrels and flags barely appeared.

With Tile Distribution Balance = 1:

(All eligible tiles are given equal probability.)


The result showed fewer empty tiles, and more barrels, flags, and cracked floors. Since all tiles had equal probability, rare tiles appeared far more often.

With Empty Tile Probability Adjustment = 0.01:

(All empty tiles have their probability greatly reduced.)


The result also had fewer empty tiles, but the cracked floors still appeared rarely, as their probability wasn’t boosted.

However, barrels and tables increased significantly — because the decoration layer only contains empty tiles and decoration tiles, reducing empty tiles automatically increases decoration frequency.


So, by experimenting with these two parameters, you can achieve the exact result you want.

Try more balanced setting

Empty Tile Probability Adjustment = 0.5  

Tile Distribution Balance = 0.1

Here’s the result for this dungeon sample map with those defaults — hopefully it helps you generate maps closer to your vision.


Other tweaks in this update:

* Changed the default value for *Tunnel Search Radius* from 16 to 6.

  This still fixes most broken connections while improving repair speed.


Upcoming feature preview — Smart Copy & Paste

This new tool will let you adjust the current map page in just three steps:

1. Select the tiles you want to copy

2. Select where you want to paste them

3. Hit confirm


The surrounding tiles will automatically adapt to fit the pasted tiles — no rules to define, the rules come from the current map itself.

The core logic is complete; only the UI remains. Stay tuned for its release!

Files

map_1_0_1.zip Play in browser
97 days ago

Leave a comment

Log in with itch.io to leave a comment.