1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

BMP to WBS Converter

Discussion in 'Civ4 - Utility Programs' started by Rhye, Oct 31, 2005.

  1. Rhye

    Rhye 's and Fall creator

    Joined:
    May 23, 2001
    Messages:
    9,468
    Location:
    Japan / South America
    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



    .
     

    Attached Files:

  2. Feet

    Feet Chieftain

    Joined:
    Oct 25, 2005
    Messages:
    143
    Location:
    Southend, UK
    Brilliant! Thank you very much! I think this is exactly what I need to get off and running. :D
     
  3. Corvuz

    Corvuz Chieftain

    Joined:
    Oct 27, 2005
    Messages:
    6
    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
     
  4. Rhye

    Rhye 's and Fall creator

    Joined:
    May 23, 2001
    Messages:
    9,468
    Location:
    Japan / South America
  5. Corvuz

    Corvuz Chieftain

    Joined:
    Oct 27, 2005
    Messages:
    6
    Thanks a lot. Just what I needed. :)
     
  6. Jon Shafer

    Jon Shafer Civilization 5 Designer

    Joined:
    Jul 14, 2002
    Messages:
    2,102
    Location:
    Maryland
    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.
     
  7. Rhye

    Rhye 's and Fall creator

    Joined:
    May 23, 2001
    Messages:
    9,468
    Location:
    Japan / South America
    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.
     
  8. Arne

    Arne Chieftain

    Joined:
    Apr 24, 2001
    Messages:
    890
    Location:
    Rostock (GER)
    Not sure if this is the right thread for this problem. Well however ...
    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?
     
  9. Rhye

    Rhye 's and Fall creator

    Joined:
    May 23, 2001
    Messages:
    9,468
    Location:
    Japan / South America
    you edited it right? It probably contains an error somewhere.
     
  10. Arne

    Arne Chieftain

    Joined:
    Apr 24, 2001
    Messages:
    890
    Location:
    Rostock (GER)
    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...]
     
  11. Feet

    Feet Chieftain

    Joined:
    Oct 25, 2005
    Messages:
    143
    Location:
    Southend, UK
    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.
     
  12. Fobok

    Fobok Chieftain

    Joined:
    Oct 15, 2005
    Messages:
    80
    Location:
    Ontario, Canada
    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.)
     
  13. King Jason

    King Jason Fleece-bearer

    Joined:
    Oct 21, 2005
    Messages:
    2,008
    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?
     
  14. Elhoim

    Elhoim Iron Tower Studio Dev

    Joined:
    Nov 3, 2004
    Messages:
    1,691
    Gender:
    Male
    Location:
    San Isidro, Argentina.
    Same thing that happened to me... And also my map didn´t go round, earth like, in the world view...
     
  15. Feet

    Feet Chieftain

    Joined:
    Oct 25, 2005
    Messages:
    143
    Location:
    Southend, UK
    Strange I've successfully created a map just fine following these instructions.

    Though it did have a few anomalous mountains here and there...
     
  16. Craig_Sutter

    Craig_Sutter Chieftain

    Joined:
    Aug 13, 2002
    Messages:
    2,526
    Gender:
    Male
    Location:
    Seoul, South Korea
    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.
     
  17. Rhye

    Rhye 's and Fall creator

    Joined:
    May 23, 2001
    Messages:
    9,468
    Location:
    Japan / South America
    i think you'd have to edit the converter itself.
    it's open source, after all...
     
  18. King Jason

    King Jason Fleece-bearer

    Joined:
    Oct 21, 2005
    Messages:
    2,008
    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.
     
  19. Feet

    Feet Chieftain

    Joined:
    Oct 25, 2005
    Messages:
    143
    Location:
    Southend, UK
    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.
     
  20. King Jason

    King Jason Fleece-bearer

    Joined:
    Oct 21, 2005
    Messages:
    2,008
    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.
     

Share This Page