MNAI-U: unofficial build & bugfixes

When a unit explores a lair, the units that appears to protect it don't spawn in the lair, but in a tile close to it.
Civ4ScreenShot0064.JPG

There is an text error regarding some resources in the diplomacy screen.
Civ4ScreenShot0065.JPG

Loki can be killed if inside a city. Is that intended? In the civilopedia says that he needs to be completely surrounded or cornered in some closed place to be killed.
Civ4ScreenShot0053.JPG

The bandit company event doesn't give the name of the city it happens. Also, it only raise the crime rate of the city, which is not a real harrassment to the affected civilization, like destroying some improvements or spawning some barbarian units.
Civ4ScreenShot0075.JPG Civ4ScreenShot0066.JPG

I bought a city that have the bad luck to be chosen when the Infernals have casted their world spell and a message that says they have generously liberated my city have appeared doesn't make much sense in this context. I suggest a text like: the civilization x have bought the city y from civilization z.
Civ4ScreenShot0076.JPG
 
When a unit explores a lair, the units that appears to protect it don't spawn in the lair, but in a tile close to it.
That's because your unit is standing on that tile. If we spawned them on the same tile it could lead to a game crash and would also require the spawned units to move at least 2 tiles to attack you on their next turn, once to get off the tile and another to attack.
Loki can be killed if inside a city. Is that intended? In the civilopedia says that he needs to be completely surrounded or cornered in some closed place to be killed.
That should not have happened unless the city was surrounded/cornered.
The bandit company event doesn't give the name of the city it happens. Also, it only raise the crime rate of the city, which is not a real harrassment to the affected civilization, like destroying some improvements or spawning some barbarian units.
Personally I like my cities to have higher crime rate. Coastal cities can have a smugglers port event and all can have a horseman spawn event. I can't think of any bad events off the top of my head, or at least not anything that bad.
I bought a city that have the bad luck to be chosen when the Infernals have casted their world spell and a message that says they have generously liberated my city have appeared doesn't make much sense in this context. I suggest a text like: the civilization x have bought the city y from civilization z.
I agree.
 
Is it possible to make the AI use the release from cage spell only if one of its own units is on the tile with a held promotion? I don't think it's optimal for it to go around releasing other civilizations' units.
 
When a unit explores a lair, the units that appears to protect it don't spawn in the lair, but in a tile close to it.
That's because your unit is standing on that tile. If we spawned them on the same tile it could lead to a game crash and would also require the spawned units to move at least 2 tiles to attack you on their next turn, once to get off the tile and another to attack.
It's not precisely that; EMM pushes the explorer out of the lair, if possible (this might be stolen from RifE). But this always has been the behavior in FfH, so I'll say this is how it should be in MNAI.

There is an text error regarding some resources in the diplomacy screen.
Thanks, I'll check that.

Loki can be killed if inside a city. Is that intended? In the civilopedia says that he needs to be completely surrounded or cornered in some closed place to be killed.
Loki uses the same withdrawal rules as normal units (just with 100%), and those explicitly disallow withdrawing from cities. I'd say it's intended and fine. I'll fix the pedia, though.

The bandit company event doesn't give the name of the city it happens. Also, it only raise the crime rate of the city, which is not a real harrassment to the affected civilization, like destroying some improvements or spawning some barbarian units.
I agree that crime is not a big deal (unfortunately), but I consider changing events out of scope for this mod. I'll look into the text issue, of course.

I bought a city that have the bad luck to be chosen when the Infernals have casted their world spell and a message that says they have generously liberated my city have appeared doesn't make much sense in this context. I suggest a text like: the civilization x have bought the city y from civilization z.
I'll look into it.
 
Kael notes that Crime Rate isn't meant to strongly influence player decisions, but it does seem a high Crime Rate is supposed to be a negative thing, which means that the resulting events should skew negative, even if they're occasionally good. Enterprising modders looking to shift balance in that direction might want to consider creating some new bad events

Incidentally, if we're talking about rebalancing events, how about changing the monument inscription options from +2 food and +1 health (IIRC) to +1 food and +2 health? That way it feels like the standard possibilities are roughly on par with each other, instead of the food almost always being the right option. Technically outside of the scope of this mod, perhaps, but this one feels like basically correcting a typo, and this Event comes up often enough that it strikes me as worth fixing. Pwetty pwease? (Also, it should probably only happen once per city.)

Players can use 'Create Den'? How?
The ability does not show up until you meet the requirements. IIRC it's fully healed and on an unowned tundra/snow tile for bears. I want to say there is a lion den as well but I don't remember it's requirements.
According to the FfH2 Manual, a Bear, Polar Bear, or Lion Pride "must be at Full Health and alone on the Tile, Outisde [sic] of all Cultural Borders and more than 4 Tiles away from any Improvement" in order to use Create Den. In addition, Bear Dens must be created on flatland Tundra and Lion Dens on flatland Plains, which the description of the Create Den special ability does not tell you, and must instead be inferred from the Bear Den and Lion Den lair entries. Did I mention that Create Den can be found under neither "Special Abilities" nor "Spells" in the Civilopedia?

It's pretty obscure, is what I'm getting at. It might make more sense to just remove it as an option for players. Still might be worth looking at whether Create Den also creates a new unit when the Barbarians do it. That could result in animals and Dens spawning/spreading faster than intended.

That is something I changed in my personal mod of MNAI. I changed almost all spell/abilities that don't show until you can use them to now show at all times so you at least know it exists. It never makes sense to me to hide such things from the player to begin with.
I agree that that's good practice unless the information is actually supposed to be secret. Unmet requirements should also be listed, like how mousing over a Resource tells you which techs and/or Improvements you need to connect it to a city.
 
I had a game in which Brigit spawned without the Ring, allowing any scout to capture it. I attached the save right after map generation. It's on X:18, Y:32. I suppose the Ring doesn't get duplicated by the Mirror script?
 

Attachments

Last edited:
The heroes icon is taking up part of the space in the unit's picture frame in civilopedia. Its not a big problem but hinders the complete view of the unit.
Civ4ScreenShot0080.JPG

In this game the ability to explore dungeons in the map is unable to the Doviello. Save attached.

In other game, I find the Lanun AI under Falamar leadership very nerfed. Most of the time the Lanun have the highest score and found cities very quickly. I'm attaching a save of this game too, if there is a need to see what I'm talking about. I have played with the Elohim and noted that they begin the game with vision of the unique features in the map. Is that intended? If yes, I suggest add this information to the civilopedia.
 

Attachments

In other game, I find the Lanun AI under Falamar leadership very nerfed. Most of the time the Lanun have the highest score and found cities very quickly. I'm attaching a save of this game too, if there is a need to see what I'm talking about.
You mean Hannah is much better than Falamar?
Charadon has the trait Barbarian and when at peace with the barbs, you can't explore.
This came up before, I should add a help text to the disabled spell button.

Is this fix included in the modmod already?
It's included.
 
The city name doesn't get filled in, possibly because my civ's borders were against theirs to trigger the event, but didn't have line of sight to their city.
 

Attachments

I started up vanilla FfH for the first time in years and noticed MNAI changed the UI to be less transparent, less fantasy parchment, and more...digital brown. Why was that done?
 

Attachments

  • Civ4ScreenShot0000.JPG
    Civ4ScreenShot0000.JPG
    172.4 KB · Views: 69
  • Civ4ScreenShot0001.JPG
    Civ4ScreenShot0001.JPG
    158.5 KB · Views: 63
Its possible to make the game alert when an inquisitor succeed in remove one or more religions of the player's cities? Because is a little annoying when you spread a different faith than your state religion through your cities and priests of another civilization with the Inquisition ability remove these religions and generate unhappiness in the affected cities without you know.

What is the percentage of a unit stop its attack against a unit because a fear promotion? I have used eight units against Hyborem and no one managed to succeed in the attack.
Civ4ScreenShot0116.JPG

In the Religion advisor, the Octopus Overlords name don't have enough space and have mescled itself with the Runes of Kilmorph name.
Civ4ScreenShot0133.JPG
 
I am attempting to analyze the dump files created when my mod crashes. I'm not really familiar with WinDbg so I'm not sure what I'm doing, but in the dump files I analyzed the program seems to say that the problem is with CvTeamAI& CvTeamAI::getTeamNonInl

Spoiler :
Code:
*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************

*** WARNING: Unable to verify checksum for Mss32.dll

KEY_VALUES_STRING: 1

   Key  : AV.Dereference
    Value: NullClassPtr

    Key  : AV.Fault
    Value: Read

    Key  : Analysis.CPU.mSec
    Value: 3046

    Key  : Analysis.DebugAnalysisManager
    Value: Create

    Key  : Analysis.Elapsed.mSec
    Value: 16513

    Key  : Analysis.Init.CPU.mSec
    Value: 375

    Key  : Analysis.Init.Elapsed.mSec
    Value: 4031

    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 206

    Key  : Timeline.Process.Start.DeltaSec
    Value: 6610

    Key  : WER.Process.Version
    Value: 3.1.9.0


APPLICATION_VERIFIER_FLAGS:  0

CONTEXT:  (.ecxr)
eax=00000000 ebx=00000008 ecx=80000001 edx=03d07bf8 esi=648c7698 edi=000000e1
eip=0469b17e esp=0019f968 ebp=00000000 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246
CvGameCoreDLL!CvTeamAI::getTeamNonInl+0x2095e:
0469b17e 807837ff        cmp     byte ptr [eax+37h],0FFh    ds:002b:00000037=??
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 0469b17e (CvGameCoreDLL!CvTeamAI::getTeamNonInl+0x0002095e)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000000
   Parameter[1]: 00000037
Attempt to read from address 00000037

PROCESS_NAME:  Civ4BeyondSword.exe

READ_ADDRESS:  00000037

ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.

EXCEPTION_CODE_STR:  c0000005

EXCEPTION_PARAMETER1:  00000000

EXCEPTION_PARAMETER2:  00000037

STACK_TEXT:
00000000 00000000     00000000 00000000 00000000 CvGameCoreDLL!CvTeamAI::getTeamNonInl+0x2095e


SYMBOL_NAME:  CvGameCoreDLL!CvTeamAI::getTeamNonInl+2095e

MODULE_NAME: CvGameCoreDLL

IMAGE_NAME:  CvGameCoreDLL.dll

STACK_COMMAND:  ~0s ; .ecxr ; kb

FAILURE_BUCKET_ID:  NULL_CLASS_PTR_READ_c0000005_CvGameCoreDLL.dll!CvTeamAI::getTeamNonInl

OSPLATFORM_TYPE:  x86

OSNAME:  Windows 8

FAILURE_ID_HASH:  {b0c2cec0-f5c5-a041-c1f1-7fefb8e63a02}

Followup:     MachineOwner
---------
Spoiler :
Code:
*******************************************************************************
*                                                                             *
*                        Exception Analysis                                   *
*                                                                             *
*******************************************************************************

*** WARNING: Unable to verify checksum for Mss32.dll
DEBUG_FLR_EXCEPTION_CODE(c0000374) and the ".exr -1" ExceptionCode(c0000005) don't match

KEY_VALUES_STRING: 1

   Key  : AV.Dereference
    Value: NullClassPtr

    Key  : AV.Fault
    Value: Read

    Key  : Analysis.CPU.mSec
    Value: 3171

    Key  : Analysis.DebugAnalysisManager
    Value: Create

    Key  : Analysis.Elapsed.mSec
    Value: 7806

    Key  : Analysis.Init.CPU.mSec
    Value: 499

    Key  : Analysis.Init.Elapsed.mSec
    Value: 8425

    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 82

    Key  : Timeline.OS.Boot.DeltaSec
    Value: 213260

    Key  : Timeline.Process.Start.DeltaSec
    Value: 1685

    Key  : WER.Process.Version
    Value: 3.1.9.0


NTGLOBALFLAG:  0

PROCESS_BAM_CURRENT_THROTTLED: 0

PROCESS_BAM_PREVIOUS_THROTTLED: 0

APPLICATION_VERIFIER_FLAGS:  0

CONTEXT:  (.ecxr)
eax=00000000 ebx=00000008 ecx=80000001 edx=03b7e570 esi=60383090 edi=00000064
eip=0456b17e esp=0019fb54 ebp=00000000 iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246
CvGameCoreDLL!CvTeamAI::getTeamNonInl+0x2095e:
0456b17e 807837ff        cmp     byte ptr [eax+37h],0FFh    ds:002b:00000037=??
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 0456b17e (CvGameCoreDLL!CvTeamAI::getTeamNonInl+0x0002095e)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000000
   Parameter[1]: 00000037
Attempt to read from address 00000037

PROCESS_NAME:  Civ4BeyondSword.exe

READ_ADDRESS:  00000037

ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.

EXCEPTION_CODE_STR:  c0000005

EXCEPTION_PARAMETER1:  00000000

EXCEPTION_PARAMETER2:  00000037

ADDITIONAL_DEBUG_TEXT:  Followup set based on attribute [Is_ChosenCrashFollowupThread] from Frame:[0] on thread:[PSEUDO_THREAD]

FAULTING_THREAD:  ffffffff

STACK_TEXT:
00000000 00000000 heap_corruption!Civ4BeyondSword.exe+0x0


STACK_COMMAND:  !heap ; ** Pseudo Context ** ManagedPseudo ** Value: ffffffff ** ; kb

SYMBOL_NAME:  heap_corruption!Civ4BeyondSword.exe

MODULE_NAME: heap_corruption

IMAGE_NAME:  heap_corruption

FAILURE_BUCKET_ID:  NULL_CLASS_PTR_READ_ACTIONABLE_InvalidArgument_c0000005_heap_corruption!Civ4BeyondSword.exe

OSPLATFORM_TYPE:  x86

OSNAME:  Windows 8

FAILURE_ID_HASH:  {580ebaa9-b878-359b-5bc0-e9c5ce923b94}

Followup:     MachineOwner
---------
---
I still find that the game uses the name of the wrong city when mentioning how losing a city effects revolutionary sentiments.

---
I think that the AI values mana much too highly in the early game when there is not much they can do with it. In my last few playtests I was able to trade some extra mana I had no use for before getting mages for a large number of technologies and bunch of ships/siege units. The Khazad were especially amenable to such trades, even though they never get mages and ought to consider mana less valuable than do other civs.
 
A couple problems:

There should be some reversion to AI lair/dungeon exploring aggression. I seem to recall some years ago there was some work done to it that made it slightly better, but the way it is now seems to be that the AI will explore with close to or actually 100% odds if it sees one with a fully healed unit. I've had about 10 games in a row in which at least one AI died because of its lair explorations in the beginning of the game. It's probably worse than the vanilla game was in this aspect.

If a unit is built with enough experience points to level up, such as with education, then has to be reprimanded the turn it's built for torture, it can still level up despite not meeting the xp threshold.
 
Last edited:
I am attempting to analyze the dump files created when my mod crashes. I'm not really familiar with WinDbg so I'm not sure what I'm doing, but in the dump files I analyzed the program seems to say that the problem is with CvTeamAI& CvTeamAI::getTeamNonInl
This says that somebody is trying to read from an address they aren't meant to. Normally, I'd assume this is due to an invalid eTeam parameter (e.g., NO_TEAM), but then I'd assume the error would show up in the getTeam() call inside getTeamNonInl(). Anyway, there's no way for me to solve this without access to the full stacktrace. If you want, I can debug this for you, but you'd need to upload the mod and a savegame, of course. Also I probably won't get to it the next 1-2 weeks.

I still find that the game uses the name of the wrong city when mentioning how losing a city effects revolutionary sentiments.
That's unsurprising, since I didn't release a new version since your last report. :)
I'll quote myself:
I simply use pCity.getName() there, so I don't think it has to do with city name order. I'll investigate that, too. A quick fix would be to simply replace "%s1" with "a city" a the end of the playerCityLost in python/Revolution/RevEvents.py.

If a unit is built with enough experience points to level up, such as with education, then has to be reprimanded the turn it's built for torture, it can still level up despite not meeting the xp threshold.
You mean it's already glowing blue, and stays that way despite losing XP?
 
Back
Top Bottom