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

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    651
    Location:
    Germany
    @Leoreth: Oh. I should've re-read your earlier post about this modifier before searching for the source code. You obviously weren't talking about the leader penalty. :blush: Thanks for pointing me to the right place.

    Great, I think I'll merge that and set it to 0 by default through EraInfos. Maybe separate values for human and AI. And see about the information leak later – which may not even bother the relevant players (not sure if it bothers me either).
     
  2. xyx

    xyx Chieftain

    Joined:
    Aug 7, 2013
    Messages:
    34
    I ran some more synthetic tests, by giving each AI the same land (using the mapscript attached) and letting them play 10 times for 150 turns. I recorded the average score (and the standardized score in parenthesis). Bottom line:
    • It's better to have trading partners than being isolated (compare red vs the cluster in the west)
    • It's better to have more than just a single trading partner (compare the one in the middle of the cluster in the west to its neighbors)
    • However, isolation is completely offset by having much uncontested land (see dark blue on the north-east continent)
    • Having to compete with another civ on the same landmass is far worst.
    I think this very much confirms the general gut feeling, so it's probably fair to say that (much land + trading partners) > (much land + isolated) > (less land + trading partners) > (less land + isolated) > (less land + direct competition).

    Now, add some unevenly distributed starting bonuses and I am pretty sure that one can easily create a map leading to replicable runaways.

    Apart from bonus distributions at game start and attempting to optimize civ placement (I concur that this is actually pretty good as it stands), I am unsure whether something can actually be done about it. Warfare simply is a costly matter, as it is to be unable to trade techs or bonuses (and it's obviously a good thing that the Kmod/AdvCiv AI now knows to play out isolated starts).
     

    Attached Files:

    Last edited: Feb 29, 2020
  3. xyx

    xyx Chieftain

    Joined:
    Aug 7, 2013
    Messages:
    34
    Many of the flavors actually kill the AI. That said, I feel that the AI in AdvCiv makes much more sensible decisions concerning religions and is generally much less eager to found one (compared to BTS or KMod).

    On this note a minor (and rather unimportant) bug report: I tried to add the xml part of the prophets stuff as a modular mod, but there's an BTS bug messing up the tech-tree when loading modular techs that have orprereqs set (so, basically just add, say, meditation as single tech to a modular mod). According to this post, this is related to loading some xml files to early (in pass 0 I guess), here's a quote of the readme:
    Spoiler :

    Some XML tables are loaded in two passes, and the code did load the second pass data into the wrong records for modular additions. Ever wondered why the tech tree or promotion prerequisites get mucked up if you modularize them? Now you *can* modularize those. The full list of Infos that define a second pass loader method and the values those load is:
    CvTechInfo(OrPreReqs,AndPreReqs), CvPromotionInfo(PromotionPrereq,PromotionPrereqOr1,PromotionPrereqOr2), CvCivilizationInfo(DerivativeCiv), CvImprovementInfo(ImprovementPillage,ImprovementUpgrade), CvProjectInfo(PrereqProjects,AnyonePrereqProject), CvEventInfo(AdditionalEvents,EventTimes,ClearEvents).
    Note Buildings and Units don't need to do that as their perceived self-referencing prerequisites actually refer to the respective "Class", and those are loaded far ahead. Otherwise, this bug may well not have slipped by QA.

    Doesn't sound too difficult to fix, but again, I think this is rather unimportant (who uses modular techs anyway?).
     
  4. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    33,719
    Gender:
    Male
    Location:
    Leblanc
    I've already forgotten mentioning it to you, I assumed you stumbled upon this on your own. I noticed that the advance penalty only applies to players, I probably should try to see what happens if I remove that, but more importantly I wanted to call that out in case you port the code.

    Information leak is probably only important in multiplayer games, where this option is probably not desirable anyway. Alternatively you could also limit the effect to account only for known civilisations - although then the aspect of helping out isolated starts is gone.
     
  5. Kruos

    Kruos Warlord

    Joined:
    Nov 3, 2014
    Messages:
    139
    Hi there! I tried this AI mod last we and had a blast, thanks to the author(s) if they are still here, this mod is a jewel. Is it possible to play multi with it? How to proceed (overwrite the game files with the ones from the mod?)? Thanks for highlights!
     
  6. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,579
    Location:
    israel
    Hi,
    I played a full mp game with version 0.96..
    Just make sure that all players have tge nod in the mod folder.
    No need to delete anything.
     
  7. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    651
    Location:
    Germany
    There's a bit of uncertainty as to whether the mod will work in multiplayer on all platforms. It seems to be working with the two PCs I have at home; apart from that, I've only the report from keldath to go by. If there is a (fundamental) problem, then a message saying that "the game may frequently go out of sync due to floating point calculations" should appear on the main interface at the start of the initial game turn. If that doesn't happen, then it's hopefully fine. I don't think there's ever been a networked multiplayer test with more than two players. I might've tried three instances on the same PC at some point(?). If you do give it a try, I'd be curious to know whether there were technical issues.

    As with (to my knowledge) any mod, each player would have to install (under \Program Files\... or \Steamapps\...) and load the mod, and all installations would have to use the same version of AdvCiv (e.g. 0.96e, the latest on the download page).
     
  8. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    651
    Location:
    Germany
    That's what the DLL normalization code tries to guarantee too. And RI's PlanetGenerator apparently uses the DLL for resource placement, starting locations and normalization. So I'm none the wiser as to why that doesn't work reliably. I've gotten the script to run, but, given the myriad of settings, the maps that you're getting could be completely different from what I'm seeing.
    Seems like a long shot for me to figure out the cause of this through deduction. But if you still have the savegame (which I realize I wouldn't be able to load): Could you tell me the UnitAIType, ActivityType and Mission(AI)Type of the two units involved? (Ctrl key in Debug mode; e.g. "attack", "GUARD_CITY", "HOLD".)

    v0.97 might more or less solve the problem through new code for (detecting and) recovering from loops that involve units switching between selection groups indefinitely. That's where this
    failed assertion came from. (I may have set iMaxUnitUpdateAttempts too low; got a failed assertion there myself that appears to have been a false positive.)
     
    devolution likes this.
  9. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    651
    Location:
    Germany
    Those tests are about early runaway leaders. A broader concern is whether civs on small continents generally have a better shot at winning the game than civs on large continents. Ideally, to win, a civ should have to do more than conquer its only neighbor and then play it safe. For what it's worth (not much), I've run one full game on your synthetic map, on Emperor difficulty, and got Brennus and Suryavarman on the largest continent. Two similarly warlike leaders with symmetrical starts; difficult for one to get the upper hand, but Brennus managed it eventually, then got quite a bit ahead of everyone else in score, far ahead in power, and, over time, launched invasions against four other continents, always taking a couple of cities, but failing to conquer any capitals (and often also failing to hold onto the smaller cities in the long run). It was enough for a Time victory because everyone else had been ravaged to some extent and didn't have enough land for a timely peaceful victory. Nice game for testing colonial vassals; Brennus created three of them.
    Maintaing a military at peacetime is costly, but actual warfare should, in principle, only happen when it's advantageous for one side. Some reasons why this principle often doesn't apply:
    * The AI tries to go after disliked civs (especially the worst enemy) even when the cost of war will likely outweigh the benfits.
    * Some AI leaders try to win military victories for no rational reason although a Space victory (after some conquests) is probably often the safer route.
    * War preparations arguably tend to be a bit shorter than the optimal duration. (Because I don't want the stakes to get too high.)
    * It can be rational to start a war that is unlikely to accomplish much when the attacker is almost certain not to win the game peacefully.
    There are good reasons for these behaviors, but they could be tweaked, maybe.

    For the special problem of a civ that is initially isolated apart from coastal water connections: I'd like to revise the trade route assignment algorithm and the modifier formulas in a way that favors trade between any coastal cities. Trade between continents should be extra rewarding, but not too much so. (And a tech diffusion system that takes into account distances would also help.)

    K-Mod has indeed already put a break on early religions:
    Code:
    if (!bNeighbouringReligions)
    {
        iReligionValue += 20;
        if (AI_getFlavorValue(FLAVOR_RELIGION) > 0)
            iReligionValue += 28 + 4 * AI_getFlavorValue(FLAVOR_RELIGION);
        if (GC.getGame().getElapsedGameTurns() >=
            32 * GC.getInfo(GC.getGame().getGameSpeedType()).getResearchPercent() / 100)
        {
            iReligionValue += 60;
        }
        if (AI_atVictoryStage(AI_VICTORY_CULTURE1))
            iReligionValue += 84;
    }
    (That's not the entire religion tech evaluation.) Nevertheless, for example in the Brennus game, Montezuma founded Buddhism on turn 27 and founded his second city only on turn 37. I mention the city because the first (small) benefit of a religion is that it can pop the borders of the second city – by getting founded there or, maybe, through a Missionary. Extra happiness in the capital also isn't going to matter before founding another city.
    That's an interesting old mod. I think I've managed to isolate the relevant XML loading code (Git commit); haven't tested it though. I've avoided the "Incremental Modular XML loading" changes, not only to avoid breaking something, but also because it adds more clutter to the XML loading code. Most of the other bugfixes in the mod were included in the unofficial patch, but some of them I fixed myself not too long ago. Kind of crazy that rheinig had already done that 10 years earlier.
     
  10. Cruiser76

    Cruiser76 Chieftain

    Joined:
    Feb 4, 2018
    Messages:
    71
    Gender:
    Male
    Both are: attack, MISSIONAI_DEFEND, AWAKE

    Btw, if you don't mind, what would be an easy way to delay global warming? Global warming is starting to occur 50 - 100 years too early in my mod, probably because of the inflated hammers versus vanilla.
     
  11. Kruos

    Kruos Warlord

    Joined:
    Nov 3, 2014
    Messages:
    139
    Just to let you know : we just finished a two hours cession without any problems (3 human players on a large map with 6 AIs. All with 0.96e). ;)
     
  12. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    33,719
    Gender:
    Male
    Location:
    Leblanc
    Sounds like the age old utilitarian AI vs. "role playing" AI dichotomy. If you're ever tinkering with this again but don't wanna upset the balance between those two, maybe another option ("calculating AI"?) could be an idea? (Ah, options. The best friend of the indecisive programmer.)

    I haven't looked into your code but judging from the manual this seems to be mostly a question of how strictly utilitarian and opinion based war utility factors are weighted, with the option the former could be emphasised more for players who want the AI to be a little more cutthroat about competing. I could even imagine to shift this weighting progressively with higher difficulty settings, to me at least difficulty arising because the AI is less compromising in attempting to get the maximum benefit and less amenable to good relations is more compelling than simple numerical AI advantages.
     
  13. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    651
    Location:
    Germany
    Thanks; I've made a note.
    I'm not sure if this is specific to your mod. Earlier comments in that vein:
    Spoiler :
    To finally follow up/through on that:
    Code:
    (pCity->totalBadBuildingHealth() * iBuildingWeight)
    + (pCity->getBonusBadHealth() * iBonusWeight)
    + (pCity->getPowerBadHealth() * iPowerWeight)
    - (pCity->unhealthyPopulation() * iPopWeight);
    ... seems to be the gist of it. No check for technologies.
    Increasing
    Code:
    <!-- global warming threshold is # land plots * resistance. -->
       <Define>
           <DefineName>GLOBAL_WARMING_RESISTANCE</DefineName>
           <iDefineIntVal>9</iDefineIntVal>
       </Define>
    should delay GW.

    Thanks also @Kruos. I'll quote you on that in the initial post (I have a sentence in there somewhere about the current status of multiplayer compatibility). Well, I'll wait a bit just in case; sounds like there'll will be further sessions.

    So long as it's not "pick your poison" as with Tech Trading vs. No Tech Trading. I've seen mods with a "Ruthless AI" option. I do have an XML file where the aspects of the war utility computation can be weighted: AI_Variables_GlobalDefines.xml#L17 There's also a parameter that moves all the personality values in Civ4LeaderHeadInfos.xml toward their median (#L203). That was intended for testing how rational the AI really acts when the role-playing elements are disabled. Predictably, I never really got around to such tests.

    It's a bit much of a hassle to read through the comments in that XML file to figure out which weights are role-playing/ utilitarian. So having some form of presets could have merit. That said, players of this mod haven't really clamored for such options; requests have focused on things that the AI is just generally bad at, such as early naval war on watery maps, nuclear war or the AI being unwilling to make peace despite losing badly (that should be less of an issue in v0.97). Also, someone would have to experiment with the weights in order to find a configuration that plays well and differs noticeably from the default. (Well, as you wrote: if I'm ever tinkering with it again ...) I see some leeway for making AI attitude less decisive without making diplomacy unimportant. At some point, the behavior might differ too much from BtS though to be the default on the higher difficulty levels.
     
    Leoreth likes this.
  14. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,579
    Location:
    israel
    thats wonderful.

    i always liked that option in revDcm mod (its origin).
     
  15. Kruos

    Kruos Warlord

    Joined:
    Nov 3, 2014
    Messages:
    139
    Yes, there will be further sessions, I will give you some feedback for sure. ;)

    EDIT: I noticed that with the mod loaded there are no musics played in game. I guess it's a matter of xml/folder config or things like that, could someone guide me to reactivate music play ingame?
     
    Last edited: Mar 5, 2020
  16. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    651
    Location:
    Germany
    Hadn't noticed your edit. I can't easily check with v0.96e right now. I normally play without sound, but I like to think that I've tested it before uploading v0.96, and it also works in my development build if I enable it on the Audio tab of the options menu. (The mod isn't supposed to disable it there by default or anything.) Still, it's conceivable that there is some problem I can't reproduce or only in multiplayer mode. What about your human opponents; also no music? Otherwise – it's possible to disable it by accident through Ctrl+M ...
     
  17. Kruos

    Kruos Warlord

    Joined:
    Nov 3, 2014
    Messages:
    139
    Yes, my friends had no music with the mod loaded too. We tried to find the music option (thinking it was disabling by default) but it was not this. There is something weird with the music.
     
  18. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    651
    Location:
    Germany
    I've tried a Direct IP connection game with three instances of AdvCiv 0.69e running on the same PC. No problems with music. I can't test a LAN game. Also no music (no sound at all?) in single-player?
     
  19. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    651
    Location:
    Germany
    I've implemented, based on Leoreth's code, an XML option for rubber-banding research rates:
    https://github.com/f1rpo/AdvCiv/com...e87df3d#diff-4ea5d953b4eec7480cb6d4c3d7cf1bc5
    Without the TechBackwardsBonus (catch-up) part because I reckon one can get something similar enough out of the BBAI tech diffusion options. For reference:
    --
    I may have misunderstood this bug report. I was thinking of the kind of loop that causes the game to freeze, but I guess the loop actually plays out over several turns. In that case, the v0.97 changes I mentioned will be no help. I could imagine that the two units attempt to move onto the Jungle tile as a group, and that this causes the group to be split, leaving the CB behind. Then the Jaguar decides to regroup, returning to the CB etc. Not sure if this is consistent with your observations. K-Mod's "omniGroup" function compares the number of "impassables" (impassable terrain types plus impassable feature types) before allowing two groups to merge. Unless CB and Jaguar have the same impassable count, I don't see how they could form a group over and over.
     
    Leoreth likes this.
  20. Cruiser76

    Cruiser76 Chieftain

    Joined:
    Feb 4, 2018
    Messages:
    71
    Gender:
    Male
    No, it was the game freezing type.

    Thanks for your help on the GW issue. I increased the number to 14 and it is working more realistically.

    Looking forward to trying the new rubber band mechanism!!
     

Share This Page