1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

HoF Map Finder/Generator Utility

Discussion in 'Civ3 - Utility Programs' started by Moonsinger, Jan 20, 2004.

  1. Moonsinger

    Moonsinger Settler Retired Moderator

    Joined:
    Apr 22, 2002
    Messages:
    4,374
    Location:
    Iowa
    First of all, I would like to thank Dianthus for helping me out on this project. Without your extensive works on reading/analyzing the save game file, this utility wouldn't be possible.:) On my list, you are one of the best C++ coder around here. Dianthus, a big hug and thank to you!:)

    I also would like to thank Gramphos, sirp, Hot-bandito, and Aeson for their research on the .SAV file format and its compression format. Without their contribution, this project wouldn't be possible.

    :thanx:

    --------

    Well, I did it! This is a utility that will help you find that perfect map for your HoF game.

    Since I don't know much about the format of the savegame, I recruited Dianthus to help me out on this one. Thanks Dianthus!:) It's really a join development effort between him and me. I do the user interface (.EXE) and he read the savegame and check for the domination limit (.DLL).:)

    Here is a screenshot of it (edit: old screenshot was deleted after 4912 views; the one below is from the latest version):
     

    Attached Files:

    Spoonwood likes this.
  2. Moonsinger

    Moonsinger Settler Retired Moderator

    Joined:
    Apr 22, 2002
    Messages:
    4,374
    Location:
    Iowa
    Version 6.5 (as of 04/20/2005):

    http://www.civfanatics.net/uploads9/MapFinder_v65b.zip

    Additonal features as follows:

    MapFinder will now recognize multiple rule sets. In order to do that, you need to add rules as follows:

    #1. Setup your Rules

    #2. Save your rule to the "rules" directory (it will create/and default to that directory automatically).

    #3. Go back to step #1 to create another set of rules or whatever. Create as many set of rules as you like. Please try to give each set of rules a meaningful name when you save it!

    #4. After you have setup all your rules, launch it as usual.

    Note: You must have at least one rule set save to the "rules" directory in order to find any map. Whenever MapFinder search for maps, it will attempt to satisfy every set of rules stored in the "rules" directory. Btw, this rules directory can be located in the MapFinder directory.

    New feature:
    To reverse the sort direction, just click on the header of a column that has already been sorted. Other than the first two columns, the sort direction (either ascending or descending) will be reversed.

    ---------------

    Please remember three things when running MapFinder:

    1. File/Setup menu is your friend. Always check your setup and verify your setting before generating new maps.
    2. Be sure to tell MapFinder the correct AUTO SAVE directory of Civ/PTW/C3C (depending on which version of the game that you are playing). If you forget to do this step, MapFinder won't generate map (it still run just fine, but it won't give you any map)
    3. Remember to start "New Game" first and activate MapFinder when you are inside Civ3/PTW/C3C (any time during or after 4000BC but not before 4000BC).

    For explaination of how to fine tune the two extra sleep functions, check out this post. Discussion about this version was started around page 20 of this thread.

    Note: This version is bug free and it should work well with all version of CIV3/PTW/C3C with US keyboard layout. If your system default keyboard layout isn't US, you need to temporarily set your keyboard to US before running MapFinder.

    ---------------

    Installation Instruction:
    Unpack utility "mapfinder.zip" to a directory of your choice and create a shotcut for the "mapfinder.exe".

    ---------------

    How to use this utlity:
    1. Launch the "mapfinder" utility before/after launching Civ3/PTW/C3C
    2. Start a "New Game" (very important! You must do this!)
    3. Choose Your World! (very important! You must do this!)
    4. Go through "Player Setup" and select "Difficulty" level or whatever you like. (again, this is part of the starting up new game process! You must do this before you can play!)
    5. That's it! You are now at 4000BC. This is the place where you start MapFinder

    Technical Note: Basically, the program will work exactly as follows:

    1. Tell Civ3/PTW/C3C to start a new game
    2. Check for the domination limit or whatever
    3. If the requirement (your rule set) is meet, save the game at the beginning of the 4000BC turn and and take a screenshot of the starting location.
    4. Go back to step 1. This is an infinite loop until you stop it or whenever its find the max number of maps that you have asked for.
     
  3. Artofcybermars

    Artofcybermars Chieftain

    Joined:
    Nov 18, 2003
    Messages:
    32
    Kudos to you both. I know this utility will get lots of use here. not only when i make my HOF attempts (coming to an forum near you.) but my general practice games as well. Am looking forward to future updates when your time permits.:goodjob:



    Of course an link to the file will probably make it easier to download:D
     
  4. superslug

    superslug Still hatin' on Khan Moderator Hall of Fame Staff

    Joined:
    Jan 5, 2003
    Messages:
    11,357
    Location:
    The Farm
    I'm interested in a blue one. Can I get an optional CD player with this?

    Just kidding, Moonsinger. I anticipate using this once I have need to generate maps again...

    :thanx:
     
  5. Moonsinger

    Moonsinger Settler Retired Moderator

    Joined:
    Apr 22, 2002
    Messages:
    4,374
    Location:
    Iowa
    Sorry, I forgot to include the zipfile. It's now included in my second post.:) Also, each unit of the "time delay" = 1/1000 of a second. Therefore, 7000 = 7 seconds. I will have to do some unit conversion in the final version.;)

    Btw, I have done a test run of it for about 1 hour. Just found 2 map with domination limit of 4512 and 4514. One of them right on the river and next to a cow!:)

    PS: For starter, I recommend the default "time delay" which currently set for C3C. For PTW and Civ3, you may want to cut that number down in half (note: C3C take twice as long in loading/saving). In any case, do not set them to lower values during your first attempt.;)
     
  6. Darkness

    Darkness Shadow creature

    Joined:
    Jul 18, 2002
    Messages:
    6,755
    Location:
    Rotterdam, the Netherlands
    Great News Moonsinger (and Dianthus) :goodjob:
     
  7. superslug

    superslug Still hatin' on Khan Moderator Hall of Fame Staff

    Joined:
    Jan 5, 2003
    Messages:
    11,357
    Location:
    The Farm
    Well, I downloaded it and tried to launch it::(
     

    Attached Files:

  8. Moonsinger

    Moonsinger Settler Retired Moderator

    Joined:
    Apr 22, 2002
    Messages:
    4,374
    Location:
    Iowa
    //Edit: I was wrong about it! That file dependancy is coming from my EXE. Sorry, Dianthus! Here is the new one standalone that doesn't require any "qtintf70.dll" (Delphi CLX runtime library which I don't need!):

    http://www.civfanatics.net/uploads6/mapfinder2.zip
     
  9. Aeson

    Aeson orangesoda Retired Moderator

    Joined:
    Nov 16, 2001
    Messages:
    2,686
    Have you thought about modifying this to work with random multiplayer maps? I'm sure a lot of people would be interested in having a utility which will quickly tell them if all starting positions are within a certain range.
     
  10. Moonsinger

    Moonsinger Settler Retired Moderator

    Joined:
    Apr 22, 2002
    Messages:
    4,374
    Location:
    Iowa
    Well, that 's really up to Dianthus. I don't have a Borland C++ Builder 5 or 6 compiler and I'm not good with C++ either (I haven't done much C++ since my college day). Sure, I can read C++ code very well, but other than that I can't really do anything else with it.:cry: Therefore, it's really up to you guys to recruit Dianthus on whatever new adventure/utility for the multiplayers.

    PS: I also just found a really good map last night (after about 1000 iterations). Domination limit of over 4552 next to cow and river (deity level); when I have time, will see if I can break 60K.;)
     
  11. Dianthus

    Dianthus Small but hardy

    Joined:
    Mar 26, 2003
    Messages:
    5,814
    Location:
    Woking, UK
    So, does that mean you're happy to do the GUI if I do the sav stuff in C++? I haven't done much with multiplayer .savs, apart from reading one test one when getting CRpViewer to work with [c3c]. Aeson, what sort of criteria are you thinking of? Are you saying you want to know how close the human player start positions are?
     
  12. Moonsinger

    Moonsinger Settler Retired Moderator

    Joined:
    Apr 22, 2002
    Messages:
    4,374
    Location:
    Iowa
    Ok, I will do the GUI if you can do the core. However, if we are going to continue this partnership, I think I need to get a C++ Builder compiler soon. Why interfacing with the DLL when I should be leaning how interface with its core directly?;)
     
  13. Aeson

    Aeson orangesoda Retired Moderator

    Joined:
    Nov 16, 2001
    Messages:
    2,686
    A few times groups of players have come to me to make sure their starting positions in a PBEM are balanced (within reason). I was thinking about a utility that looks at each start location and either gives a thumbs up or rejects the map without disclosing any information about the starts. It seems like you're pretty close to that with this.

    Make the parameters configurable. A range of 'good' tiles within a certain radius. So a group starting a PBEM could just generate a map, run the utility, and see if each player has at least 5 useable tiles within a radius of 3... or whatever. That would allow them to filter out maps where one or more starting locations aren't viable.
     
  14. Moonsinger

    Moonsinger Settler Retired Moderator

    Joined:
    Apr 22, 2002
    Messages:
    4,374
    Location:
    Iowa
    Actually, I think he's already there! I have seen his source code for the CivReplay program - very well written! Basically, he had created an object that read almost very single detail about the savegame into memory. Now, the sky is really the limit for the rest. Just write another function to calculate the total of food, shield, and resource within n tile radius for each starting position - me think it will be a piece of cake for Dianthus. I'm sure he can make sure that each PBEM player has almost the same amount of food, shield bonus, and resource within n tiles from their starting position without much of a problem!

    Time like this, I wish I have half of his talent. Seriously, sometimes I really wish I have more brain.:cry:
     
  15. Dianthus

    Dianthus Small but hardy

    Joined:
    Mar 26, 2003
    Messages:
    5,814
    Location:
    Woking, UK
    :blush:. I think you're being a bit hard on yourself though. After all, you've done a good job on the GUI. Oh, and I've seen you play Civ :).

    I'm just writing some functions right now that will give total food/shields/gold for the start tile and surrounding 8. I should think that would be a good enough comparison for the start location.
     
  16. superslug

    superslug Still hatin' on Khan Moderator Hall of Fame Staff

    Joined:
    Jan 5, 2003
    Messages:
    11,357
    Location:
    The Farm
    I just downloaded this again and ran it for a few minutes for maps with a domination limit of 3500 (I wanted to see how it worked without waiting an hour;) ). All I can say is that this program rocks! :band:

    Moonsinger and Dianthus, the two of you have created something that's going to save me hundreds of hours "between" games generating maps. I'd have been ecstatic just to have .savs generated at a certain domination limit, but to have included accompanying screenshots? Goodness gracious...

    :thanx::thanx::thanx::thanx::thanx:

    By the way, thank you!
     
  17. Moonsinger

    Moonsinger Settler Retired Moderator

    Joined:
    Apr 22, 2002
    Messages:
    4,374
    Location:
    Iowa
    Instead of just calculating the total of food/shields/gold for the starting 8 tiles radius, I think you can just add another arguement to that function and have it recursively calculate the total of food/shields/gold for the Nth ring from the starting location - a lot like your RCP ring function.;) Of course, for this MapFinder utility, I would simply pass it the radius of 1.:) Basically, you are giving birth to an API for Civ3!:goodjob:
     
  18. Moonsinger

    Moonsinger Settler Retired Moderator

    Joined:
    Apr 22, 2002
    Messages:
    4,374
    Location:
    Iowa
    Hehe, wait until you see the final version.;)
     
  19. boogaboo

    boogaboo Josef Popper 4ever

    Joined:
    Oct 2, 2003
    Messages:
    1,706
    Location:
    Holon, Israel
    Wow.. API for Civ3 for Windows for PC for me!
    Can.. can u give me the code??
    I'd love to learn it and advise!

    Regards,
    Chaim.
     
  20. SirPleb

    SirPleb Shaken, not stirred.

    Joined:
    Jan 1, 2002
    Messages:
    1,415
    Location:
    Nanaimo BC Canada
    Wowee! [party] [dance] Thank you so much Moonsinger and Dianthus!

    This is an inspired utility, makes me want to start a new HOF game :)
     

Share This Page