1. Firaxis celebrates the "Asian American and Pacific Islander Heritage Month", and offers a give-away of a Civ6 anthology copy (5 in total)! For all the details, please check the thread here. .
    Dismiss Notice

MNAI-U: unofficial build & bugfixes

Discussion in 'More Naval AI Modmod' started by lfgr, May 15, 2019.

  1. LightAcolyte

    LightAcolyte Chieftain

    Joined:
    Aug 4, 2013
    Messages:
    27
    Sure, the glitch as mentioned by MagisterCultuum is:
    This glitch also seems to be why Lucian can appear with this option, but under no other circumstances with Advanced Start (right now the Doviello can't get Lucian at all this way, but I did test setting iCost to 2 and AdvancedStartCost to various values). The former works seamlessly without any scripting with a slightly delayed start for Lucian, but the latter will not allow Lucian to be built on AdvancedStart without MagisterCultuum's identified glitch.

    As an aside on Advanced Start: the AI should also be disabled from using their World Spells for a grace period I think (minimum 1 turn in all cases). If the AI increase pop. enough for the Calabim to think their world spell is a good plan, but human players didn't do any pop. increases (because due to difficulty they have less points to spend or because there were better ways to spend), this can be especially poor timing. On the other hand, the Luchuirp may be justified to use their World Spell as early as turn 1, but sometimes they will use the spell even before they technically have their cities in place which prevents them from getting the benefits of it (i.e.: Golden Hammers to turn into free Engineer specialists). Sometimes the Doviello also use their World Spell with no units...which creates no Wolf units unsurprisingly.

    I totally agree with that and also that Barbarian gold should not be set to 0. Keep in mind they do pay for unit costs still, so without changing anything on the Animal Units for them, they can be prevented from gaining any gold for upgrades much longer. As for reducing Barbarian research to 0, I'm not sure that's really necessary: but, if the Barbarians also take a city with free Sage/Scientist specialists, it seems weird they get no benefit to me at all on the flip-side. Though, I understand your point that the Barbarians aren't really all supposed to be the same civilization working together. (smile)

    I get the same error with the Khazad.

    This could simply be setting a "Held" or "Immobile" for X turns effect on spawning or using the Lairguardian AI for more than just typically one unit at a time, so that "Lizardman" units do not quickly leave their Ruins. However, 70-80 turns is a crazy number of turns on Quick speed, and really only reasonable on Marathon speed. My personal opinion would be that 10/20/30/40 "Immobile" turns for Quick/Normal/Epic/Marathon would be appropriate for current Lairguardian AI assignment on Ruins, and would help ensure these locations stay defended and last longer into the game. This means the second unit spawned would never do so sooner than turn 12/22/32/42 and the chances of that happening for a Lizardman unit from one Ruins would be infinitesimal...lest three Ruins at once.

    Wow...after thousands of turns across dozens of games on this version, the only time my friends and I have ever got an OOS was when an XML or Python file wasn't matching for something that was invoked during the play session. If you all play from an exact copy of the Assets mod folder under "More Naval AI," I don't know why this would be happening unless one or more of you have changed Assets without using mods under Civ4 or BTS. I have played with some people who made changes to Assets in Civ4 or BTS folders (and not correctly like they should have under separate Mod folders for their customizations), or who have Custom Assets in their My Documents folders, that can cause OOS. To help lfgr out, if you detected any commonalities before OOS or had logging enabled: would you please share it? (smile)
     
    Last edited: Dec 1, 2021
  2. Alekseyev_

    Alekseyev_ Chieftain

    Joined:
    Jul 18, 2014
    Messages:
    59
    Maybe it's a bit much, but consider that sometimes all you will have done (my experience is limited to normal speed) in 20 turns is to have produced 1.5 warriors - who then don't even stand a chance against lizardmen unless standing on forest hills or a city. That's what can lock you in quite seriously if there's several ruins, but even a single one can screw you over with bad combat rng. Not to mention starting with a worker (Calabim AI existence makes anything else a waste if there's one) because you saw no lizards initially.

    Wow, I envy you! We've been playing FFH2 + MNAI for a long time (probably >20 completed games and many more started and abandoned), and not one has been without OOS. As for the installation, we even zipped up and copied over the entire FFH2 (now "More Naval AI") folder in order to have a 1:1 copy. There are no custom modifications to either mod. And sadly, we have zero clue what could cause the OOS, since it seems to appear in completely unrelated circumstances.

    Where to find logs? (Or enable logging if it is off. There are several logging things IIRC but I'm not sure which one would be the correct one.)

    I wasn't even aware of that Custom Assets folder, but I just checked and that folder has a size of 0 bytes with 0 files, so at least one thing to cross out.
     
  3. LightAcolyte

    LightAcolyte Chieftain

    Joined:
    Aug 4, 2013
    Messages:
    27
    No problem, everyone's play experience is different. We always play on Deity in our MP games, so...starting off with anything other than having 2 Warriors or Warrior UU per City to defend against crazy RNG is considered suicide. Since generation of Lizardman units is random each turn, I feel the likelihood of three Ruins appearing and all three generating a second Lizardman unit on turn 2 after a Lairguardian turn 1 and then waiting the 10/20/30/40 "Immobile" turns, should give adequate warning and time for a human player to make an extra Warrior or two. However, I'm not a decision-maker on what goes in the mod, so while I support some change here from the existing mod as I noted, lfgr is still the one you have to convince to both make a change and make it how you'd want. (smile)

    Yes, More Naval AI is delightfully stable for us in multiplayer (ExtraModMod not so much). We play Direct IP games on LAN or virtual LAN mostly...but occasionally PBEM games. What is your multiplayer mode?

    The bigger problem we've found in the past was with other changes to Assets under Civ4 or BTS folders. For instance, I play with custom font/text sizes as I don't see well the standard stuff. We've found having many different changes to the XML files under the other Assets folders of either main executable (i.e.: not under Mods where any changes should be) can lead to OOS issues even when the More Naval AI Mod folders are otherwise entirely identical to each other, but especially for anything that's inherited and not 100% over-written in all related files from the base game (like certain terrain or graphics mods like Blue Marble).

    Here is the testing guide we use to try and figure out what's happening in multiplayer (have to because there's no WorldBuilder access to get a deeper look): https://bitbucket.org/Terkhen/extramodmod/wiki/Testing
     
    Last edited: Dec 1, 2021
    Tielby likes this.
  4. Alekseyev_

    Alekseyev_ Chieftain

    Joined:
    Jul 18, 2014
    Messages:
    59
    Yeah that's a fair point. We don't really enjoy getting wrecked by massive and well-promoted AI stacks a few turns into the game so we play on something easier. Though sadly this often means that the late game AI is a bit weak. The challenge mode setting for increasing difficulty is only intended for SP, right? I think we used it a couple of times and it did change the player difficulty, but not every 50 turns and no idea if it affected the AI. Certainly didn't cause more OOS in these games than in all the others without the option.

    First we used Steam MP, then in hopes of getting less OOS switched to the original, unsupported release (via Steam betas) and now use direct IP.
    Do you think it would be possible for you to zip up your game installation and send it to me so we can both copy it and see if this fixes it? If the OOS stops, then we would know that at least one of the installations must have been broken, and if it doesn't, we know that it lies elsewhere.
    However we only have this amount of OOS with FfH2 sadly. :( Other mods such as BASE (a German mod from civforum.de) or Final Frontier Plus worked just fine with only one OOS every few games, and then instantly and permanently fixed by a simple rejoin.

    This sounds interesting - as far as I know, though, there are no extra mods installed that aren't a full mod that has to be loaded exclusively - and even those we both have the same. It's so strange :(

    Thanks for the link, I'll take a look. Edit: Enabled logs now.
     
    Last edited: Dec 2, 2021
    Tielby likes this.
  5. lfgr

    lfgr Emperor

    Joined:
    Feb 6, 2010
    Messages:
    1,025
    Thanks, fixed.

    I don't think it should, it's not a real building. It should be mentioned mentioned int he Khazad strategy text, though.

    I'll make sure its displayed.

    A gameoption for delayed lair spawning sounds good, I'll put it on the TODOlist. Maybe the best implementation would be to prevent spawning on lairs that already have a defender on them? With @LightAcolyte's suggestion, held units piling up might be a problem.

    Thanks!

    I can see the issue with the Calabim worldspell specifically the Doviello using theirs without units must be a general bug.

    On the OOS errors: I just recently realized that the Dynamic Civ Names options probably break multiplayer (since names are part of the game state). Please check if all players have the same DCN options (it's in the BUG options). I will probably try to simply disable the feature in multiplayer. This also affects EMM.
    Otherwise: I still haven't debugged a single OOS, but if you ever get an OOS that is reproducible, feel free to post a savegame here.
     
    Tielby likes this.
  6. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,446
    Location:
    Kael's head
    I think preventing any spawning on lairs that has a defender would be too much. Since the first unit usually stays there to defend it, that would mean the lairs cease to be any threat to any unit not actually trying to enter the lair. Maybe preventing spawning with more than 2 or 3 would be ok though.

    I'd also like it if lairs spawns were limited by the world and national limits. I thought they already were, but when I tried letting certain unique features spawn heroes I found they were making multiple copies of Badb, various masks of Esus, Barbatos, etc.
     
  7. lfgr

    lfgr Emperor

    Joined:
    Feb 6, 2010
    Messages:
    1,025
    I would only make this case for a grace period, e.g. 30 turns on normal, to delay aggressive lair spawns

    I agree it should check for limits.
     
  8. LightAcolyte

    LightAcolyte Chieftain

    Joined:
    Aug 4, 2013
    Messages:
    27
    Possible...maybe, but I've noticed there are registry changes that can also impact the installation. To that end, I sent you this forum's version of a private message to explain what I'd do to sort out if the installation could be an issue (legal issues of sharing an entire game installation's folder aside)...unless of course lfgr's suggestion completely resolved all your OOS problems already.

    I think setting the first spawn to Lairguardian 100% would help, but preventing additional spawning even early game seems like a big change versus having there be a period of immobilization during the grace period. That said...as for this follow-up:

    With that, I would support preventing additional spawning when there are 3 of that unit type spawned on the lair and lowering the chance to spawn with 2 of that unit type.

    30 turns on Normal seems a bit long even if spawns are not truly immobilized (if I'm understanding correctly your idea)...were this a democracy, I'd vote for 20 or 25 turns on Normal. I think decreasing probability of spawns, while harder to implement perhaps, might be feasible to leave in place beyond a grace period. At least for us, crazy RNG results are part of the "fun" of the "dark fantasy" world that is Fall from Heaven. Our "fun" would not be ruined in the least by having an option that others could use to delay things, though, so no objections here, really. (smile)

    Yes, please! (smile)
     
    Last edited: Dec 6, 2021
  9. Alekseyev_

    Alekseyev_ Chieftain

    Joined:
    Jul 18, 2014
    Messages:
    59
    So we'd been on an older release of MNAI so far, but couldn't update yet due to our old game still going on. Now that it's finished and we installed the last version, there have not been any OOS' in two games. A new experience for us, now we could finish two games already in 2-3 sessions each instead of 10. Very pleasant, very nice.
    But there's one OOS that happened: When mid-game (me Calabim, friend Elohim) I enabled two BUG options, the one to not stop pop growth in new cities and the one to show khazad vault status, we got an instant OOS every turn after. (My friend didn't touch these.) After setting them back to off and loading the autosave of the turn where I had enabled them, there were no further OOS all game.

    I think it would make sense in the top right corner (which is really nice, btw!), next to the "Dwarf" racial promotion. Just display the base vault building there, a player can find all others from its text or the civilopedia listing them below.


    Edit: In the past, before MNAI got its own mod folder, it was possible to play the FfH2 scenarios with it. Now the game asks to load "Fall from Heaven 2" when trying to open them - could you make it so they can be loaded with MNAI again?
     
  10. Deaf Metal

    Deaf Metal Chieftain

    Joined:
    Oct 5, 2015
    Messages:
    46
    It's due to the copy/paste installation method: the unmodified Fall from Heaven II Scenarios worldbuilder file ends up in PrivateMaps. You have to load the modified ones manually from Assets\XML\Scenarios
     
  11. DarkLunaPhantom

    DarkLunaPhantom Prince Supporter

    Joined:
    Feb 4, 2013
    Messages:
    507
    Location:
    Croatia
    I don't know will this work, but you can open ...\PrivateMaps\Fall From Heaven II Scenarios.CivBeyondSwordWBSave file with a text editor and change the line
    Code:
        ModPath=Mods\Fall from Heaven 2
    
    so that it matches your mod folder name.
     
  12. Alekseyev_

    Alekseyev_ Chieftain

    Joined:
    Jul 18, 2014
    Messages:
    59
    That worked, thanks. :)

    I have two more questions regarding the AI:

    1. On the vanilla Erebus map, players will often be locked away from another due to mountain chains spanning all the way to the coast. The AIs know to use boats to land other continents, but I think they don't know that a naval invasion can be necessary even when technically being on the same land mass, when there's no actual land path to the target. Was this ever looked at?

    Actually expanding on this, can AI learn to unload units in neutral/friendly territory and then march them to a landlocked enemy? I just had a game where I controlled all the coast either through my own cities or those of my vassals. Calabim declared war on the Luchuirp/Mercurian team, which did not have a single port town or even culture tile on water. I had open borders with Calabim, but they never tried to send any units to their enemies. (That the Luchuirp/Mercurians wouldn't have tried to attack the Calabim makes sense, since they can't even build any ships of their own without any seaside cities.)

    2. Do Illians ever go for Ascension? I don't think I've ever seen an AI complete the Draw, but maybe the circumstances were just never right. (I personally wouldn't go for it in vanilla FfH2/MNAI because Auric Ascended is underpowered in direct combat (and therefore easily lost against a smart human opponent that knows how to abuse stuff like mass suicide horse archers with some combination of drill/mobility/commando as soon as Auric is out of position for a moment - who even needs the Godslayer) and the Draw ruins your game, but it would be nice to see the AI do it at times.)
     
    LightAcolyte and Tielby like this.
  13. LightAcolyte

    LightAcolyte Chieftain

    Joined:
    Aug 4, 2013
    Messages:
    27
    Found (and fixed for me anyway) a bug: the Dungeon event is bugged because the Dungeon improvement in ImprovementInfos is set to bOutsideBorders only (i.e.: 1). Therefore, since this event only triggers inside your borders on an owned plot, the first option can never be selected, because you cannot build the dungeon until this boolean is set to 0 instead of 1. While no changes are needed to EventInfos or EventTriggerInfos, I'll also note here now that the OrTechPrereq is not actually doing anything...no one needs Cartography tech. for this even to trigger so might as well take out the extra line of code for it. However, if the intent was that you at least want someone to have it, you could set this to another player/AI having the tech. as prereq. for the event to trigger instead.

    Also, in relation to Alekseyev's above point #2: I also have noticed that the Illians never go for Auric Ulvin's Day Off...err Out....that is to say, the Draw and Ascension. Furthermore, they don't go for Celestial Compass either, which would greatly assist them in this regard...granted they have little other advantage with respect to the oceans.
     
  14. lfgr

    lfgr Emperor

    Joined:
    Feb 6, 2010
    Messages:
    1,025
    Thanks for your input. I know there is already some grace period for barbarian spawns, maybe I can work off that.

    Thanks. The Khazad display option should be fine, but I can see how the growth toggle will cause an OOS. I'll have to disable that feature for multiplayer for now.

    I will make note of the AI problems you noted, but don't expect any solutions anytime soon.

    For me it works exactly as intended (event only triggers if I have cartography, option can be selected if I have enough money). Not sure what is happening on your end.
     
  15. Alekseyev_

    Alekseyev_ Chieftain

    Joined:
    Jul 18, 2014
    Messages:
    59
    Thanks, and no worries! :) Have some happy holidays! :xmascheers:
     
    lfgr likes this.
  16. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,446
    Location:
    Kael's head
    When using the assert DLL in my modmod I am getting a crash to desktop whenever I try to use worldbuilder to grant a city any of the religious shrines that are normally constructed by a great person in a holy city.

    Adding the wonders I let found religions does not cause any problem. It does not seem to cause any issue with the non assert DLL.

    I'm not finding the same problem in base MNAI, so I'm really not sure what is going on.



    The aggressive declarations of war are getting very irritating. Is there any ETA on when you might have an update ready that dials things back?


    Is there a version of the DLL course code that can be easily searched?
    I often use Notepad++'s "Find in Files" function to search C:\Users\...\Documents\My Games\Civ\CvGameCoreDLL041o\CvGameCoreDLL.041o for specific parameters, functions etc., but as the files are getting further and further away from what you actually use I'd rather have an up to date MNAI source code that could be so easily searched.
     
  17. LightAcolyte

    LightAcolyte Chieftain

    Joined:
    Aug 4, 2013
    Messages:
    27
    No problem, and as for the event noted, I can't say why it works for you. My friend was able to replicate it on a fresh install of MNAI-U 2.9 on his laptop. I know when I changed the mentioned boolean the event worked correctly all of the sudden, and that the OrTechPrereq was not doing a thing for whether the event triggered or not. If I go back and manually trigger the event using WorldBuilder it works as intended, but if I encounter the event "organically" by raising its Weight it performs as I indicated. I tested with the Calabim on MNAI-U v.2.9 again myself today. Hope the new year is off to a great start for you!
     
  18. lfgr

    lfgr Emperor

    Joined:
    Feb 6, 2010
    Messages:
    1,025
    Sorry for the late reply, I have been busy.

    Is there any fancy python stuff you do when the shrine is built? If yes, maybe try disabling that. Otherwise, could you post the relevant code?

    No ETA, sorry. There's quite a few bugs that need to be fixed. It almost certainly won't be ready by February. Also, to make that clear, the only thing I'm planning right now with regard to AI aggression is to externalize some of Tholal's changes to the new Ruthless AI option. This might fix the problem, but I don't really have an explanation why it got worse for you only recently.

    You can download the whole code for a release, including the DLL sources, on this page.

    All right, I'll try again with a fresh install. To be clear, you claim that:
    • the event triggers without you having carthography, and
    • when it triggers, you cannot select the first option, even though you have enough money.
     
  19. LightAcolyte

    LightAcolyte Chieftain

    Joined:
    Aug 4, 2013
    Messages:
    27
    First one: MNAI-U v.2.9 base doesn't have the OrTechPrereq at all so that's not actually relevant to the bug I was reporting on this modmod: which is that the Dungeon can't be built (i.e.: can't select the first option). The second comment I made after talking about no one else needs to have Cartography for this to trigger is talking about flavor text, as this guy is coming up to you and selling a map he found years ago...but no one other than all the people you control as their leader even make maps yet without the tech...so to me it seems OtherPlayerHasTech being set would make more sense. Maybe the Age of Ice wasn't all that long and somehow a parchment map was preserved a really long time from some past Age or something...but in that case, I have no idea why Cartography would need to be a prerequisite for anyone at all so it just doesn't make sense to me. You could imply Cartography is giving the player instead the ability to read maps for that event to be useful, but that also does not make sense really, as anyone with Cartography can still give you or trade you maps and you still can make a map of the world (which is described in game as "your maps") even if you don't have Cartography and reveal the map all the way around the world horizontally with a Griffon or Naval Unit.

    Second one: Yes, this is the bug. Here is a test save I just did. Here's what I did to get this:
    1. Fresh Install of FFH2 then MNAI-U v.2.9.
    2. Copy MNAI-U v.2.9 and edit EventTriggerInfos.xml to Change iWeight for the Dungeon event to -1 or an extremely high number.
    4. Start a new game (civ doesn't matter but Hippus was chosen at random this game).
    5. Build a city with the Settler, set Gold to 30, and set City culture to Legendary to test out effect on different tiles...confirmed tile doesn't matter multiple times, none of them will allow you to build a Dungeon regardless of what's there or not, and only tiles within your borders are selected. You will not be able to select the first option.
    6. After witnessing the bug, exit the game, edit ImprovementInfos.xml for Dungeon to set bOutsideBorders to 0 instead of 1.
    7. Reload game and witness the event now works and you can build a Dungeon.
     
    Last edited: Jan 16, 2022
  20. omegaflames

    omegaflames Warlord

    Joined:
    Sep 21, 2012
    Messages:
    175
    Someone out there is either a seriously troubled prankster or absolutely bonkers. In at least CvPlayerAI.cpp and CvTeamAI.cpp there are at least 2 places where an if statement checks to see if 1 is less than 2. Seriously it's written like this
    Code:
        if (1 < 2)
        {
            if (GET_TEAM(getTeam()).getAnyWarPlanCount(true) > 0)
            {
                return DENIAL_NO_GAIN;
            }
        }
     
    Tielby and DarkLunaPhantom like this.

Share This Page