1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Civ4 Map Maker

Discussion in 'Civ4 - Utility Programs' started by sarysa, Apr 13, 2008.

  1. sarysa

    sarysa Chieftain

    Joined:
    Apr 13, 2008
    Messages:
    13
    Location:
    Silicon Valley
    Version 0.0.3-0420 is out! - 2008-04-20 hotfix

    Civ4 Map Maker is an open source project. The first release was this morning at 1am pacific. The UI is still a bit primitive and geeky, but it's pretty feature packed in its early incarnation.

    Project URL: http://www.sourceforge.net/projects/civ4mm (should always work)
    CivFanatics URL: http://forums.civfanatics.com/./downloads.php?do=file&id=9239 (works only after mod approval)
    Current version: 0.0.3-0420
    Requires: JRE (Java) 5 or higher. Available at http://java.sun.com

    The purpose of the project was to make map editing way easier than it already is, and to correct the many shortcomings of WorldBuilder. The code is based on previous map editors I made for 2d games I'm working on.

    VERSION 0.0.3-0420 HOTFIX NOTES:
    - Bugfixes: Importing/exporting Warlords and BTS saves, Auto-resource placement on impassable/unimprovable tiles, import not importing world size (would always be DUEL)
    - Another hotfix to make coastlines less confusing to look at. Definite "DUH" moment for me, what was I thinking?!
    - Added special functions to strip rivers/resources/routes/coasts, since I'd already made this anyway.
    - Auto-resource will give the option to place 3 tribal villages per civ on the map at 100%. Future versions will support manual placement of tribal villages.

    VERSION 0.0.3 NOTES:
    - Fixed a bug where sheep and wheat were getting switched on export.
    - Map editor now allows rivers and roads to be on the same square. (internally, rivers are
    handled bitwise now)
    - Implemented importing of maps. This can be pretty slow with larger maps, keep in mind.
    - Moved selection tool to where the other tools are. The selection tool being where it was
    was legacy code from my other map makers that were much simpler in that respect.
    - Cut/copy/paste interface looks much nicer. If a region is copied (not cut) the copied region
    will be highlighted red. The place where a region will be pasted is highlighted yellow.
    - Created an undo/redo feature. Undo goes back as far as 100 changes to the map, currently.
    - Created a new map feature, since it's annoying to have to close and open the map editor
    to make a new map.
    - Greatly improved auto-rivers.
    - Allows more auto-resources to go onto more diverse tiles.
    - Fixed severely faulty math with the random resource generation.
    - Implemented custom map sizes. The old map size (which is actually a variable in the
    Civ4WorldBuilderSave file) now determines for how many civs resources are generated.
    - Shows x/y coords on tooltip text. And yes, Y's are backwards because that's how Civ4 works.

    Included in 0.0.2:
    - Cut/copy/paste/delete: You can copy-paste regions of any size, using the normal Windows keyboard shortcuts.
    - Fill tool: Works like the bucket tool in paint programs.
    - Resize/scale maps: You can resize[crop or expand canvas] the map, or scale[stretch] maps larger or smaller. (though the more you up/downscale them, the less they resemble the original maps, but going from, say, Huge -> Large turns out well)
    - Auto-river: Automatically connects rivers, though currently only supports rivers that don't have more than two adjacent rivers. (in directions N-S-E-W) This is something I'll be fixing in 0.0.3.
    - Auto-coast: Option to automatically create a coastline surrounding all land.
    - Auto-climate: Option to automatically tweak the map's climate based on latitude/longitude.
    - Tooltips: Optional tooltips tell you what's on the tile and estimates Production/Gold/Food.
    - Auto-resource: Option upon export to randomly apply resources to the map. Allows you to scale the resources, where a 10% resource map would be one where people fight heavily for resources, while a 300% resource map is one where resources are plentiful.

    The way it works right now, when you launch the program, you get an empty canvas with only ocean. You can use the tools to create the basic map layout, place whatever you want, then let the program do the rest if you'd like. (coastlines, climates, resources...) The map files usually used by the program are binaries that are only useful to the program, which makes it run much faster. (no parsing) The binaries store the map's version number, so your .map files today will still work with whatever version of the program is around two years from now.
    To make maps that Civ4 can use, you'll have to export the map. That's when autoclimate, autocoast, and autoresource works. This means you won't corrupt your map by using these features. They're 100% safe! There's even a "Seed" feature that'll help make it so (but not guarantee) your maps will export with the same random resources/climate each time. (climate at certain latitudes is 50/50 randomized)

    Here's some screenshots:

    Version 0.0.3 hotfix screenshot. This is my current map, blown up to 130x120, auto-everything'd, exported, then re-imported back into Civ4 Map Maker. I'm just posting it to show that it can be done now, with all the auto-features your maps probably won't need to look so busy. :) Note how the coastlines also look nicer thanks to the hotfix.


    Version 0.0.3 screenshot. A little difficult to see because the image's downscaled, but you can now see the copy rectangle and/or paste rectangle. The copied tiles are highlighted red. The yellow rectangle shows where the clipboard contents will go. I couldn't get the mouse pointer in the screenshot, but it's pointing at the top-left tile in the paste rectangle.


    Version 0.0.3 "results" screenshot. Auto-rivers are nearly complete. All forms of rivers will connect now. This screenshot demonstrates how it tries to discern parallel rivers. There's a few kinks to work out, but your typical not-too-fancy rivers will always look correct.


    Version 0.0.2 screenshot. This is actually the map I'm working on.


    The previous screenshot, after being exported to a WorldBuilder save. Note that it's using all the auto-features.

    Next version (0.1.0) will look at:
    - Custom resources (as requested by Shqype)
    - Bug fixes. There have to be a few by now...
    - Mini-map that works similar to the WorldBuilder one
    - More interesting transform tools. (rotate, manipulating the clipboard contents, etc.)

    By the way, this is a 100% open source project, so if you're a skilled developer and want to contribute, you're welcome to do so. (provided your code is clean, readable, and stable)
     
  2. GarretSidzaka

    GarretSidzaka Chieftain

    Joined:
    Dec 17, 2002
    Messages:
    4,696
    Location:
    Arizona
    added your editor to podcast called ModCast!!!

    listen through my signature's link :)
     
  3. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,046
    Location:
    In orbit
    Nice tool! (And not bad for a first post either!):goodjob:
     
  4. sarysa

    sarysa Chieftain

    Joined:
    Apr 13, 2008
    Messages:
    13
    Location:
    Silicon Valley
    Thanks. :) You can tell it's my first time here as I just realized there's two other projects similar to mine. :lol: The only difference being features and I think this one's the only open source project.

    As is customary with a new project, I'll be churning out builds like crazy for awhile, I could even have 0.0.3 checked in some time this week. (I'm finishing up map importing right now)
     
  5. Chiyochan

    Chiyochan Chieftain

    Joined:
    Jul 28, 2007
    Messages:
    710
    Location:
    Chiyochan's Country
    If possible a tracing/picture underlay feature would be great, but getting that Import map function is priority, especialy if it can clean the damn thing, I'm tired of broken/crashing maps every time I try to edit them
     
  6. GarretSidzaka

    GarretSidzaka Chieftain

    Joined:
    Dec 17, 2002
    Messages:
    4,696
    Location:
    Arizona
    We recorded a ModCast episode today that will be released soon, and featured your map editor :)
     
  7. sarysa

    sarysa Chieftain

    Joined:
    Apr 13, 2008
    Messages:
    13
    Location:
    Silicon Valley
    In what way are your maps broken?
    Right now, it'll let you get away with almost anything. It only cares what order BeginGame/BeginMap/BeginPlot appear in (and those three are required), and that the first line after BeginPlot is the x,y coordinate, but I could easily make it not care about that either.
    By the way, though I probably won't put in an underlay until next version after 0.0.3 (as I'd like to get core features before waves of bug reports come in), you can quickly travel through your map by pressing CTRL-direction. i.e. pressing ctrl-right will take you about about 20-something squares to the right. I forgot to document all the controls.

    Re: the modcast

    I'm pretty much out of it when it comes to great advancements in message board technology in the last 3 years, but I'll check your link for it. :D

    [edit: tax day 2008 :D ]
    I more or less figured out how to complete the auto-river. I might add support for two parallel rivers tonight, but that's far as I can go.
    Here's screenshot showing all river configurations will be supported in 0.0.3:
     
  8. Gr3yHound

    Gr3yHound Mr.MapView

    Joined:
    Mar 30, 2004
    Messages:
    395
    Wow great,
    i'm the MapView guy, and i really hope this project is going somewhere since i cannot really continue my project at this precice moment
    It's a bit sad i cannot check the program out atm (but surely will asap) but due to the screenshots it looks a little bit like you tried to adopt some display styles from MapView, i can spot resources and improvements showed in a way which is pretty much as i used to do. ;D

    If you have certain questions about how i did things or something just let me know, i'd be glad to help even if my reaction times might not be perfect and i might not have a lot of time.

    One interessting thing might be a class i've been working on that allows map export map export to xml, to provide a more general interface for maps when it comes to interchange between several editing programs. Wbs and company aren't really parsable i thought it shoulded be wrapped into something everyone understands, so it's no longer a matter of parsing and turns into a matter of interpreting. Xml Example (The example isn't really perfect since the xml'ed wbs doesn't have much a lot of the different possible scenarios shown, as i said, i was working on it)
     
  9. Shqype

    Shqype Shqyptar

    Joined:
    Nov 15, 2005
    Messages:
    2,468
    Location:
    New York + Shqypni
    It's a great first release, but here's a few things I'd like to see in the next version:

    1) Custom map size. Currently we can only choose from the 6 templates that you've provided. That's nice to have, but you should add a 7th option called "Custom" where we can set the size of the map.

    2) Scalable Map View. Currently there is a predefined area where we can view our map. If I want to view the lower portion of my Large map I'd have so "scroll" down considerably. Could you make it so that the whole map is viewable by expanding the viewable section and by adding a zoom in/out scale? I'd like to be able to see "the big picture," or my whole map at any given moment.


    Other things I'd like to see in the future:
    A way for us to add custom resources to the map editor. Maybe providing instructions for how to edit a bonus defines file of some sort so we can add our own resources (and buttons for it) so we can use this map editor to populate our worlds with them. The same for features and routes, please. :)


    Good job so far, though. It runs pretty fast; I haven't experienced any lag!
     
  10. sarysa

    sarysa Chieftain

    Joined:
    Apr 13, 2008
    Messages:
    13
    Location:
    Silicon Valley
    Thanks for the replies.

    re: Gr3yHound:
    I don't expect the interface to change much, as Java doesn't have the "look cool" options that OpenGL does. The tooltips are there so people can tell what's on a square.
    I'm hoping to keep my map editor slim and geeky. :D

    As for making it XML, I'd prefer to keep it binary for speed reasons. (for example, importing maps takes 3 seconds on my 4 year old development laptop. Ouch.) But I could add an "export as XML" feature in the future if we all work out a standard, and people are free to rip off the load/save code in MapData.java.

    re: Shqype:
    #1 is coming in 0.0.3. (that's the last thing I need to do before 0.0.3, in fact)
    #2 will be in the version after 0.0.3.

    By custom resources, do you mean

    [edit: got interrupted when posting this yesterday, was a bit of an earth-shaker in real life]

    By custom resources, do you mean resources that don't exist normally? I could add that to my list for two or three versions from now. Something like that should be simple to do so long as you don't have more than 200 custom resources, the code already breaks up images by expecting them to be 24x24 squares. They could certainly be binaries too, assuming the whole less than 200ish (I think 219 to be exact) custom resources.
     
  11. Shqype

    Shqype Shqyptar

    Joined:
    Nov 15, 2005
    Messages:
    2,468
    Location:
    New York + Shqypni
    Cool, thanks for the reply.

    And yes, that's what I mean by custom resources. I have new resources in my mod, and no more than 200, so it seems fine for me :)
     
  12. sarysa

    sarysa Chieftain

    Joined:
    Apr 13, 2008
    Messages:
    13
    Location:
    Silicon Valley
    Version 0.0.3 is out, and most of the core features are in.

    I'll definitely look at custom resources for 0.1.0. My todo list is pretty short right now. :) I think I've spent more time on this map maker than actually playing the game. Hah.

    Though I spent an hour today playing on a 10x8 map. :lol: I'm amazed it didn't crash.
     
  13. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,046
    Location:
    In orbit
    Have tried importing a BtS WBS file, but get a weird result (not really resembling the file I saved). Can't this tool be used with BtS files?
     
  14. sarysa

    sarysa Chieftain

    Joined:
    Apr 13, 2008
    Messages:
    13
    Location:
    Silicon Valley
    Really? The basic features in Base/Warlords/BTS are all the same, and the program ignores lines it doesn't recognize.

    Could you send me the WBS file and I'll see what's wrong? ( sarysa2@yahoo.com )

    Now it will strip things like civilizations and units. You should be getting the correct terrains, features, resources, routes, and rivers, and most map constants. (dimensions, wrapping...) The focus of the program so far is just to make the basic map. Advanced features will be added in later versions when the basics are more or less stable.
     
  15. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,046
    Location:
    In orbit
    I see. Maybe I'm just no good with the tool then... :crazyeye:(Sent you the file.)
     
  16. cubeboy

    cubeboy Leader of the Noobs

    Joined:
    Jul 26, 2007
    Messages:
    38
    my only complaint is that is does not work with BTS. I tried to load quick practice map i made with BTS, but apperantly the computer wants me to put in the Vanilla Civ 4 disk.
     
  17. sarysa

    sarysa Chieftain

    Joined:
    Apr 13, 2008
    Messages:
    13
    Location:
    Silicon Valley
    I think I'll put in a hotfix today for BTS/Warlords after I look at JELLEN's issue. The only issue I can see after having made my own huge archapalageo (horrible spelling) map is that the file extensions are different.
    If you have Windows set up to view file extensions, you can change it from Civ4WorldBuilderSave to CivBeyondSwordWBSave and BTS will automatically load it.

    Also, I'm going to change the coast from just a copy of the WorldBuilder coast 2d art to a much lighter colored ocean. That has to be confusing.
     
  18. sarysa

    sarysa Chieftain

    Joined:
    Apr 13, 2008
    Messages:
    13
    Location:
    Silicon Valley
    The hotfix has been posted. It's pending approval on CivFanatics, but it's available at the sourceforge link.
     
  19. sarysa

    sarysa Chieftain

    Joined:
    Apr 13, 2008
    Messages:
    13
    Location:
    Silicon Valley
    This has been moving well the last few days. I worked on my own map (which, feel free to laugh, is the Final Fantasy V overworld 1 :D ) and found a number of UI bugs along the way, and not just obvious stuff like the tooltip's redraw. (which is fixed in 0.1.0 dev) Seems that when the undo stack maxes out, undo/redo stops working properly. This, and other more detailed bugs with undo/redo is guaranteed to be fixed in 0.1.0. I should have spent more time trying it out.

    Here's a screenshot of the upcoming clipboard viewer:

    Note that with the addition of the clipboard viewer, I'll be getting rid of the awkward (especially to code) red highlight for the copied region. It was a poorly thought out feature to begin with. :)

    The only major thing left for 0.1.0 is to add support for custom terrains, feature, and resource mods, and I'm not quite sure yet how to do that. I'd like to make it as easy as possible. What would be a good mod that has custom versions of all of these that I could use as a point of reference? (not going with Final Frontier because that's more of a full-scale rewrite than a mod...way out of scope of the current map maker project)

    CODE TALK: I tweaked the code a bit and moved map manipulation methods out of MapData.java and MapImagePanel.java, making them static methods in Constants.java for ease of use if anyone ever decides to make some kind of add-ons. Also made map drawing work with any byte[][][] of map data fed to the newly static method for map drawing. (still will be located in MapImagePanel.java) I hope to get JavaDoc and Subversion set up for this project after releasing 0.1.0. I can't imagine anyone wanting to jump in on this chaotic mess of code right now.
     
  20. GarretSidzaka

    GarretSidzaka Chieftain

    Joined:
    Dec 17, 2002
    Messages:
    4,696
    Location:
    Arizona
    in trying to get your app to run but im having trouble. i am no code guru :)
    i installed the latest java, but i just dont see it really running in my tray and i dont think your program is seeing it
    all that happens is this pops up in a dos-box

    Spoiler :

    C:\Documents and Settings\Administrator\Desktop\New Folder>cd bin
    'java' is not recognized as an internal or external command,
    operable program or batch file.
    Press any key to continue . . .
     

Share This Page