MNAI-U: unofficial build & bugfixes

Remnants of Patria apparently can be attempted to be placed on the same tile as an ancient tower during map generation, so there will be an ancient tower improvement with the event sign Remnants of Patria, but the tile yield will not be modified.
 
Is it intentional for there to be no Assassin unit model in the bottom left when one is selected?
 
In Multiplayer, the Kuriotates' choice when settling a city of "Settlement" or "City" does not appear. While this is fairly easy to rectify by having the escorting unit that should be with the Settler anyway casting "Promote Settlement," the problem is that since unit movement speeds aren't always a match you can lose some turns to do this of city growth.
 
Alright...got a new, totally exciting problem...we can't play Somnium in any version of MNAI-U after 2.7.2. Somnium works in 2.7.2 (and of course in MNAI 2.7.1 which we always used to play in), but in 2.8, 2.8.1 and 2.9 Somnium will not load up at all beyond the screen to choose an opponent. After you attempt to play with AI or against a human in MP the Somnium button and Shift+F7 cease working as well in 2.8 and later. I don't understand what changed to make Somnium not work, but we've never been able to get it to work. I've tried looking at CvEventManager, but can't figure out what changed with diff's to see what is going on with the python. There are no errors, it's just nothing seems to be happening.
Fixed this for the next version, thank you.

The Mirror of Heaven can spawn on a peak.
Remnants of Patria apparently can be attempted to be placed on the same tile as an ancient tower during map generation, so there will be an ancient tower improvement with the event sign Remnants of Patria, but the tile yield will not be modified.
Which mapscript?
 
Is there any reason Acheron doesn't fly ("Can move through impassible terrain")? It certainly does have wings. Drifa does fly.
 
Last edited:
Is there any reason Acheron doesn't fly ("Can move through impassible terrain")? It certainly does have wings. Drifa does fly.
I believe it is because Flying units do not get fortification bonuses that were deemed more useful for Acheron than flight considering he is supposed to stay put in his city.

In my modmod I give a lot of unit a a Winged promotion that lets them toggle Flying off and on depending on whether you would rather have the defensive bonuses or the added movement point and ability to move through all terrains, but base FfH2 does not have that. .
 
Is it intentional that the Fall from Heaven II Scenarios WB Save unloads MNAI back to vanilla Ffh2?
 
Is it intentional that the Fall from Heaven II Scenarios WB Save unloads MNAI back to vanilla Ffh2?
If you use the scenarios linked by the Scenarios screen, the original ones do this automatically. If you use the scenarios to load them from inside the world editor from the More Naval AI Mod included scenarios, they play with the More Naval AI mod.

In other news, when I have Advanced Tactics on, it seems the Great Generals cannot be attached to anyone because the spell for this is not present in this version of the mod. When I add the correct spell into the XML and python, the AI lacks any programming to use Great Generals, so they just sit in their cities. In MP, of course, this gives the human players a decided advantage...while the AI just gets sapped by increasing maintenance costs from accumulated Great Generals. Suggestions on whose version of the AI use of Great Generals I should use from another mod/modmod/version?
 
Last edited:
In other news, when I have Advanced Tactics on, it seems the Great Generals cannot be attached to anyone because the spell for this is not present in this version of the mod. When I add the correct spell into the XML and python, the AI lacks any programming to use Great Generals, so they just sit in their cities. In MP, of course, this gives the human players a decided advantage...while the AI just gets sapped by increasing maintenance costs from accumulated Great Generals. Suggestions on whose version of the AI use of Great Generals I should use from another mod/modmod/version?
It works for me (the spell part, didn't check the AI). Maybe you're confusing Great Generals and Great Commanders? The former are only present with Advanced Tactics on, I think, and work just like in vanilla BtS. The latter cannot lead units by themselves, but other units in the same stack can cast "Join Great Commander", which works about the same. Incidentally, Great Generals can also join Great Commanders, giving you a strength-1 unit; that ought to be fixed.
And yes, it's stupid that there are two types of units for this. ExtraModMod merged the two, but I reverted that change for some reason I don't remember. It's possible that the AI can use Great Generals, but not Great Commanders.
 
The Hidden promotion seems to have no discernible effect. I had a game in which the Sidar AI cast their world spell and all that happened was their warriors gained the promotion but were still as visible as they were before. All I had were warriors, so there was nothing that would reveal them; and they retained the promotion for turns afterward so they hadn't lost it for being involved in combat nor could they have cast any spells. Unfortunately, I don't have the save.

Edit: Their warriors were stacked in their city, is that the reason why?
 
Last edited:
It works for me (the spell part, didn't check the AI). Maybe you're confusing Great Generals and Great Commanders? The former are only present with Advanced Tactics on, I think, and work just like in vanilla BtS. The latter cannot lead units by themselves, but other units in the same stack can cast "Join Great Commander", which works about the same. Incidentally, Great Generals can also join Great Commanders, giving you a strength-1 unit; that ought to be fixed.
And yes, it's stupid that there are two types of units for this. ExtraModMod merged the two, but I reverted that change for some reason I don't remember. It's possible that the AI can use Great Generals, but not Great Commanders.

So in MNAI-2.9 archive version copied and replacing all name-matching files in a copy of an unmodified Fall From Heaven 2 mod installation in Civ4 BTS v.3.19, there is no "Lead Troops as a Warlord" spell/special ability for any unit category or combat type, except on the Great General Unit itself. There is no entry in the Sevopedia for "Lead Troops as a Warlord." The AI is incorrectly programmed to use the spell "Lead Troops as a Warlord" on the unit combat types, which does not happen in standard Civ4 BTS so this behavior is not the same. Even if the unit combat types are removed so that any unit with access to the spell uses it: when there's more than one unit (as there almost always is for the AI in their cities where the Great Generals spawn after enough Great General "XP" is earned from combat with non-Barbarian units), the AI will cancel the spell/ability like with the last option in the menu to "Nevermind" resulting in the Great General never being attached to any units for some reason. In our MP games, the AI cities have at least one Great General unit in one or more cities usually just standing around taking up maintenance. Even if the spell is changed or added to be allowed for the unit combat types to cast themselves when a Great General is present and the spell added to the Sevopedia, the AI is not using it correctly in cities, but will attach a Great General in the field (except that the Great Generals never get out into the field to be attached in the first place).
 
Last edited:
The sidar have two warriors and a settler yet they don't move them for turns and don't found a city till around turn 12.
 

Attachments

  • MNAI 1.CivBeyondSwordSave
    138.6 KB · Views: 10
Thanks for doing the research. Then this will be hard to fix. I will take a look at the barb AI code at some point, though. Maybe I could get them to target nearby units if they can't path to a nearby city. For AI players I'm a bit afraid to touch the code and potentially mess up their behavior in normal situations.

In the context of barbarian assaults on cities being blockable by a single weak unit in a chokepoint (etc, see spoiler further down for more context) I have looked at the cpp source. My impression is that this can be improved by adding the MOVE_THROUGH_ENEMY flag at the right place - see code:
Code:
void CvUnitAI::AI_barbAttackMove()
{

<snip>

   // don't wander aimlessly in Clan territory, please
   if (bFriendlyTerritory)
   {
       if (AI_goToTargetCity(0, 12))
       {
           return;
       }
       if (AI_retreatToCity())
       {
           return;
       }
   }
       
   // Aggressive movements (actively seek out distant cities)
   if (bAggressive)
   {

<snip>

       if (AI_goToTargetCity(MOVE_THROUGH_ENEMY, 12))
       {
           return;
       }
   }
   // Semi-Aggressive Movements (attack cities if nearby)
   if (bSemiAggressive)
   {

<snip>

       if (AI_goToTargetCity(0, 4))
       {
           return;
       }
   }

<snip>

}
Optionally that flag could also be added to the "if (AI_goToTargetCity(0, 4))" line in the code but I am not sure if that is desirable or not - should "semi aggressive" (more cautious) barbarians ignore blockers or not?

Note that this shouldnt affect AI players at all as this is a function for barbarians only. I have also looked somewhat at AI players: They already do have programming for such behavior in some situation/s. The code for them is more complex though and I didnt try to figure out the exact situations in which they may or may not also have that blocking problem.

Spoiler :

One problem (not specifically about this modmod I think but I have seen it here) I have come across is that somehow barb pathings can be blocked by own units in such a manner that it doesnt really make sense. I think even worker/settler units cause this.

Example: I build a new city. 7 tiles further there is a big stack of doom with 20 barbarian units. They are out for blood(*) and beeline towards the newly built city. But that "beeline" algorithm considers my units (their strength doesnt seem to matter) as hard obstacles. So if there is an Erebus-typical bottleneck in between that stack of doom and my newly undefended city and I place one wimpy unit there that stack of doom will then lose all interest in the new city. I think this is pretty lame. And it works in general too - I can make a line of units blocking passage and the city will no longer be a valid target.

Also: Even if not trying to "abuse" this its often not really possible on Erebus type maps due to those bottlenecks.


(*) Mine or rather my citizens/units, or often their own if they suicide against a well defended city.

<snip>

Edit 2: Workers are indeed sufficient for blocking.


No, that's part of the problem. I don't know where the relevant code is and how it is structured (yet).
<snip>
Fixing pathing to ignore enemy units (in certain circumstances) might already be hard. And even if I can change the pathing to ignore units, it might still mess up other parts of the AI, since the units will encounter unexpected units in their way.

Anyway, I will report back here if I figure out how this works and what can be done. Will not happen before next release, though.
 
@Sezren: That looks promising. Did you test your changes already?

@LightAcolyte: Apologies for the late reply. I now also checked the AI; it's definitely using "Lead by Warlord", although ineffeficiently, since it still assumes the standard BtS behaviour. For example, since you can't split a GG from a unit in BtS, it waits until wartime before leading units. I'll made a note to try to improve that in the future.

I'll try to answer your individual points, but I feel we're talking past each other to some degree.

So in MNAI-2.9 archive version copied and replacing all name-matching files in a copy of an unmodified Fall From Heaven 2 mod installation in Civ4 BTS v.3.19, there is no "Lead Troops as a Warlord" spell/special ability for any unit category or combat type, except on the Great General Unit itself. There is no entry in the Sevopedia for "Lead Troops as a Warlord."
Such a spell indeed does not exist, so you won't find it in the pedia or the XML (the ability comes from the <LeaderPromotion> tag in CIV4UnitInfos.xml instead). "Special abilities" in the pedia are just spells on the technical side.

The AI is incorrectly programmed to use the spell "Lead Troops as a Warlord" on the unit combat types, which does not happen in standard Civ4 BTS so this behavior is not the same.
I don't understand what you mean, sorry. Which unit combat types are you talking about?

Even if the unit combat types are removed so that any unit with access to the spell uses it: when there's more than one unit (as there almost always is for the AI in their cities where the Great Generals spawn after enough Great General "XP" is earned from combat with non-Barbarian units), the AI will cancel the spell/ability like with the last option in the menu to "Nevermind" resulting in the Great General never being attached to any units for some reason.
Which spell are you talking about now? The "Join Commander" spell? How do you know that the AI is canceling the spell?

In our MP games, the AI cities have at least one Great General unit in one or more cities usually just standing around taking up maintenance.
As mentioned above, this is probably because the AI thinks it has to save its generals for later. I think if their in a war on the same continent, they should use the GG.

Even if the spell is changed or added to be allowed for the unit combat types to cast themselves when a Great General is present and the spell added to the Sevopedia, the AI is not using it correctly in cities, but will attach a Great General in the field (except that the Great Generals never get out into the field to be attached in the first place).
Here I again don't know which spell you're talking about.
 
Top Bottom