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

Advanced Civ

Discussion in 'Civ4 - Modpacks' started by f1rpo, Apr 16, 2017.

  1. Danwood

    Danwood Warlord

    Joined:
    Mar 21, 2008
    Messages:
    240
    My game is stuck at "Waiting for other civilization"

    I'm using AdvCiv latest version with the Sevopedia fix, and with the Totestra map script (just ask me if you can't find it).

    Save is attached, just pass the turn.
     

    Attached Files:

  2. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    506
    Location:
    Germany
    @Danwood: Found the problem; it's a bug that I introduced. A Carrack in Thessalonica is switching its AI type back and forth between "Settler_Sea" and "Explore". That can only happen with Carracks and, even then, is probably quite unlikely. So – seems like a case of Murphy's law. Not sure how to fix this exactly yet, but will probably upload a DLL in the next few days. In the meantime, I hope you can continue the game from the attached save. (Assuming that you haven't abandoned it anyway; but it looks like a good game.) I've declined Joao's request for Medicine at the start of the turn, entered the WorldBuilder and set the AI type of the troublesome Carrack to "Spy_Sea", which I think cannot be changed dynamically by the AI. Saved the game. Then, as a test, hit "end turn" 3 times without issues.

    Interestingly, wrt. to the diplo popup discussion, I immediately got two resource deals canceled and, in one case, the AI agreed to give me a strictly better deal than before. So that's another thing for me to debug. Later got an Open Borders offer – those also tend to be annoying.

    And getting a diplo popup right after loading a savegame (beg for Medicine) is always irritating. If I do move AI diplo decisions to the start of the human turn, then I need to make sure to autosave afterwards, not before. Currently, the autosave actually happens at the start of the game turn, which is especially bad in scenarios when the human player isn't necessarily in slot #0.
     

    Attached Files:

    Last edited: Aug 17, 2019
  3. Danwood

    Danwood Warlord

    Joined:
    Mar 21, 2008
    Messages:
    240
    @f1rpo I can relate with wtha you're experiencing, as a game dev: just a random bug report can spark a prethora or little findings! Glad you spotted the issue and probably will fix it (although very uncommon), along with the other annoyances. Loving your work! It would be just perfect with the Mastery Victory mod imho!

    PS: of course i'm continuing my game, it's one of the best I've played ;)
     
  4. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,516
    Location:
    israel
    Nice catch on this bug!


    Danwood,
    Platyping has a python based mastery,
    It should be easly merged.
    But tge thing with added vic types that the ai doesnt know them.
    Theres a dll mastery version, not sure how the ai deals with it.

    F1rpo,
    Let me know if i can assist in someway to debug it or anything.
    for bow i removed setttler sea from carrack.
     
    Last edited: Aug 18, 2019
  5. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    506
    Location:
    Germany
    I've updated the download database page with a link to a DLL with a minimal bugfix that simply prevents the AI from ever changing the Unit AI type of a Carrack from Settler_Sea to Explore_Sea. In Danwood's savegame, it'll pick Attack_Sea now, which is fine with me. (That AI type change is really just a BBAI workaround to get the AI to upgrade its Carracks.) I've also put changes to address the underlying problems on GitHub.
    Here is the commit with my quick fix in the DLL code.
    I wouldn't have guessed that this can be done in Python. Platy sure is crafty. Looks pretty easy to merge. Here's a link.

    I've taken this opportunity to finally read up on the Mastery victory:
    Seems like it's mainly an improved Time victory. I had always assumed that it would end the game when a player reaches a point threshold or gets far enough ahead of everyone else. That would make more sense to me.
    I don't see any in the standalone versions. But e.g. RoM/AND or C2C might have AI code.
    Thanks for the offer. You've already been helpful by reporting AdvCiv/DotO issues in our private conversations. The bugs that I introduced I should better fix myself. The other – nonurgent – issues discussed in this thread anyone could collaborate on of course. Hard to say if and when I'll get to them on my own.
    Thanks – also for the helpful bug report and the suggestion.
     
  6. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,516
    Location:
    israel
    super, thanks.

    yes, he is a python civ4 maser.

    hehe me too...
    in my first modding years i had the sevo mastery mod for quite a while. have you checked the sdk code? some versions came out .
    personally, i dont really mind it, since for me, only conquest or domination ")

    humm...good luck scouting their enormous code :)

    always my friend, its the least i can do and contribute.



    so now for questions -
    why is there problem with settler sea and explore sea?
    i checked the xml and saw that only Carrack has this combo, why does it happen?
    i changed the settler sea , would that have "fixed" this bug?


    with time :)

    thanks for the quick fix anyway,
    later.
     
  7. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    506
    Location:
    Germany
    I only checked this version for BtS 3.17. This here is supposed to fix a bug with the spaceship; comprises code from Community Civ V and Quot Capita. Atomic Gamer link. :nuke:
    Full-text search for "mastery" on CvPlayerAI.cpp and CvTeamAI.cpp: Nothing in C2C, one line in AND's CvPlayerAI.cpp. Woot. Of course there are other modpacks that include Mastery; but I'm not going to chase that rabbit now.
    The lists of Unit AI types in XML aren't exhaustive – the DLL may decide that additional AI types make sense for a particular unit, and would probably do so for Settler_Sea and Carrack. Setting a "NotUnitAI" type would work I think. Why does it happen – well, it doesn't anymore. :) In short: The AI won't normally upgrade Settler_Sea Carracks because Frigate isn't a better unit for transporting Settlers than Carrack. So BBAI added code that allows unneeded Settler_Sea Carracks to switch to other AI types – including Explore_Sea. I added code to allow unneeded Explore_Sea units to switch to other AI types – including Settler_Sea – and wasn't really aware of the BBAI code.
    "For everything there is a season and a time for every purpose under heaven."
     
  8. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,516
    Location:
    israel
    well,
    i guess maybe mastery dont have AI.
    totally...not worth it. personally like i said, i would only play the normal vics, mostly domination.

    clearer now, thanks.
    NotUnitAI, humm i wasn't familiar with it.

    :D
     
  9. Elkad

    Elkad Emperor

    Joined:
    Mar 26, 2007
    Messages:
    1,005
    I'm having an issue with units on explore not healing. They stop and just stand in place forever.

    I'll try to get you a save.
     
  10. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    506
    Location:
    Germany
    Thanks. It was easy enough to reproduce. I introduced that bug long ago when I turned Heal into Sentry-Heal. Fortunately, AI units aren't affected; still – this renders explore automation pretty much useless. So I guess I had better upload a fixed DLL in the near future.

    Edit: Git commit with the bugfix (but no DLL yet)
     
    Last edited: Aug 25, 2019
  11. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,516
    Location:
    israel
    cool man,
    thanks.

    about this one - do we still need it?

    Spoiler code :
    Code:
    // advc.tmp: Disabled temporarily b/c of possible oscillation between UnitAI_SETTLER_SEA and UNITAI_EXPLORE_SEA
                            /*    if (kOwner.AI_totalUnitAIs(UNITAI_EXPLORE_SEA) == 0)
                                {
                                    if (kOwner.AI_unitValue(getUnitType(), UNITAI_EXPLORE_SEA, pWaterArea) > 0)
                                    {
                                        AI_setUnitAIType(UNITAI_EXPLORE_SEA);
                                        AI_exploreSeaMove();
                                        return;
                                    }
                                }*/
    




    Elkad, thanks for the catch and bug post.
     
    Last edited: Aug 25, 2019
  12. Elkad

    Elkad Emperor

    Joined:
    Mar 26, 2007
    Messages:
    1,005
    Wow. Maintenance is insane. New cities (in former enemy culture) are costing north of 30gp/turn.

    Huge map, I'm only at 37 cities.
     
  13. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    506
    Location:
    Germany
    Still needed unless you've merged this commit. But I think the much simpler temporary bugfix is fine.
    It's probably the K-Mod change that removes the upper bound on the cities counted for maintenance (was 6 originally as far as I recall). That's a pretty crude change. I could well imagine that it needs to be adjusted to the map size or crowdedness. What would be a sane value for the number-of-cities maintenance of the 37th city? Distance maintenance is reasonable I hope(?).

    On an unrelated note: I've found and fixed (though not yet in the released DLL) another bug in my AI trade cancellation code through Danwood's savegame. I think the bug had lead the AI to cancel trades that were – in the estimation of the AI – of little value to the human player, i.e. health and happiness resources that none of the human cities really needed.
     
  14. Elkad

    Elkad Emperor

    Joined:
    Mar 26, 2007
    Messages:
    1,005
    Yeah, I'm still (on 0.96) getting cancelled trades which the AI will then renegotiate immediately. My Iron+Horse for 2 happys, he'll cancel and then accept again every 10t, and maybe throw in a couple coins he wasn't before.

    Re:Maint. Partially my own fault. I've got vassals on (unusual for me) and I'm paying a huge amount of colonial maint.
    Next game I'll turn vassals back off and see how it goes.
     
  15. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,516
    Location:
    israel
    hey,

    thanks for all the fixes.

    im having some issues, ill post in our private chat.
     
  16. Elkad

    Elkad Emperor

    Joined:
    Mar 26, 2007
    Messages:
    1,005
    One more. It's been here a long time, (K-Mod? earlier?). Sometimes blockades aren't cleared off tiles. Annoying.
    I have no idea what causes it. Possibly capturing a city that is being blockaded by a 3rd civ (who you are at peace with?).

    If nothing else, can you force it to recompute blockades on game load or something? You could save/restore to fix it.

    Culture has some oddities as well at times. They fix themselves eventually, but a recompute on that on load would be useful.
     
  17. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    506
    Location:
    Germany
    These problems do have a history. E.g. there's this BBAI comment
    Spoiler :
    BBAI NOTES (jdog5000, 06/01/09):
    // There are rare issues where the path finder will return incorrect results
    // for unknown reasons. Seems to find a suboptimal path sometimes in partially repeatable
    // circumstances. The fix below is a hack to address the permanent one or two tile blockades which
    // would appear randomly, it should cause extra blockade clearing only very rarely.
    Should be pretty easy to test; I'll give it try.
    That should be doable. Ideally, save/reload shouldn't affect the game state, especially for testing. But one could always have an XML setting "RECOMPUTE_BLOCKADES_ON_LOAD" or so. Of course I'd prefer a more proper bugfix.
    Tile culture accumulates over the course of a game; no way to reset and recompute that. Tile ownership (based on the culture percentages) should already get updated every turn. There are some odd rules though, like tiles remaining unowned for a few turns after city conquest.
    I have some hope that this is fixed on my end. I'll see if I can include the trade bugfixes in the next mini update of the DLL.
    You could also try disabling colony maintenance through AdvCiv\Assets\XML\GameInfo\Civ4WorldInfo.xml. A bit of a shame to disable vassals mainly to eliminate colony maintenance.
     
  18. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    506
    Location:
    Germany
    To finally get back to @Cruiser's post:
    I think I'll give this a try. Since relations bonuses from Open Borders with faraway civs now tend to take much longer to build up, it could make sense to let the nearby bonuses not just increase faster but also up to a higher limit. For me, that higher limit is probably going to be 3. A higher limit for DP is also interesting, especially because this won't normally make it easier to get to Pleased – that's what was too easy in BtS. However, if relations from DP play a bigger role, then the AI behavior for signing a DP may have to become a bit more sophisticated. An AI civ that isn't threatened at all should require a one level higher attitude for signing and/ or should count the years spent in the pact more slowly. Likewise, an AI civ that actually benefits from a DP should be more willing to sign one and/ or count the years faster.
    As a basic principle, it makes sense to me that civs have the best relations early on when they're close enough to trade (maybe via Sailing) but not close enough for a war of conquest. Like the Mesopotamian civilizations trading with the Indus valley. Among themselves, the Mesopotamians traded and fought wars; can't really have both in Civ, at least not in quick succession. Gotta have some early warfare though imo.
    So you had already been playing with the changes to OB/ DP modifiers and earlier DP, and the AI still rarely became Friendly?
     
  19. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,516
    Location:
    israel
    i think so too.
     
  20. LeBashar

    LeBashar Warlord

    Joined:
    Feb 1, 2012
    Messages:
    175
    Location:
    France
    Hello, amazing works, wonderful documentation ! :eek: :thumbsup:

    I haven't read all yet, but I have a (maybe dumb) question : does the AI cope well with xml modifications of units and tech, if I made it, and still be good ?

    I have made a long time ago my own mod on BtS vanilla, with only xml modifications. Now I'm come back a this and found AdvCiv, and I wish merge the two, but this made sense only if the AI can still play well after it, and without for me the need of make anything more than xml because I know nothing :(

    There is no tons of thing in my mod, but the tech tree is nearly totaly redone, all units stats are alterred (but not their roles) and few are news (essentially for filling gap I always found to huge).
     

Share This Page