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

City Optimiser Development Thread!

Discussion in 'Civ4 - Strategy & Tips' started by j_mie6, Jul 22, 2012.

  1. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    Download Version 1.0

    Hello!

    Welcome to the Development thread for the Civ4 BtS City Optimiser. This is my new utility that I am developing for people's convenience.

    What is it?
    This utility allows you to simulate cities before you build them in civ allowing you to plan ahead on city site locations and save you experiementing with configurations wasting valuable workers and turn times. I am also going to work on the main feature for this utility for the next version, the program will be able to customize the city for you to get the max yields possible out of the given terrain and features etc. The utility also makes sure that your configurations are possible (ie preventing you from placing iron in the sea etc).

    My question to you is:

    What features do you want to be included in this program?

    the program already can count up yield of a city, allow you to copy and paste plots, even SAVE configurations as .city files (this could allow users to post their configurations on the forum for others to download and see for themselves (this would be useful in the Strategy and Tips forum!!!)). Also the plot editor (the panel on the bottom right) will be changed if you are selecting the city plot to the city editor where you can adjust the plot yield adjusting buildings like the colossus. And of course the future optimising feature. But there is obviously loads of other ideas that can be implemented into this utility!

    Attached to this post is a teaser screenshot of the interface (built in Java) showing some of the features of the program in action. (on that note, I need a better idea for an icon for the program if anybody can suggest something!)

    Any help on the code for the optimiser itself or other code (like detecting adjecent plots and restricting based on their properties (like oasis features cannot be put next to each other)) will be greatly appriciated!!!
     

    Attached Files:

  2. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    Hmm I gave it some thought and figured out another feature. I am currently working on a parser that can import a city directly from a WorldBuilderSave file! This will allow the user to bring in cities directly from their game (though of course the parser will cause spoilers on the terrain) by expressing the in game coords of that city (using the cheat mode) into the import window in the program!

    Also, no comments so far. What do people think of this idea?
     
  3. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,146
    Location:
    Germany / Netherlands
    I guess the thread would be better suited in the strategy area.
    Because the thread is essentially not really about modding, but more about strategy. The people in the strategy area might be more interested.

    Else: Sounds in general interesting, but I'm not the sort of player who'd use it (because I just play to have fun, not to maximize everything).
     
  4. xcrissxcrossx

    xcrissxcrossx Prince

    Joined:
    Jun 16, 2007
    Messages:
    314
    Location:
    Indiana
    I am very interested in this program! I honestly can't think of anything else it would need though. Please upload it soon cause I want to try it.
     
  5. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    Still got a bit of work to do first :p

    @the_J

    you mind using your mighty powers to move it over there then?
     
  6. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,146
    Location:
    Germany / Netherlands
    Your wish is granted :D.
    -> Moderator Action: Thread moved to the strategy section.
     
  7. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    Thanks omnipotent one :lol:

    In other news, the parser has been completed. The only thing it is incabable of parsing in is whether a plot is riverside or not. This is because there is no really clear way of determining it from the senario file. If anyone can tell me what variables a plot will have if it is riverside then I can implement it!
     
  8. Um the Muse

    Um the Muse King

    Joined:
    Sep 11, 2009
    Messages:
    922
    Location:
    surrounded in the USA
    Does your utility take into account worker turns?

    One snag I repeatedly run into when I'm developing cities is that a worker has to play catch-up; 0 improvements for size 1 city, 1 improvement for size 2 city (about halfway through, I can finally catch up).
     
  9. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    It doesn't so far. For the moment it will tell you that if you play your cards right the size of the city at the end of construction (depending on how developed you want it) and it's yields. When my future Working plot features comes into play it may require you to follow the city up through it's population. (you made me think of that point)

    back to your comment: I have thought about worker turns myself . though I am not sure how it could be implemented. Maybe on the display it could say x turns to build these improvements given the amount of workers in use. Not sure if that is what you mean though... if you can explain more please do!
     
  10. Seraiel

    Seraiel Deity

    Joined:
    Sep 6, 2011
    Messages:
    7,954
    Gender:
    Male
    I don't know if this is what you're asking for, but I'd like to see a whip-optimizer. What does it mean if I whip i. e. a Cathedral that costs me 4 pop and therefor cannot work 4 Cottages but get insane :culture: bonus for the remaining tiles and buildings, same for Libraries, Universities, etc.

    No idea if this is possible.
     
  11. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    hmm so a getting the most out of whiping without damaging yourself? seems plusable but a couple of problems:

    1) I am not sure what is used to calculate whipping pop required so would have to do it by hand.
    2) it would have to presume that the building was not worked on at all beofre whip
    3) I don't know much about the whipping functionality of the game. That would require someone who knows more on the subject to tell me exactly how things work.

    I guess it could fit into the simulator, but probably a while away :D
     
  12. damerell

    damerell Slow Worker

    Joined:
    May 31, 2012
    Messages:
    804
    Location:
    UK
    My recommendation; suggest, don't enforce, legality of layouts. Beyond that - let players alter tile yields to anything they please (or have tile types and improvements described in a simple text file, or better yet - but ambitiously - parse the game's XML). Way more use with mods that way.

    Multiple layouts for the same terrain, side by side. "Here's what it's like workshopped up at State Property; here it is cottaged up under Free Speech and the other cottage civics."
     
  13. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    hmmm I could make a comparision window which has two plot instances :D next version :p Nice idea!

    Authough I want this to be mod friendly reading the games XML (authough definatly possible) will cause a lot of reprogramming. Saying that I have thought about a text or XML file that allows the user to define new types using the programs system of enumeration, the new types would be like Terrians.MOD_MARSH instead of the Civ style TERRAIN_MARSH (if you want the technical difficulty it lies here:

    Spoiler :

    Civ4's types are numbers, thats all. Whereas Java has a unique ability to assign properties to the enums TERRAIN_MARSH represents the number 4 for example but Terrians.MOD_MARSH represents the properties. Hope you understood that :D. It's less difficult to actually link the two via the WorldBuilderSaves as I wrote a big system (250 lines of code :p) to morph the civ4 numbers into mine (ie TERRAIN_GRASS in the wbs to Terrains.GRASSLAND for the program to assign to the plot), though they correspond and my program handles the properties.)


    This system would allow users to define a mods terrains in a txt or XML format and then a load mod option in the File menu could add the Enums to the defaults.

    As for the Advice not Dictate, I think you are right. Easy to implement and I can add a shortcutkey that allows you to change additional yeilds to the tile (that will be next version)

    Thanks for the suggestions!

    Jamie
     
  14. Seraiel

    Seraiel Deity

    Joined:
    Sep 6, 2011
    Messages:
    7,954
    Gender:
    Male
    1. Not sure if I understand that truely, but you don't have to know how whipping-pop is calculated, one just needs a field in which one can put in how much pop is required for the whip, and what it means for the city, when some worked tiles are not available anymore.

    Other than that: Whipping is complicated, it's 20 :hammers: on Quick, 30 on Normal, and 90 on Marathon (don't know the epic value) . Common Multipliers are OR (Whip enhanced by 25% so i. e. 112.5 :hammers: on Marathon) , Forges (again +25%) and Kremlin (+50%) . Ressources count towards the Whip (i. e. Marble = +100% and like that) but (National / World) Wonders have a penalty, not 100% sure on how much, but I think it they had the increase the cost to 150%, so something costing i. e. 200 :hammers: but being speed up by a ressource would cost 5pop (200 * 1.5 / 2 = 150) .

    2. I guess this is the complicated part, the calculator should show "you will miss 10 :commerce: because of the worked tiles, but you'll get xy :hammers: from the whip and xy :hammers: because the city can begin on producing something else sooner.

    3. I think there are guides in the war-academy explaining the Whip in detail. I only know as much as "whipping away is (almost) always the right choice if the anger allows it, and one doesn't whip away special ressources. Green hills as I've learned have about the same effectiveness as the whip, and the conversion factor of the whip is something like 1 :food: are 2 :hammers: .

    Sera
     
  15. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    So currently the next version of the program (not release) will contain:

    Mod support (hopefully, it's a challenge but I liek challenges :D)
    Comparision Window to compare two plots
    Add additional yields to tile
    the optimiser itself (we can hope :lol:)

    @ sera

    When you put it like that it seems a little easier to do. As long as the user enters what the whip will cost that is. I will look into it for future versions :D nice idea :p shame I wouldn't use it I'm one of those weird people who doesn't whip (dont eat me!!! probably because in my mod a slave revolt can cause rebellions which isn't fun for me to deal with :lol:)
     
  16. Thedrin

    Thedrin Deity

    Joined:
    Jan 24, 2002
    Messages:
    2,649
    Location:
    London
    Hammers per population when building units or buildings:
    Quick: 15
    Normal: 30
    Epic: 45
    Marathon: 90

    When building world or national wonders:
    Quick: 7.5
    Normal: 15
    Epic: 22.5
    Marathon: 45

    After multipliers are applied, the figure is rounded down to the nearest whole number. So a city building a world wonder on epic speed will get 22 hammers if it whips 1 population point, 45 hammers if it whips 2 population points, or 45 hammers if it whips 1 population point with access to stone.

    Organised Religion doesn't boost the production of units.
     
  17. Seraiel

    Seraiel Deity

    Joined:
    Sep 6, 2011
    Messages:
    7,954
    Gender:
    Male
    Sure the 15 :hammers: of Quick speed aren't 20? Normally the value of a Whip should be the same to that of a Math-Chop.
     
  18. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    Thanks for the info
     
  19. Thedrin

    Thedrin Deity

    Joined:
    Jan 24, 2002
    Messages:
    2,649
    Location:
    London
    You're right. I never play quick so I just down what you put down. And then I misread you.
     
  20. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    Ok I hit a snag with the mod compatibility. While looking into it I found my enumerations are constants, that is no new ones can be created at "runtime". In order to make this mod compatible I am gonna have a lot of code to write to implement a less sophisticated form of enum which can have new enumerations created while the program is running ie: loading a mod. From stratch :D Certainly challenging :p
     

Share This Page