Is there a way to auto-generate a map from a black & white image?

Is there a tool or something that can do this for RPG Maker VX Ace?

Games like Sim City, Sims, and other terrain-based games already have tools that can do this. We are talking both native and third-party tools.

Most tools like this work like this: They read the data from an image, black is usually either land or water and white is the opposite of what back is. Like if black represented land, white will represent water and vice versa. In some games, the grays in-between will represent elevation, but that will not apply for VX Ace because there is not really any elevation in RPG Maker VX Ace so it would read a B&W image. Grays could be applied for other tiles such as sand or mountain tiles in VX Ace but that is getting more complex. I just need land and water. Everything else I can do manually.

Is there anything that can do this but for RPG Maker VX Ace maps?

I want a map shaped like Argentina in the same WxH as this image and it would take way too long to do this by hand. I just need it for world map tileset. Perhaps there is a program or something that will take the black and make it green grass and the white, make it ocean.

Does such a thing exist for RPG Maker VX Ace? I can easily make a white version of this if the colors are reversed for land/water. I have this Argentina as a Photoshop shape so.
No, there is no such a tool, but you can make it like parallal background with "show in editor" option checked, and then you can trace the map with the tiles.
Moved to: RGSS3 Script Requests
What you want is to generate a map using a heightmap. This afaik needs to use a tool or script to be made.


I haven't done anything like this on rpg maker, but I've done something similar to unity, just throwing the idea out there, but how I would go about it is for the user to be able to define certain thresholds of greyscale for certain terrains (maybe by its position on the tileset?) and then have the script/tool iterate and read through each pixel of the image, take it's color value and assign the defined terrain from the tileset.


This will require the image to be the same size as the map, since each pixel will equal to 1 tile on the map, as well as set up the tileset accordingly.
I know I said I've already retired from RPG Maker, but...
Spoiler
1682814780862.png
Is there anything that can do this but for RPG Maker VX Ace maps?
As a matter of fact, yes

I just need land and water. Everything else I can do manually.
If you say so.

I want a map shaped like Argentina in the same WxH as this image and it would take way too long to do this by hand. I just need it for world map tileset. Perhaps there is a program or something that will take the black and make it green grass and the white, make it ocean.
There is one problem with this.
Your sample has anti-aliasing.
1682815242957.png

Pixels with different alpha value would be treated as different.
Fortunately, I managed to "smoothen" out and remove the anti-aliasing just by a few clicks in my software.
1682815332588.png


Now you might be wondering, where's the tool or script?
Here, put it in your script list:

How to use
First, you gotta make sure that the sample picture must have an equal size to the map.
Then, your sample picture must be located in Graphics/system.
Lastly, add <gen: SampleImageName>

The setup would be like this.
1682815540168.png


How the map is generated
After you put the correct setup. Put the player starting location in the intended map, run the game. After map is generated, close the game and close the editor. Do not save. Reload the editor.

Additional Information:
The setup goes like this
1682815591487.png


You can determine the two tile ID, based on this.
1682815737702.png

Started from top left, it is 0.
Add +1 if you go to the right.
Add +8 if you go to the bottom.

This only works for A1 and A2 autotile. Don't try with A3, A4 or A5 tiles. Something funny might happen. I haven't tried though, or maybe I just forgot.
I know I said I've already retired from RPG Maker, but...
Old habits die hard. 😴

Seems also easy enough, if anyone needs it, to add support to other gray scales adding the variables and corresponding checks when reading the image too.
Edit: This script DOES NOT work! NOTHING happens when I run the game! It literally does nothing
Where do I put the "<gen: SampleImageName>"

in a script auto-run event?
In the map properties of the map you want to generate it at, under the "Notes" square, refer to the image TheoAllen posted just after the "<gen: SampleImageName>" part for reference.
I tried that. STILL does absolutely nothing

So, all that I am going to get is some script that is either broken or a joke script? When I say it does not work, nobody replies and nobody attempts to fix it 🙁


It DOES NOT work regardless if I type it just <gen: Argentina> or <gen: Argentina.png>

This script literally does nothing.
So, all that I am going to get is some script that is either broken or a joke script? When I say it does not work, nobody replies and nobody attempts to fix it 🙁
If you accuse me of creating a joke script, then I'm out of here.
When you say "nobody replies", that was not even an hour before you replied.

So, unless you calmly explain how you did this, with the screenshot, and the step-by-step what you have done, I have nothing more to say.

You should go back to creating the map manually. No one actually need this.
Sorry, I am just very frustrated.

The Argentina.png is in graphics/system Argentina.png

I copied and pasted your script into my scripts list here: Below Materials and above Main like almost all scripts tell you to do.CaptureA.JPG

I then set the start point on the map I want
CaptureB.JPG
This is a duplicate of another map where I was using a long rectangle for Argentina.

I tried this two different ways
CaptureC.JPGCaptureD.JPG


I ran the game, went to "New Game", it loaded me onto the map but literally nothing happens on the map. No terrain is being generated, and I can move freely like nothing is happening. It does not matter if I sit for 10 seconds or five minutes.
The Argentina.png is in graphics/system Argentina.png
I see where the problem comes from.
The image you were putting here was a transparent png. Meanwhile, what you were using here is indeed Black and White.

So, to make this work, you need to change the setting to WaterColorCheck = Color.new(255,255,255,255)
1682832173348.png

Previously, I used your sample where the water part is a transparent pixel (0,0,0,0).

Also, you don't need to add .png on the note tag.
Its still not doing anything 🙁

It remains a long rectangle and nothing is happening
Have you close and reopen the editor?
You said to wait until the map is generated in the game first. But it is NOT doing that. Nothing is generating in the game
You said to wait until the map is generated in the game first. But it is NOT doing that. Nothing is generating in the game
When your game is loaded and you can see the map, the map is generated. Close the game, and the editor, then reopen the editor.

If you want to do some basic debugging, do something like this.
Because the field of view is limited to 17x13. Let's put the start of the player position at the top left.
1682833137815.png

And do this to your sample image.
1682833086912.png


Don't start with huge Argentina map. Start with "see if it actually works".
Run the game.
1682833219962.png
It works on the 17x13 with a few grass patches

so why won't it work on the 138x300?
so why won't it work on the 138x300?
As I've asked. Have you close and reopened the editor?
Closing and reopening the editor does NOT work for the 138x300

It worked for the 17x13 but it is not working for the 138x300

I even tried creating a brand new map with the dimensions of 138x300 and only having a single grass tile in the upper left corner. Nothing is generating and closing and reopening the editor still only has that single square grass tile in the upper left corner
Try more basic debugging.
If you believe 17x13 works but 138x300 does not, then, you can try something like increasing its size and where it stops working. Use different shapes, etc.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-auto-generate-a-map-from-a-black-white-image.157071/