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

something for the weekend

Discussion in 'Community Patch Project' started by ilteroi, Aug 29, 2014.

  1. ilteroi

    ilteroi Prince

    Joined:
    Mar 11, 2006
    Messages:
    345
    hi all,

    i took up the latest version of gazebo's code, merged my new city site selection and applied some speed optimizations (caching frequently used values).

    AI seems to place it's cities better now and the game should run noticeably faster.

    installation: easy. extract the attached files into the CP folder.

    feedback is appreciated.

    also, to whoever wrote this code:i don't think it's doing whatever it's supposed to be doing. pPlot is never assigned ...
    Spoiler :

    CvPlot* CvAIOperationAllyDefense::FindBestTarget()
    [...]
    // Start at 1, since ID 0 is the city plot itself
    for(int iPlotLoop = 1; iPlotLoop < NUM_DIRECTION_TYPES; iPlotLoop++)
    {
    if(!pPlot) // Should be valid, but make sure
    continue;
     

    Attached Files:

  2. whoward69

    whoward69 DLL Minion

    Joined:
    May 30, 2011
    Messages:
    8,417
    Location:
    Near Portsmouth, UK
    It's part of CSD (you can tell as it's within a MOD_DIPLOMACY_CITYSTATE block), so Gazebo
     
  3. guto8797

    guto8797 Chieftain

    Joined:
    Aug 2, 2014
    Messages:
    80
    Imma test this soon, lets see how it goes :)
     
  4. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    17,978
    Gender:
    Male
    Location:
    Little Rock
    Sounds great. Regarding the 'find best target' bit, I never got around to finishing or polishing that function – I wrote most of it, but never finalized it! I got distracted with a few other tasks, and it wasn't terribly necessary (as the AI doesn't have too much trouble helping CSs during barbarian events anyways).

    G
     
  5. M@drox

    M@drox Chieftain

    Joined:
    Jul 12, 2014
    Messages:
    20
    Loading of a saved game with this settler mod causes my unit visibility to be reduced to 0. Any unit cannot see beyond its own hex despite being in an explored area. If I remove it, I am able to continue the game with correct visibility. I am playing with CSD, C4D, and some of whoward69's picknmix mods so I don't know if there some other incompatibility.

    Overall, there seems to be some improvement. I wish the AI settler didn't go 50+ hexes away from the capital (I play on a huge map). This seems to be an issue regardless of your modifications.

    Thanks.
     
  6. ilteroi

    ilteroi Prince

    Joined:
    Mar 11, 2006
    Messages:
    345
    Ok, you're right. With AI autoplay everything worked fine, but I can reproduce the issue with a loaded game in single-player mode.

    I'll check this ...
     
  7. ilteroi

    ilteroi Prince

    Joined:
    Mar 11, 2006
    Messages:
    345
    ok, fixed the savegame bug. new zip attached to original post.
     
  8. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    6,765
    I should have some time this weekend, I will give it a shot!
     
  9. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    6,765
    I'm seeing a bug, the AIs aren't expanding at all as far as I can tell. Since you mentioned you touched the AI city place code, I'm guessing something happened.
     
  10. ilteroi

    ilteroi Prince

    Joined:
    Mar 11, 2006
    Messages:
    345
    hmm. that's strange and annoying. the visibility problem reported by m@drox had the same effect. also, i can't reproduce it anymore.

    did you load a savegame or start a new game? maybe it's a simple version mixup
     
  11. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    6,765
    I did forget to clear my mod and cache before trying your version (I am usually so good about doing that!!).

    I did install the base version and continued that same game, and immediately saw the AI start to expand.
     
  12. ilteroi

    ilteroi Prince

    Joined:
    Mar 11, 2006
    Messages:
    345
    ok, that's good to know.

    anyway yet another new version uploaded, indeed scaling on huge maps was a bit off ...

    changes:

    - scale city site distance modifier with map diameter not area (difference 1.58 against 2.46 for standard vs huge)
    - increase city site eval radius by 1 per 50 turns (was 20)
    - subtract SETTLER_DISTANCE_DROPOFF_MODIFIER from distance to calculate scale factor (won't found closer than 3 tiles to existing city anyway)
    - EXPERIMENTAL: AI attacks cities with ranged units only until there's a chance to actually conquer

    atttached image shows the distance scaling in turn 1 on a standard map. over time and on larger maps the slope becomes softer.

    note:

    - this is distance from the settler's current location, not from existing cities
    - this is the last factor in the calculation which is applied after all the other considerations like tile fertility, strategic location, etc

    speed measurement result:

    - 110 mid-game turns on a huge map.
    - original 61:20, optimized 53:10. that is, about 15% faster.
     

    Attached Files:

  13. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    6,765
    I confirmed it was my lacking of cache clearing. I remade a game and everything is good now.
     
  14. M@drox

    M@drox Chieftain

    Joined:
    Jul 12, 2014
    Messages:
    20
    With this 3rd version, I have the no settlers being built issue. I had cleared the cache before starting the game on a huge map. Anyone else see this?

    I cleared the cache and reverted to v2 with no issue.
     
  15. ilteroi

    ilteroi Prince

    Joined:
    Mar 11, 2006
    Messages:
    345
    funny, I never clear the cache when updating, and I never had that problem since the savegame bug was fixed.

    can you provide a savegame?

    anyway, there's a new version up. changelog on github. check the "singlethreaded" branch if you're curious
     
  16. M@drox

    M@drox Chieftain

    Joined:
    Jul 12, 2014
    Messages:
    20
    I do not have a saved game. I tried to repeat the problem but I was unable to see the problem again despite having everything the same. :confused:
     
  17. Pheno

    Pheno Chieftain

    Joined:
    Jul 19, 2012
    Messages:
    19
    I tried this build and for some reason Hanging Gardens wasn't available to build even though I'd discovered mathematics. I'm almost certain it hadn't already been built. Anyone seen anything like this?
     
  18. Funak

    Funak Deity

    Joined:
    Jul 15, 2013
    Messages:
    9,127
    Did you forget to pick tradition?
     
  19. Pheno

    Pheno Chieftain

    Joined:
    Jul 19, 2012
    Messages:
    19
    Ah, must be that, thanks. The description on the technology page needs updating as there is no mention of a requirement.
     
  20. Pheno

    Pheno Chieftain

    Joined:
    Jul 19, 2012
    Messages:
    19
    A couple of other possible issues:
    1. Sometimes hills are impassible. Seems to only be hills without resources, and I've only noticed it on desert and plains tiles.
    2. As Iroquois, my second city had zero tile growth.
     

Share This Page