Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: ImageToMap Tool  (Read 4939 times)

mellow

  • Escaped Lunatic
    • View Profile
ImageToMap Tool
« on: October 01, 2021, 08:36:40 am »

ImageToMap

Edit: I fixed a problem, I'm compiling with java 8 instead of 16 now, and it should work.

This is a tool that can take an image, and turn it into a dwarf fortress map for generating new worlds.

It can generate a map for elevation, temperature, drainage, volcanism, and savagery. It works by using a certain color to represent a high value, and colors far away from it will be a low value. You can set which color you want to use for each image, to make it easier to work with in image editing programs.

Screenshots:
Spoiler (click to show/hide)


Installation:

First, you need java installed. Then just download the .zip, extract the .jar to somewhere, and run it. It will create a settings file in its location, so you might want to put it in its own folder.

Download


Usage:

To use, you need to load your world_gen.txt file. Then select the parameter set from the list that you want to add the map to, or make a new one.
Then select the images that you want to use.
Then when you save it, it will save the map to the parameter set that you selected.

How the image and colors work:

It will read the image with a color close to the selected color as a high value, and a color far from it as a low value. So if the selected color for elevation is white, black will be the lowest possible elevation, white will be the highest, and grey would be in between.


Once saved, go in game and design a new world with advanced parameters, and use the region that you added the map to. You might get rejections, for example if the the map doesn't have enough room to place all of the civilizations, then you would have to reduce the number of civilizations by pressing e on the region and changing the settings. See here for dealing with rejections: https://dwarffortresswiki.org/index.php/DF2014:World_rejection

The "reduce rejections" setting in my program sets the following settings to 0:

Spoiler (click to show/hide)
« Last Edit: October 29, 2021, 06:23:10 am by mellow »
Logged

FantasticDorf

  • Bay Watcher
    • View Profile
Re: ImageToMap Tool
« Reply #1 on: October 07, 2021, 05:39:04 am »

Experienced a java error, pity, because it seemed interesting. I have the zip file onboard incase i need to do more Java specifications on my end to make it run.

PTW.
Logged

mellow

  • Escaped Lunatic
    • View Profile
Re: ImageToMap Tool
« Reply #2 on: October 07, 2021, 12:39:22 pm »

Experienced a java error, pity, because it seemed interesting. I have the zip file onboard incase i need to do more Java specifications on my end to make it run.

PTW.
I don't know much about this so idk if i'd be able to help get it working, but what was the error?
Logged

ArmokGoB

  • Bay Watcher
    • View Profile
Re: ImageToMap Tool
« Reply #3 on: October 28, 2021, 10:29:53 am »

Experienced a java error, pity, because it seemed interesting. I have the zip file onboard incase i need to do more Java specifications on my end to make it run.

PTW.
I also get "A JNI error has occurred, please check your installation."
Logged
Cyclopes, prepare to meet your demise at the metaphorical hands of my cushion ruby cabochons.

mellow

  • Escaped Lunatic
    • View Profile
Re: ImageToMap Tool
« Reply #4 on: October 29, 2021, 06:21:54 am »

Experienced a java error, pity, because it seemed interesting. I have the zip file onboard incase i need to do more Java specifications on my end to make it run.

PTW.
I also get "A JNI error has occurred, please check your installation."

I updated the file, I think it should work now. I was compiling with java 16, but most people only have java 8. (you're suppose to use something different than jars past 8) So I just compiled it with 8.
Logged

FantasticDorf

  • Bay Watcher
    • View Profile
Re: ImageToMap Tool
« Reply #5 on: October 29, 2021, 06:43:05 am »

Great thanks, it boots up now. Still getting the hang on findiing how to use it, since the maps i had in mind dont really have much color on them to draw upon, but i suppose i could super-impose over them in MSPaint or something until they're compatible. Or just free-draw a artistic interpretation.
Quote
Quick question, is there a minimum PNG requirement before i would need to resize or crop the image? (Just incase i accidentally pull out a 1000x1000+ map and only generate a small section of it to df map 125x125 scaling)

Continuing to PTW and report back if i encounter any problems.
Logged