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. Bestban

    Bestban Chieftain

    Joined:
    Oct 13, 2019
    Messages:
    18
    Gender:
    Male
    Done per request
    Yes, I do hope this not needed, as an additional factor to consider against AI. There are no obvious in-game strategies to prevent AI coming to cancel resource deals.

    ADDED: For the rest of the game I play so far, after Bismark's cancellation, I did not see the same cancel-accept on the same popup. AI won't accept for the same deals immediately. Bismark's cancel&accept may be just one-off somehow.
     

    Attached Files:

    Last edited: Nov 9, 2019
  2. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    527
    Location:
    Germany
    :cringe: That will have to be fixed somehow.
    Doesn't sound like something that would happen repeatedly within a few turns. Though of course there could be more than one coding error.
    Or just something about air bombardment – considering that no OOS errors occurred until the late game. On-screen messages shouldn't normally interfere with the synchronized game state. By the way, I've recently (for v0.97) removed the delay from bombardment messages.
    If you don't have any logs, then it sounds like some problem with the (Steam) installation or OS permissions. As far as I can tell, RandLog = 1 and MessageLog = 1 in My Games\Beyond the Sword\CivilizationIV.ini should enable MPLog.txt and OOSLog. (Or if a custom .ini file is loaded through a Civ4BeyondSword.exe shortcut, then the logging setting in that .ini file count.)
    I guess I won't even need a debugger to generate the logs. But I'd need a save that will (or at least might randomly) go OOS if I take a particular action. Otherwise, I'd better set up a MP game state myself with a lot of aircraft through Auto Play and WB. I'll have to do some multiplayer tests at some point in any case.
    Some obviously uninteresting offers in the late game are Open Borders and dead-end techs. I'm aware of those, it's just a matter of getting around to fixing it.
    The Gandhi leader-head has some resemblance with E.T. now that you mention it.
    When you conquer a city that has been spreading culture for hundreds of turns and none of your own cities are nearby, then you start with 0 tile culture against several thousand. (The UI doesn't show the absolute tile culture values; only percentages.) In BtS, this means that most of the tiles will never flip unless you conquer more cities. I've added a tile culture decay rate to make it easier to flip tiles after conquest. Decay is faster on tiles that a civ can't work. So, normally, some tiles should flip after a few dozen turns, or earlier if you manage to generate some city culture (e.g. Theater, which also allows an Artist specialist); which is, admittedly, difficult if the city is completely engulfed. Also, if the surrounding cities have high culture levels, you may just never catch up. So, from your description, it might work as intended. The decay rate can be adjusted through XML (GlobalDefines_advc.xml: TILE_CULTURE_DECAY_PER_MILL, CITY_RADIUS_DECAY; and there's the OWN_EXCLUSIVE_RADIUS option).
    Thanks for all the feedback. Further testing – nothing specific comes to mind. If you play multiplayer with Realism Invictus or Dune Wars as you had mentioned elsewhere, I'll also be curious to know how it goes.
     
  3. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    527
    Location:
    Germany
    Thanks a lot. I think I got it (Git commit). Wrong sign of the iChange variable in one expression. This had lead the AI to evaluate the resource from the human point of view, which it should only do for the corporation value or when knowing a sufficient number of human cities.
    I think the error occurred because Bismarck knew only 2 of your 5 cities; that's rather unusual.
    I've attached an updated DLL; just in case that you want to continue testing the trade behavior.
     

    Attached Files:

  4. Bestban

    Bestban Chieftain

    Joined:
    Oct 13, 2019
    Messages:
    18
    Gender:
    Male
    Nice! :) I'll try it out for sure. Unrelated to your fix I saw from opening the commit; it is entertaining to see an inline comment below, in a very good way :cool::
     
  5. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,520
    Location:
    israel
    hey man,

    yes, i thought bout that, probably steam is interfering.

    in regards to the other notes you wrote,
    since i have a none steam version as well, i will try to get some logs from the save games i did during and before the oos.
    on my next mp session ill cook up some good info for you.

    i took a short break from updating civ,so i havent seen the recent merges you did.
    where have you disabled these? in the kmissions part where the gettime() thing?


    actually, the ai didnt bug us with offers, and most of the deals were reasonable i enjoyed that part of ai diplo quite much.
    although, i did notice that the ai rarely rarely offered to trade resources.

    defensive pact,decisions regarding other ai's, were never available. always red. im thinking of changing ai attitude threshold for these to be allowed, like on cautious and lower,
    i find that these add some diplo value to the game, otherwise, most of the game, these diplo options , wont come to pass.

    :nuke::scan:


    culture -
    i like what i saw, after conquer and what you described, i mentioned it as a part i enjoyed :)

    my friend, which playing in this mp game , was the first game for him to civ ever.
    so he wanted to also experience a sci fi mod, so im going with dune .
    i also wonder how will it be, i read that the revival is mp compatible, but the whole mod is based off on REVDCM, which had its issues...
    so i fear a bit, but, worth a try. i would prefer though to try my new doto and ranged bombard + many recent fixes from you :)
     
  6. Cruiser76

    Cruiser76 Chieftain

    Joined:
    Feb 4, 2018
    Messages:
    50
    Gender:
    Male
    Potential bug: I've noticed that when tinkering with the terrain and feature passable techs that a terrain passable tech overrides a feature passable tech. For example, in the unitinfo file, if you make desert and jungle impassable for a warrior, but give different passable techs, the desert passable tech will control.

    Edit: After testing in the game, it appears that only the civilopedia information is wrong. The mechanics work as designed in the game, but the civilopedia info for the unit is wrong. It might also be helpful if the in game tooltip showed what tech makes the terrain or feature passable. As of now, there is no information given in the interface for what unlocks the terrain or feature.
     
    Last edited: Nov 12, 2019
  7. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    715
    I think the passable tech thing is this bug.
     
  8. Bestban

    Bestban Chieftain

    Joined:
    Oct 13, 2019
    Messages:
    18
    Gender:
    Male
    Not sure if this one is the same issue. The green-color -25% should be red-color under the defending Lion?
     

    Attached Files:

  9. Elkad

    Elkad Emperor

    Joined:
    Mar 26, 2007
    Messages:
    1,009
    I'm not really happy with the perpetual city revolt on a captured city as implemented.
    Until you get to infantry, it takes a huge pile of units to keep a city at 0%. Then it suddenly only takes 2-3.
     
  10. Cruiser76

    Cruiser76 Chieftain

    Joined:
    Feb 4, 2018
    Messages:
    50
    Gender:
    Male
    Yeah, I’ve noticed similar issues when modding feature and terrain attack bonuses. It doesn’t show up right in the game.
     
  11. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    527
    Location:
    Germany
    Back from a short break. Thanks, everyone, for the bug reports and suggestions.

    Or the Steam logs folder is ... somewhere else.
    kMission - I guess that's a delay for bombardment animations. The delay for on-screen messages comes from the bForce parameter of addMessage. Here's the commit.
    In my games, I usually make all the resource trades I can whenever the resource trade alert triggers, so I don't really give the AI a chance to propose resource trades. That's something I should test someday. Perhaps by disabling AI-AI resource trades through the DLL, running a game on AI Auto Play for some time and then end my turn a few times to see if the AI will propose any resource trades. In theory, it should – the per-turn probability (assuming that the AI can find a legal and resonable trade) is, personality-based, between 5% and 50% (Civ4LeaderHeadInfos.xml).
    "Pleased" isn't normally difficult to reach, but most leaders actually require "Friendly". The attitude needs to be strictly better than the threshold in LeaderHead XML. While having extra rewards for "Friendly" (which is much harder to reach than "Pleased") is nice, some of the thresholds should probably be lowered. I've already lowered Bismarck. Octavian (Augustus) also wasn't averse to joining arms with his rivals. There are probably others where a good argument could be made for a lower threshold on historical grounds.
    Or you could just change the '<=' in CvTeamAI::AI_defensivePactTrade to '<'.
    There is currently no AI evaluation of defensive pacts though. Sooner or later, the AI will sign all pacts that satisfy the (mutual) attitude conditions.
    That should be it. It's among the bugfixes that I already merged over the last few weeks. I'm through with ~30% of the MNAI commits I had bookmarked.
    Civilopedia shows it and the tech tree also does (not for Warrior though). I hope the new-tech splash screen also shows it; forgot to check. A good time to show it might be when hovering for movement over an invalid tile. Or where would you show it?
    I think I merely lost a minus sign somewhere along the way, i.e. it should be +25% in green, which is also what BtS does. The modifier gets subtracted from the defender strength, but that's true for all the non-generic strength bonuses (screenshot attached).
    In a quick test, I see a Forest Attack bonus in green on the attacker's side. That seems to be consistent with the other non-generic bonuses.
    I haven't noticed such a stark difference. It's intentional on my part that revolts become easier to suppress in the late game when there isn't much time left for conquered cities to amortize. With respect to game balance, I see revolts mostly as a means of slowing down wars of conquest in the early game and midgame, or to encourage opportunistic wars with limited objectives. Moving units around to suppress revolts is a bit fiddly, so I think it also makes sense from a usability perspective to dial that down toward the late game when micromanagement becomes really tedious overall. That being said, the exact numbers may well be off.

    The garrison strength value is currently computed from the iCultureGarrison values in Civ4UnitInfos.xml, for example Infantry 10, Rifleman 8, Warrior 3. These values increase too slowly over the course of the game in my estimation, so I'm taking them to the power of 1.4 in the DLL (and times a normalization factor). Then I'm taking the sum of the per-unit values to the power of 1.2 in the end. Perhaps that last step is the problem. My goal was that a "large" garrison should result in a 0% revolt chance regardless of how large exactly. I'm not sure if exponentiation really helps with this. And revolt chance being (linearly) proportional to garrison strength would make matters easier for players: doubling the number of Riflemen in a city would halve the revolt probability. Better yet for usability, garrison strength should be proportional to combat strength, i.e. I'd like to get rid of the iCultureStrength values. iCultureStrength raised to the power of 1.4 is almost proportional to combat strength anyway.

    At some point, I'd like to make the "fear for our safety" anger dependent on the defensive strength of the garrison – defensive strength meaning combat strength with defensive modifiers (e.g. Archer, Walls). Ideally, the same strength formula could be used for both fear-for-safety anger and revolt suppression.
     

    Attached Files:

  12. Cruiser76

    Cruiser76 Chieftain

    Joined:
    Feb 4, 2018
    Messages:
    50
    Gender:
    Male
    Yes, the hovering point would be the best. I don’t see it on tech tree, but it is listed in civilopedia. I don’t think it’s worth cluttering up the tech tree.

    Sorry on the forest attack issue. I looked again and you are right. I got confused by how it was portrayed as a bonus for the attacked unit.

    I like how revolts and suppression work. Yes, it is annoying sometimes, but I think it is realistic and slows down invasions. This lets the AI build up defenses as the invading party has to divide up its stack to suppress revolts.

    One other thing I wanted to mention. I’ve run hundreds of AI tests for my own mod mod. The AI has two major issues at game start. The first is that its initial tech choice is usually bad. It is basic strategy to choose initial techs based on starting food resources. However, and for example, I see time after time the AI choosing something like mining when it has 2 cow resources. I understand having some flavor, but initial tech choice should almost always be based on starting food resources.

    The other major issue is that some AI refuse to expand. They will build a settler, but just let it sit inside the initial city. They will wait way too long before settling the second city. This doesn’t make any sense and sets them back.
     
  13. Elkad

    Elkad Emperor

    Joined:
    Mar 26, 2007
    Messages:
    1,009
    That would be much better. My CG-promoted troops trailing behind my stack would pile into the city. As I pop borders, whip in walls, and they gather fortify bonuses, the amount I need to keep the city suppressed would fall off quickly. Ownership of Chicken-rock-pile would even help. A CG3 longbow would be better at suppressing a revolt than a knight, so my knights can continue the offensive. And in a few turns, half my longbows can leave as well, to go on to the next new conquest.

    It would also help if there was an easier method to determine revolt chance than moving part of your units a tile and then re-hovering. Maybe more info on the revolt hover? "base revolt 4%, -7.27% = 0%" would tell me I could remove a third of the units (assuming equal strength) before I got to the fine tuning. Granted I'm starting to get a feel for it, but my default rule in Medieval is "8 longbows, then try taking some out one at a time"

    And how does the GG revolt reduction (leadership) work? Does it halve the base chance? Double the strength of all the units in the tile for the calculation? Give just the GG a str bonus?
     
  14. Bestban

    Bestban Chieftain

    Joined:
    Oct 13, 2019
    Messages:
    18
    Gender:
    Male
    I second on this. Also, In a few games, I found a losing AI never offered peace to me. AI lost several cities and military powers were down to half or lower, compared to mine. For the same games, peace was reached between other warring AI's, with something of tech offer as settlement. Frequently this was just for losing one city of AI to another AI. Maybe this is AI's personality I'm unfamiliar with, e.g. Asoka of India or Pericles of Greek, or other factors. Hopefully AI would show up at door for more positive requests, at least comparable with other AI to AI interactions.
     
  15. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    527
    Location:
    Germany
    I meant e.g. when hovering over the Workboat icon within the Sailing tech box. There's no icon at Astronomy saying "Workboat can now enter Ocean," and I agree that this would clutter up the tech tree. OK, I'll see what I can do about the movement hover. Should arguably also show an explanation in some other situations, namely when a move is illegal because the damage limit is exceeded and, possibly, when trying to move into borders that can't be entered without declaring war.
    I think I see you mean. Will have to get back to you on that tomorrow. (I told Leoreth the same thing a few weeks ago. Sorry. I had meant to.)
    I don't think I've ever noticed that. I've just looked at another game and all AI civs promptly moved their second Settlers. There should be no lack of planned city sites early on. AI city sites are shown in Debug mode when yield icons are enabled. (One may have to enter a city screen after enabling yield icons to make the game draw the circles.) So I would guess that the AI lacks an escort if it doesn't move its Settler. In my test game (Prince difficulty, i.e. same free units as the human player), the AI had two units in its capital when the Settler was completed and then one accompanied the Settler. I guess the AI civs also had a third unit for scouting, so they must have trained two military units before the Settler (I should've paid more attention to that).
     
    Leoreth likes this.
  16. Elkad

    Elkad Emperor

    Joined:
    Mar 26, 2007
    Messages:
    1,009
    There an easy way to change aircraft manufacturing back to the old way (where excess produced units moved to a nearby city/fort/carrier)?

    Or at least make the build not start if there isn't room?
     
  17. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    527
    Location:
    Germany
    I've checked: The current status is that, when air units are moved into a city, production is immediately interrupted. Apparently, this doesn't work when production finishes on an air unit and another air unit is queued; instead, unless the city owner notices the problem, one turn of production is lost. That shouldn't be too difficult to fix. It's a little strange that production is interrupted even if the unit at the head of the queue takes more than 1 turn to complete. I guess one has to imagine that an aircraft under construction already occupies a hangar or so.

    Disabling the rule change would also be easy. Through another rule change in the mod, "bumped" units have all their movement points spent. That means, one could look at the bumped air units as a move that the game forces the player to make as opposed to some act of magic. It's still confusing when units appear in a city that didn't produce them though, so I tend to prefer the current approach.
    I do want to slow conquests down. I guess I didn't think this through. :think:
    In German, there's the term "Zwingburg" for castles intended to suppress the local population. Nevertheless, Walls being highly effective and efficient against city revolts would seem a bit strange. As for fortify modifiers, I'm not sure if decreasing the revolt chance over the course of 5 turns after the arrival of a unit is desirable; could lead to more busywork.
    I understand that you play on pretty large maps. Do you suppose that's a reason why you'd rather have (much?) lower revolt probabilities in the midgame? You're aware that only cities within their former owner's culture range can flip (and even those not until the third revolt), right?
    Good idea. Some sort of breakdown. Though it's a bit embarassing to communicate these details to the player. The whole system is far from elegant.
    The GG ability halves the final probability I believe. The final step of the CvCity::revoltProbability computation is:
    Code:
    double r = std::max(0.0, (1.0 - (iGarrison / (double)iCityStrength))) *
           getRevoltTestProbability() * occupationFactor;
    'r' (return value) is the revolt probability between 0 and 1. The occupationFactor is my addition; halves the revolt probability when already in revolt and not at war*. (BtS set the revolt probability to 0 in that case.)
    Edit: (*) To clarify: When in revolt and at war with the revolt player, then the revolt probability is still 0 in AdvCiv.

    getRevoltTestProbability returns
    Code:
    std::min(1.0, ((iREVOLT_TEST_PROB * (100 - iBestModifier)) / 100.0)
           / GC.getInfo(GC.getGame().getGameSpeedType()).getVictoryDelayPercent());
    where iBestModifier is the GG modifier and REVOLT_TEST_PROB is set to 15 in GlobalDefinesAlt.xml (a K-Mod change; BtS value was 10).
    Come to think of it, the speed modifier (also from K-Mod) is probably not such a good idea. Producing units for revolt suppression or constructing a Theater does take longer on Epic speed, but the rate of culture spread from cities is the same on all speed settings. So I'm thinking that the Golden Age modifier (125%, 200% on Epic, Marathon; victory delay is 150%, 300%) will strike a better balance.
     
    Last edited: Nov 30, 2019
  18. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    527
    Location:
    Germany
    There are some known issues that can cause the AI to assume that an enemy is distracted by another war; see e.g. this post. It doesn't sound like that's what you're describing though. AI leaders with a high MakePeaceRand value (Civ4LeaderHeadInfos.xml) are reluctant to pay for peace (that value had a different function in BtS), but Asoka's value is actually low and Pericles' medium, and the impact isn't that great anyway.

    When the AI loses very badly, it becomes less willing to give away anything substantial for peace, especially to a human opponent. My thinking is that peace is then unlikely to last much longer than 10 turns. Actually, I'm not sure if this logic applies to AI-AI peace at all; the procedure for hashing out AI-AI peace deals is mostly separate from the one for human-AI peace. So, that's another thing that I should look into. Generally, I don't think peace treaties are worth much, but I agree that there's a big discrepancy between human/ AI that might feel unfair.
     
  19. Elkad

    Elkad Emperor

    Joined:
    Mar 26, 2007
    Messages:
    1,009
    I actually prefer the auto-shuffle of air units. Using their movement points is fine. If I know I need them somewhere specific on the creation turn, I'll have already stripped the air units out of the manufactory anyway, so they'll have movement available. Or I'll use goto to send them there automatically.
    Once I get to airships, one city will probably spend the rest of the game making airships/fighters/jets. I don't want to micromanage it, I just want it to turn out fighters until every city and fort is stuffed full.


    It's just fiddly. Take a city, push a stack of defenders in to garrison it, take the next city (expanding the front), and you can't move your defenders up.
    Otherwise you keep getting revolts. Not only do you lose the production, your borders collapse for the duration of the revolt, all your worker improvements stop (and if they were automated, they immediately run away), etc.
    The fortify bonus would actually help. About the time the city comes out of revolt, you can move some of your units out. That 3-5 turns is what it took you to get to the next target city anyway, so it works out nicely.

    You definitely slowed down conquest/domination. Probably to half-speed or so. And it's worse if you have a dominant lead (even temporary) and you are making a multi-front attack. Take a few cities, and then spend the next 100 turns holding units in them so they don't revolt constantly.
    I don't even delete obsolete units any more, because something always has a revolt chance, so I spend the whole game micromanaging them.

    If culture decayed from a dead civ at a noticeable rate (I don't think it fades at all, but it's sure not enough to notice), that would help. I like the change from it vanishing instantly, but when someone's capital has been pouring out culture for 300 turns, you aren't fixing that anytime soon, even if they are dead.

    I've taken to shoving a pile of spies ahead of my army. They run Spread Culture in every city a few times before I take it. Especially the high-culture cities in the enemy core. That is helping somewhat. But again, another level of micromanagement.
     
    Last edited: Nov 24, 2019
  20. Elkad

    Elkad Emperor

    Joined:
    Mar 26, 2007
    Messages:
    1,009
    well this was unexpected.
    Willem moved his starting settler and settled darn near on top of me on Turn3 (well, T2 for him).

    really.jpg

    Went back to 4kBC and started again a couple times.
    He also settled on the spice forest, and where he is in the following shot.
    His settler and archers start on the dry hill where my scout is currently standing.

    revealed.jpg
     

Share This Page