BMP to WBS Converter

Rhye

's and Fall creator
Joined
May 23, 2001
Messages
9,895
Location
Japan / Italy / Germany
Here is the BMP to WBS Converter.
With this simple tool written in Python, you can make maps and scenarios just with some bitmaps and storing scenario data info the scenario file.

The zip contains the tutorial Mapmaking And Scenario Design.pdf, which contains installation instructions and that will explain step-by-step how to make a simple scenario, and the sample bitmaps and scenario files produced in the tutorial.

http://rhye.civfanatics.net/civ4/files/BMPC186_withTutorial.zip
(Tutorial updated to v1.1)


Authors: Jon Shafer, Rhye, Jesse Smith, Locutus




EDIT: here's an expanded version of the converter by Door. He added the possibility of putting improvements, routes and starting locations with the bitmaps:

(see attachment)


EDIT2:
Another modified version, with the same new features as the one above, but with many bugfixes and a reorganization of the code:

http://forums.civfanatics.com/showpost.php?p=4441600&postcount=117



.
 

Attachments

  • ModifiedBMPtoWBSConverter.zip
    65.9 KB · Views: 5,629
Brilliant! Thank you very much! I think this is exactly what I need to get off and running. :D
 
This looks really interesting and cool. But where can I get the pyPIL. The link that appears in the PDF file in the Zip doesn't work
 
I have made a number of maps with the original version of the utility I wrote before Rhye, Locutus and Jesse enhanced it (and gave it a pretty GUI ;)). They should be released before too long.

It's quite powerful for what started as one of my side projects and is very good at giving maps that look like real life if you put some time into it. Rhye's philosophy is somewhat different and prefers to mod things on a pixel-by-pixel basis as a WorldBuilder replacement.
 
Trip said:
It's quite powerful for what started as one of my side projects and is very good at giving maps that look like real life if you put some time into it. Rhye's philosophy is somewhat different and prefers to mod things on a pixel-by-pixel basis as a WorldBuilder replacement.

You should be able to do both ways.
In fact I written in the tutorial that one can just use the first 3 bitmaps and continue working in the world builder, or go to phase 2 and place resources and rivers by pixel.
 
Not sure if this is the right thread for this problem. Well however ...
BMP to WBS PDF-file said:
To run the application, you just have to double click on the .py file corresponding to your scenario, and it will automatically launch the actual converter.


...

When you launch EmptyScenario.py, two windows open:
No, thats not true for me. When I double click on the .py file, then there will open small black window for half a second or such but it is closed and nothing happens. Whats wrong?
 
No, I only wanted to edit something, but I didn't for now. I just double click on the EmptyScenario.py. And nothing happens.

[edit: Now I know, whats going wrong: Additionaly to python and pyPIL, we need wxPython. Additional 17 MB...]
 
I have the same problem as Arne. Do you need Civ 4 installed for it to work?

EDIT: Ah nevermind. I installed wxPython as Arne suggested and it works now. Get it from here http://prdownloads.sourceforge.net/wxpython/wxPython2.6-win32-ansi-2.6.1.0-py24.exe

Also what freeware program would you recommend for colouring the BMPs (since MSPaint isn't a great option)?

I know of GIMP but I really didn't like the look of that one.
 
Thought I'd take a look at this and see. I did notice, though, that Python and PyPIL have been upgraded a version number from what's said in the PDF. Will updating to the modern versions effect it at all? (I remember a while back I was trying to get something Python to work and it ended up needing an older version.)
 
I'm having a bit of trouble, I've followed you're little example exactly and everything came out fine, right down to the river placement. I spent quite a while on this. :king:

but my problem is... I can't make any new maps at all. strangely enough I can only make the default one and the empty one. I've got the exact color codes for all colors too.

the closest I've come is to getting in game but being defeated instantly and the whole map was just mountains.

any thoughts as to what's going wrong?
 
the whole map was just mountains

Same thing that happened to me... And also my map didn´t go round, earth like, in the world view...
 
Strange I've successfully created a map just fine following these instructions.

Though it did have a few anomalous mountains here and there...
 
I haven't recieved Civ IV yet, but thanks to your wonderful utility I've started making maps. It's great. Thanks.

I have a couple of questions about the nature of the files the program creates... I know that python can be used to create map scripts. Several custom map scripts are included with the game... my first question is, is the .py file created by your utility a map script? Rather than creating a WB Save file, can I treat the .py file as a custom map script.

The reason I ask this, is that I want to create a scenario map with some random characteristics... I believe the WB Save file is fixed once it is created, so random generation of resources or starting locations, etc. is not possibile. I'm guessing this has to be done when the save file is generated. Map scripts allow this randomness... that's why I'm asking whether the generated py file is a script.

What I really want to do in my scenario is pre-place certain "cultural" resources, but otherwise randomize resource placement. Your program allows me to input coordinates to place resources... however, I'd like to introduce some of the random placement algorithms that I suppose the map scripts have... is this at all possible? If it is, I hope a simple cut and paste into the .py file would do it... again, this all depends if your program generates a map script.

I'm not a programmer, and my skills are limited in this area. Are the above suppositions about the files correct? Or should I just give up these ideas now...

and this is likely asking too much... but if its a really simple matter of cut and paste, could you add a randomresourse.py to your download... that is if my ideas are not out to lunch and you think it might be a useful addition to the utility.:blush:

Thank you for the utility, once again.
 
Craig_Sutter said:
map with some random characteristics... I believe the WB Save file is fixed once it is created, so random generation of resources or starting locations, etc. is not possibile. I'm guessing this has to be done when the save file is generated. Map scripts allow this randomness... that's why I'm asking whether the generated py file is a script.

What I really want to do in my scenario is pre-place certain "cultural" resources, but otherwise randomize resource placement. Your program allows me to input coordinates to place resources... however, I'd like to introduce some of the random placement algorithms that I suppose the map scripts have... is this at all possible? If it is, I hope a simple cut and paste into the .py file would do it... again, this all depends if your program generates a map script.

i think you'd have to edit the converter itself.
it's open source, after all...
 
You could try leaving the resource info when using the converter blank. Then when you load the map in civ4 use the world builder to manually place all of the resources.

By the way, I'm still having trouble creating a custom map, any thoughts or tips from anyone would greatly be appreciated. The game either quites outright, or loads a map with nothing but mountains.
 
Make sure you the only colours you have in the bitmaps are the ones from the manual. And I would suggest you resize your BMPs so that one pixel in BMP = one tile in WBS. This has worked for me a few times now.

So resize your BMPs to 128 x 80 (or whatever size you want), colour it the way you want (you'll need to zoom i real close and colour the pixels seperately where necessary).

Then when you set the BMP Converter Options in the app that you input the same numbers for the X and Y fields as the pixels in the BMP.

Hope that helps.
 
Yeah, that's actually what I've been doing from the start.

odd though, I guess I'll just have to keep trying.

Maybe I'll reinstall all the python stuff before I give it another shot.
 
Top Bottom