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:
    511
    Location:
    Germany
    If I do that (as in the attached screenshot), I can load the mod without any errors.

    You could try it with an assert build (DLL attached); maybe that shows some error message. (Assuming that you've upgraded to v0.96.)

    I suppose if you make the same change in the original (BtS) files, there is no crash?

    Edit:
    Is there an error message in the xml.log?
     

    Attached Files:

  2. Cruiser76

    Cruiser76 Chieftain

    Joined:
    Feb 4, 2018
    Messages:
    47
    Gender:
    Male
    Hi f1rpro! I just got around to importing my personal mod into your latest version. I was using a very old version, so it took awhile and I've been tracking down a lot of issues.

    It appears you removed map size as part of the tech cost formula? Can you confirm this? I play huge maps with a relatively low number of civs, so the map size adjustment helps keep the global tech rate in line. More land, more tech. This is not a big deal because I can adjust other factors to compensate, but I wanted to make sure it wasn't a bug on my end.

    Also, I am having a very strange problem of the "Fortify Until Healed" button on the main screen not appearing when a unit is damaged. This is with my mod-mod, so I understand if this doesn't raise any issues with you.

    Thanks, enjoying the changes!

    Edit: Also noticed the promotion button doesn't work when a unit is damaged. Like I said, I am using a mod-mod, but I didn't change anything with this type of stuff.
     
    Last edited: Aug 9, 2019
  3. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    511
    Location:
    Germany
    I hope I haven't made that unnecessarily difficult – I think I might have with some of the XML tag changes. :dunno:
    I've disabled it only for Ancient techs – because there is normally enough room to expand during the Ancient era regardless of the map size. For non-Ancient techs, there is now also a cost modifier based on the sea level. Here's the formula for reference: CvTeam.cpp#L3019
    Fortify-heal outside cities has been working like BULL's Sentry-heal since – I don't know, v0.80? The recent change (id 004l) is that the hover text for the button says "Sentry until Healed" instead of "Fortify until Healed" when outside a city. If there is no heal button at all though, then it's not working as intended.
     
  4. Cruiser76

    Cruiser76 Chieftain

    Joined:
    Feb 4, 2018
    Messages:
    47
    Gender:
    Male
    That's ok, but yeah, the xml tags made it a little difficult! I've added lots of stuff :lol: The game seems to run a lot better now when I do AI testing. The performance is noticeably better than prior versions and I'm not seeing the annoying end turn crashes that use to happen a lot.

    Ok, thanks. I've tinkered with some of the settings and have it pretty close to the way I like it.

    Yes, this is where the problem is. If a unit is outside a city, there is no "Fortify until Healed" button and promotions cannot be selected (the hotkey "H" no longer works either).

    If the unit moves into a city, the "Fortify until Healed" button appears, but it looks like one of the buttons used for ships (an arrow following along a coast). A unit can still heal outside the city if the regular "Fortify" button is chosen, but it is confusing and you have to manually check the unit.
     
  5. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    511
    Location:
    Germany
    Jeez ... :eek:
    So in the attached screenshot, I guess all the buttons to the right of (regular) Sentry would be missing? That sounds like a Python crash; anything in the PythonErr.log? And the wrong button in cities is apparently the Sea Patrol button. That mission is right before MISSION_HEAL in Civ4MissionInfos.xml. But correct hover text ... :hmm: Any additions to Civ4MissionInfos.xml on your part? Is MISSION_SENTRY_HEAL present (at the end, after MISSION_MULTI_DESELECT)?
     

    Attached Files:

  6. Cruiser76

    Cruiser76 Chieftain

    Joined:
    Feb 4, 2018
    Messages:
    47
    Gender:
    Male
    Oh, I'm sorry, I didn't mean to cause alarm! That crash bug happened with Kmod too. It would happen about every other game and you had to enter worldbuilder and delete cities/restart, rinse repeat, until you could continue. It may have been the content I added, who knows. The forums show that other people have had this issue too with other mods.

    I found the culprit on the heal issue! I replaced the missioninfo file with the one from your mod and now it works. I had kept my altered file in which I had changed some mission names. Thanks for your help :thumbsup:
     
    f1rpo likes this.
  7. Cruiser76

    Cruiser76 Chieftain

    Joined:
    Feb 4, 2018
    Messages:
    47
    Gender:
    Male
    Hey f1rpo, the "Traits" link in the Civilopedia doesn't work.
     
  8. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    511
    Location:
    Germany
    Confirmed. I broke it in between v0.95 and 0.96 when I excluded graphical-only items from the Civilopedia – traits don't have a graphical-only flag. I'm attaching a bugfix. To be extracted into AdvCiv\Assets\Python\Contrib\Sevopedia.
     

    Attached Files:

  9. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,519
    Location:
    israel
    cool,thanks.
     
  10. Cruiser76

    Cruiser76 Chieftain

    Joined:
    Feb 4, 2018
    Messages:
    47
    Gender:
    Male
    Just wanted to drop another note that the mod is running really well. The performance enhancements are noticeable.

    AI still breaks trades and then reaccepts, but not nearly as much as before. I didn't realize how much time was being wasted with that issue. It is not a bad problem anymore.

    It appears to be harder to get the AI to friendly. I'm playing a game and my highest relation in the 1600s is 8. I usually have at least one friendly by then. Although I'm not sharing a religion, it feels like relations have been toned down. I play on emperor level.
     
  11. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,519
    Location:
    israel
    Cruiser76,
    good to hear,
    please keep posting, i hope to get a game soon also.
     
  12. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    511
    Location:
    Germany
    Thanks, that's encouraging. The trade issue remains on my radar and I have log output now to investigate when it occurs in my own games (which I expect it will once I get around to playing).
    The lack of friendships, also between AI civs, is an open issue. I think it's mainly because bonuses for open borders, shared war and supplied resources are more difficult to attain than in BtS. However, those changes have been in place for a long time. It would be interesting to know which somewhat recent change, if any, has made the AI even more difficult to befriend. :think: Since v0.94, it's significantly harder to max out the fair trade bonus and +3 is probably harder too. (But +1 and +2 should generally be easier to get than before.)

    The Friendly threshold is, effectively, already 1 lower than in BtS (due to the removal of -1 "first impression" on Noble difficulty and above). I'd like to lower it more, but 10 is a much nicer threshold than 9, and, at 9, the symmetry with Furious may have to be broken – the AI already gets Furious quicker than I'd like. Bizarrely, the thresholds are hardcoded in the DLL (I ought to change that). So, since I don't suppose you're using a custom DLL, I can't even recommend adjusting the Friendly threshold. (If all thresholds are too high, then +1 "first impression" through Civ4HandicapInfos.xml could be used as a makeshift measure.)

    I've been meaning to add a new modifier: "+1: The enemy of my enemy is my friend" for being the worst enemy (or a war enemy?) of someone's worst enemy. I don't think that's going to be enough to set the balance straight. There don't seem to be many good reasons to like a player.
     
    Leoreth likes this.
  13. tanish

    tanish Chieftain

    Joined:
    Aug 13, 2019
    Messages:
    2
    I hope this mode will be difficult as "k" was
    I remember being 6x times more advanced than sumeria in points, but they built an army when I was leading (they were the last civ) and they destroyed me with cavalry so what makes "k" crazy good is that u never know who wins until the last turn

    I will gladly endorse any mod based on K. I hope there is an option called "cease bothering us"
    since its useful when there are many leaders, and the code is available too - hint to implement this
    also could u add an option so when u attack = destroy holy city everyone (of that religion) attacks u or makes it highly likely to happen
    I would also like some blood on hit (there was a mod about that) and debris after some skirmish for the "cosmetics" part
     
    Last edited: Aug 13, 2019
  14. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    511
    Location:
    Germany
    "k"razy good :D
    Well, as I was just saying, AdvCiv makes it harder to appease the AI. One criticism of K-Mod that I've heard repeatedly and think has some merit is that the AI's focus on unit production works to the human player's advantage if he or she can stay out of harm's way. Also apart from that, I feel that the considerable gains in overall AI productivity in K-Mod don't translate sufficiently into faster technological progress. So I've throttled AI military production (quite?) a bit. (Caveat about the tech speed: I've removed the hidden 20% research bonus from knowing a single prerequisite tech and increased tech costs on the high difficulty levels, so it boils down to slower human progress rather than faster AI progress.)
    No such option. :( Has been requested (once) before. Do you know how it works exactly in other mods? Is it as if you had agreed to stop trading with the bothersome AI civ? Or does it just suppress trade offers? (For how long?) One concern I have with this option is that the effect would be intransparent. If trade offers are the main issue, then I guess I'd rather have the AI make offers less frequently. I've already made some changes in that vein; e.g. map trade offers should be far less common than in BtS.
    Doing this properly should imo involve checking war utility values to avoid suicidal attacks – though the (possible) simultaneous declarations of war by other civs should also be taken into account. I think there is AI code already to discourage the AI from razing the holy city of a religion with many adherents; that would have to be dialed up. Even if I cut corners on the AI, e.g. by letting the AI never raze holy cities and always declare war if a human player razes one, I'd still need to change the city-acquired popup to warn about the consequences of razing, and the option would have to be documented and maintained. (Not saying that it's a Herculean task ...)

    The more general problem, as I see it, is that cities can be razed by a single surviving attacker in a single turn. That's something I'd like to change (as other mods have already), but it's not very high on my list.

    Perhaps you could just increase the relations penalty for razing a holy city through XML. That's not as dramatic as an immediate declaration of war of course. And it would have to be changed for every AI leader individually, which is simple but tedious to do.
    On graphics, I'm mostly restricting myself to changes that improve usability. For a graphically enhanced version of this mod, someone else would have to put together some optional archive or create a fork/ mod-mod.

    With regard to any proposals, I should also mention that the next release of the mod is probably several months away. I haven't made any major changes yet and, so far, there haven't been any alarming bug reports. Probably I'll just tweak things in order to zero in on a version 1.0.
     
  15. keldath

    keldath LivE LonG AnD PrOsPeR

    Joined:
    Dec 20, 2005
    Messages:
    6,519
    Location:
    israel
    Hey,
    I have not r3ad the whole above yet,

    Cease bother us,
    Exitss in advanced diplonacy mod.
    At some point it was also extracted as a single mod part, though i dont have it.

    I second the addition of it,
    It is great and stops an ai from bugging you with reqeusts sometimes.
     
  16. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    710
    "Cease bothering us" sets a flag such that AI requests are automatically denied. I'm not sure right now if this is reverts after some amount of turns in the original mod, but that could be easily implemented.
    I plan to implement a Diplomacy-Queue modcomp at some point in the future that would have a similar goal, see the second paragraph in this post if you're interested.
     
  17. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    511
    Location:
    Germany
    I see. That seems like a good approach for a mod like BULL that has to keep the AI behavior unchanged. And the rule is easy to understand. One could put a little widget on the scoreboard when an AI has been "muted" (it could even look like the mute icon on an audio player), and allow unmuting through a click. Like the Open Borders indicator, which can be clicked to cancel. Could also have a mute button next to the human player's scoreboard row that shuts everyone up. That would be pretty useful for testing (when testing anything other than AI diplomacy).

    I don't think I'd ever mute an AI player like that in a regular game as I'd always want to be aware of received relations penalties; it's also immersion-breaking. From that angle, I'd prefer something that lasts a certain number of turns, prevents the AI from contacting me and applies only a (decaying) one-time penalty.

    I'm still not sure if AI demands are the main source of irrelevant popups or if it's trade offers. As for the latter, it would be easier to adjust the contact probability – based on attitude, the trade value offered to the human (prefer not to discard big offers) and some estimate of how often the human player is getting contacted – than to merge and revise code from Advanced Diplomacy.
    Sure, that interests me. Also because my plan to move all AI decisions about AI-to-human diplomacy to the start of the human turn would be easier to realize if diplo popups could be created at any time.
    In my experience, beginDiplomacy only inserts the CvDiploParameters object into CvPlayer::m_listDiplomacy, from where the EXE later – at the start of the human turn – fetches it (I think through CvPlayer::getDiplomacy) and creates the diplo popup. But I don't think I've tried calling beginDiplomacy during the human turn. Otherwise, the gDLL calls in CvPlayer::contact might work somehow.
    (Since your latest post in the Magister thread says that you're not really modding currently, I figured there's no point in dredging up the subject of diplo popups in that thread for this brief comment.)
     
  18. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    710
    I actually tried calling beginDiplomacy during the human player's turn after that discussion and it works, i.e. it opens a diplo window if the trade deal is valid (although I only checked vassal trading). So although I'd have to do some more testing, I'm optimistic this can be done. But yeah, it'll take a couple of weeks before I can start working on it.

    That sounds like a much more user-friendly solution than having to go through the diplomacy screen. There should also be a message when auto-declining a trade deal, I don't think Advanced Diplomacy does that currently.

    I think that changing AI behaviour to not contact too often would be the mostly better approach, but I actually think getting the balance right on this would be harder than the alternatives. On the other hand, some players might enjoy diplomacy more than others, so maybe there just isn't a single perfect amount of diplomacy.

    Just out of interest, why do you want to do this? So the AI doesn't act on outdated information?
     
  19. Cruiser76

    Cruiser76 Chieftain

    Joined:
    Feb 4, 2018
    Messages:
    47
    Gender:
    Male
    I actually went through the leaderhead file and changed the bonuses for open borders to range from 2 - 4 and defensive pacts from 2 -4, depending on the close borders penalty and share war bonus. I never liked the concept that you are almost always penalized with your early trade partners because you also share close borders (up to a -4 penalty for close borders!). This arrangement effectively negated most of the open borders bonus for most leaders. I also thought it was ahistorical as many civilizations developed intricate and close relationships despite sharing a territory (see e.g. the Sumerians and Akkadians). I think maintaining open borders and sharing defensive pacts should allow substantial bonuses.

    The system I came up with goes as follows:
    Close Borders/ Open Borders
    -4/ 2
    -3/ 3
    -2/ 4


    Share war/ Defensive pact
    2/ 2
    3/ 2
    4/ 3
    5/ 3
    6/ 4

    I also moved defensive pacts to Monarchy and permanent alliances to Constitution.

    I've been playing with these changes for awhile and I like it. Permanent alliances happen more often, which are fun to me. Just some things to think about.
     
    Last edited: Aug 15, 2019
  20. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    511
    Location:
    Germany
    That's good news. I thought I'd have to sneak calls to CvPlayerAI into the CvPlayer code called by the EXE at turn start.
    Yes, primarily. I also don't like to rely on the EXE for validating offers. For example, the EXE doesn't seem to check at-war status before displaying Defensive Pact offers. Moving the code would fix any such omissions. Also, the AI contact timer isn't reset when the EXE discards an offer; i.e. further contact attempts get delayed by the failed attempts.

    It should be possible to implement this with minimal changes in the AI code. CvPlayerAI::AI_doDiplo already does a separate pass for AI-to-human diplo; just need to add a bHumanDiplo parameter and skip one of the passes based on that parameter.

    One particular problem – introduced by myself – that I'm hoping to solve this way is that, when offering to renegotiate a resource deal, the AI sometimes accepts the same deal as before if it has lost access to another resource in between turns. Though there may also be some inconsistency in my own code that causes the AI to behave this way; I'm not sure to what extent the timing is responsible.
    At the least, I can keep an eye out for popups that don't offer an interesting decision. The pointless deal cancellation popups I mentioned above would be an example. Another obvious case is when the AI keeps peddling some old dead-end tech.
    I reckon that game size is a factor (that can partly be "normalized away"), but that there's also a strong personal preference for faster/ slower play. So I could imagine a dropdown menu within the BUG menu that says "AI players offer trades ... Regularly / Rarely / Never". So long as the frequency can't be increased beyond the standard behavior, it's mostly a UI option – the player forgoes opportunities in favor of fewer popups. Still, can't handle demands and pleas this way.
     

Share This Page