[MOD] More Naval AI

Version 2.1 Official Release (not compatible with any previous saves)

Download link

Note: I've changed the directory in which the B.U.G. ini files reside just to make sure that it didn't cause any issues with other BUG installs. The game should create the folder and default .ini files when you first start, but you will need to go into the B.U.G. options and change them to suit your preferences. Apologies for any inconvenience, but I think this will be better in the long run.


AI
  • AI will again dispel mana nodes to build Towers if pursuing a Tower Victory
  • AI will less interested in making food buildings if it has no room to grow (unless its unhealthy, can pop rush, or is unhappy production)
  • Made some changes so that Sprawling civs wont count Settlements as cities when counting their total cities for various AI purposes
  • AI more willing to Draft units
  • AI should generally be more interested in building troops
  • Tech AI - AIs pursuing Religious victories will place more emphasis on researching Techs that allow Open Borders; AI more interested in researching Education; AI more interested in researching Techs that open up new Civics
  • AI will sometimes create Puppet States
  • Civics AI - lots of tweaks to how the AI chooses Civics
  • Tolerant civs more likely to build units from other civs in captured cities
  • Mana Upgraders wont cast spells when they are trying to upgrade mana
  • AI will no longer try to add Heroes to Flesh Golems

Bug fixes
  • UI - fix for text misalignment on Tech Chooser screen
  • UI - fixed a typo in the Help Text for Advanced Tactics option
  • Bugfix - Mirrored units will no longer copy equipment promotions
  • Bugfix - Great Generals can now be joined with Disciple units
  • Bugfix - Golden Hammers can no longer be Given to Craftsman after they have been picked up as equipment
  • Bugfix - make sure that cityAcquiredAndKept is called when cities are traded (fixes issue with Infernal cities not getting their default buildings)
  • Bugfix - civs will no longer make announcements when switching to a Hidden Religion
  • Bugfix - Barbarian cities should no longer gain new religions
  • Bugfix - B.U.G will now create the Settings folder if it doesn't already exist (code by karadoc)
  • Bugfix - fix for units with Free Promotions being able to select Great Generals as a promo choice
  • Bugfix - fix for missing graphic for Breeding Pit on city mouseover
  • Bugfix - fix for Heroes and Mages sometimes being assigned UNITAI_ATTACK
  • Bugfix - fix for a potential error if a unit with a Combat Type converted to a unit without a Combat Type (such as Waning a unit into a Shade)
  • Bugfix - AIs will now try and station more units in cities with high Revolution Indexes

UI
  • Growth bar on the city screen will no longer be displayed for Fallow civs
  • Sevopedia now has an Equipment section
  • Sevopedia now has a Races section
  • Sevopedia now has an Effects section
  • Sevopedia now has a Unique Features section
  • Fix for some buildings (such as Holy Shrines) not being listed in Sevopedia
  • suppressing display of Strategy section in the Sevopedia
  • Suppressing display of clock options which are not appropriate for FFH
  • Header text for Civic types on Foreign Advisor screen updated to match names for FFH civic types
  • Suppressing display of Hidden Religions on the Foreign Advisor display
  • Tweaks to the text display that reports revolts to the players
  • Info about Revolution factors for buildings are now displayed in the buildings help; fix for an extra plus sign in civic help;
  • Removed the Better AI and UP info from flag mouseover (they are now acknowledged on the BUG Credits tab
  • Some minor tweaks to the Puppet States text
  • Rebel civs should no longer give popup messages when they are destroyed
  • New generic message for when Great Generals are killed
  • The Dynamic Civ Names option is now functional (checkbox is on the Scoreboard tab in BUG options) (thanks to lfgr for getting it working)
  • New BUG option: Display Unit Combat symbol in Unit Help (idea taken from Flavour Mod)

MISC
  • Advanced Tactics - Diverse Grigori - Grigori units will sometimes be given random racial promotions
  • Advanced Tactics - War Prizes are now damaged 75% rather than 25%
  • Advanced Tactics - War Prizes can not be captured if the winner of the battle is on an invalid plot for the captured unit
  • Advanced Tactics - War Prizes can no longer be captured by HN units
  • Advanced Tactics - Temporary summons and Objects no longer get the inherent 10% withdrawal chance
  • Puppet States - Barbs can no longer become Puppet States
  • Puppet States - players can no longer have more than one Puppet of the same civ-type; players now get the option of giving captured cities to their puppet as long as the puppet and precious city owner civ-types match, even if from a completely different player
  • Puppet States - when formed, Puppet States are only given techs that both the capturing player and the previous city owner know
  • Puppet States - leaders for Puppet States can now include minor leaders (code by lgfr)
  • Revolutions - reduced some Revolution penalties for Civics; Dungeons, Tower of Compacency and Unyielding Order will all help reduce Revoltion Indexes in their cities
  • Revolutions - cities with Unhappy Production receive less penaly to the Revolutions index for Unhappy population
  • Revoltuions - changes to the way Financial Troubles affect stability
  • Various speed tweaks from lesslol
 
Thank you very much for the update.

I went ahead and merged the new version with my modmod. Unless I run across an error in the next few hours, I plan to release a new version too just after midnight.


Could you explain to me how to make the installer include that text telling the user to make sure that Civilization 4 is not running while installing and stating that it needs Fall from Heaven 2 to have been previously installed to work correctly? I did not see anything about that in Valkrionn's Inno Install Script Tutorial.

Also, I think it would be more convenient for you to do as I did and make the installer create a new directory and copy the FfH2 files into that instead of altering the original FfH2 files themselves.

Here is my install script if you need to see how I did that:
Spoiler :
Code:
[Setup]
AppId={{8427E6A0-3639-40BF-BD47-6E18D022A1FF}
AppName=Magister Modmod for FfH2
AppVerName=Magister March 21 2012
DefaultDirName={reg:HKLM\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword,INSTALLDIR}\Mods\Magister Modmod for FfH2\
OutputBaseFilename=Magister Modmod March 21 2012 Setup
Compression=lzma
SolidCompression=yes
DisableProgramGroupPage=yes
SetupIconFile=C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Magister Modmod for FfH2 - Copy\govannon.ico

[Types]
Name: "full"; Description: "Default installation"

[Components]
Name: "Magister"; Description: "Magister Modmod for FfH2 Core Files"; Types: full; Flags: fixed
Name: "FfH2"; Description: "Copy Fall from Heaven 2 Files"; Types: full; Flags: fixed

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags:

[Files]

Source: "{reg:HKLM\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword,INSTALLDIR}\Mods\Fall from Heaven 2\*"; DestDir: "{app}"; Flags: external recursesubdirs createallsubdirs comparetimestamp; Components: FfH2
Source: "C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\Magister Modmod for FfH2 - Copy\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Magister
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{userdesktop}\Magister Modmod for FfH2"; Filename: "{reg:HKLM\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword,INSTALLDIR}\Civ4BeyondSword.exe"; Parameters: "mod=\Magister Modmod for FfH2"; Tasks: desktopicon; IconFilename: "{app}\govannon.ico"

[Run]
Filename: "{reg:HKLM\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword,INSTALLDIR}\Civ4BeyondSword.exe"; Parameters: "mod=\Magister Modmod for FfH2"; Description: "{cm:LaunchProgram,Magister Modmod for FfH2}"; Flags: nowait postinstall skipifsilent
 
I don't know if I should really like you or really dislike you tholal :D

I just dl your last version yesterday... and hop, today you have again a new one :D

well
luckily I didn't installed last version nor started a game... thus, I think the coin will drop on the "I like you really much"... (in a friendly manner of course)
 
First observation, score list is showing civ/alignment now, but not leader name.

OK, updated my BUG options ...

So this option is working for you now, correct?

I copied the bug eng.chm help file to a bout 12 places, but I still cant access it in game.

Apparently they have to go into the same folder as your BUG settings. Or you can just open the help file manually. Opening it in-game doesn't seem to do anything special.
 
It seems, at first glance, like Puppet States would make playing the Kuriotates significantly easier. Is this the case? Would you recommend turning that option off when playing the Kuriotates?
 
Firstly, thanks for the update Tholal :goodjob:

Next onto bugs:

1) The revolution screen is showing default city information and not the revolution specific information.

2) There is an obscure bug I just discovered with prison cages. If units are trapped in a cage near a rival city, and that city has a border expansion, the units will get bumped off the cage. This means the units will not be able to be rescued because the cage is on a different square to the units with the held promotion.

Attached save game to illustrate my point. Just press Enter.
 

Attachments

  • Prison Bug.CivBeyondSwordSave
    52.7 KB · Views: 57
1) The revolution screen is showing default city information and not the revolution specific information.

This can be fixed by customising the revolution screen, just fiddle around with the buttons at the bottom of the rev screen, one of them will bring up a menue that allows you to do so.

Btw, big thx for the update Tholal, you rock. :goodjob::goodjob:



Here are some bugs for you.

Essus still issent that secret. ^^
Spoiler :


No idea what that is.
Spoiler :


Also in this game the Infernal agreed to become my vasall the turn i summoned them, this might be in need of a fix.
 
Essus still issent that secret. ^^

I looked all over and just could not find where the code is that displays the symbol on that window.

No idea what that is.

Python error. Most likely in the Revolutions code. If you have logging turned on, there will be a pythonError.log file in your log directory. If I can get the message from that error file I can fix whatever the issue might be. However, this file gets overwritten everytime you start the game up again, so you'll need to grab that error log right after the error occurs.
 
Had a great game with the Lanun (15 civs on a standart Perfect_Mongoose_mst map). Thanks again Tholal, your improvements and additions make the game much more challenging and epic!

Two bugs:
When a boarding party captures a ship, the ship is moved to the original tile of the BP, but the BP moves to the tile of the ship, now it stands on water. Next turn the BP moves to the nearest non-enemy land.

Next, maybe not a real bug, although fixed by me :)
When a unit is converted, it adopts the UnitArtStyle of the capturer.
I inserted that into CvUnit::convert( CvUnit* ) before setGameTurnCreated(pUnit->getGameTurnCreated());
Code:
// lfgr UnitArtstyle
	if( pUnit->getUnitArtStyleType() != NO_UNIT_ARTSTYLE )
		setUnitArtStyleType( pUnit->getUnitArtStyleType() );
	else
		setUnitArtStyleType( GC.getCivilizationInfo( GET_PLAYER( pUnit->getOwnerINLINE() ).getCivilizationType() ).getUnitArtStyleType() );
	reloadEntity();
// lfgr end
That works fine.

Another thing: In vanilla Civ was a gift-unit function. Did you remove it? It would be very helpful to give puppet states some workers.
 
A Moon posted a saved game in my modmod thread which is crashing to desktop at the end of the turn. The logs clearly show that the problem is in Revolutions, so I figured I'd turn it over to you.


PytgonErr.log:
Code:
Traceback (most recent call last):
  File "BugEventManager", line 361, in _handleDefaultEvent
  File "Revolution", line 638, in onEndPlayerTurn
  File "Revolution", line 6394, in launchRevolution
  File "Revolution", line 7058, in spawnRevolutionaries
RuntimeError: unidentifiable C++ exception
PythonDbg.log:
Code:
PY:saveDesc:C:\Users\Magister\Documents\My Games\Beyond the Sword\Saves\WorldBuilder\WBQuickSave, curDir:C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword
WBSave done

08:34:23 DEBUG: updatePlotListButtons_Orig - column 0, offset 225
08:34:23 DEBUG: BugOptions - writing INI file 'Autolog.ini'
load_module encodings.ascii

08:34:25 DEBUG: updatePlotListButtons_Orig - column 0, offset 225
08:34:25 DEBUG: updatePlotListButtons_Orig - iCount(225), iSkipped(0)
08:34:25 DEBUG: Timer - scores took 20 ms
08:34:25 DEBUG: Timer - scores took 25 ms
08:34:46 DEBUG: BugData - returning open table root.SpyUtil
08:34:46 DEBUG: BugData - new data for root.SpyUtil: {'turn': 346, 'version': 1, 'values': {0: [0, 0, 0, 0, 0, 0, 0, 0], 1: [0, 0, 0, 0, 0, 0, 0, 0], 2: [0, 0, 0, 0, 0, 0, 0, 0], 3: [0, 0, 0, 0, 0, 0, 0, 0], 4: [0, 0, 0, 0, 0, 0, 0, 0], 5: [0, 0, 0, 0, 0, 0, 0, 0]}}
08:34:46 DEBUG: SpyUtil - stored: {'turn': 346, 'version': 1, 'values': {0: [0, 0, 0, 0, 0, 0, 0, 0], 1: [0, 0, 0, 0, 0, 0, 0, 0], 2: [0, 0, 0, 0, 0, 0, 0, 0], 3: [0, 0, 0, 0, 0, 0, 0, 0], 4: [0, 0, 0, 0, 0, 0, 0, 0], 5: [0, 0, 0, 0, 0, 0, 0, 0]}}
PY:  Loading revolution data
PY:  Revolt - Found launchable revolt spawn data for player 1, starting spawn against player 4 idx 1
PY:  Revolt - Spawning revolutionaries for 2 cities in Balseraphs
PY:  Revolt - Cities in revolt: Coombe View, Idris, 
PY:  Revolt - The Svartalfar revolutionaries join in the war against the Balseraphs!
PY:  Revolt - Spawning Svartalfar revolutionaries!!!
PY:  Revolt - In Coombe View, with rev idx 1146 (30 local)
PY:Rebel:  Can build Freak
PY:Rebel:  Can build Warrior
PY:Rebel:  Owner has 3 Archer
PY:Revolt -  Comp has 13 Freak (count)
PY:Revolt -  Comp has 13 Freak (att)
WARNING: Civ types 2 and 21 have no unit of class type 110

WARNING: Civ types 2 and 21 have no unit of class type 111

WARNING: Civ types 2 and 21 have no unit of class type 132

WARNING: Civ types 2 and 21 have no unit of class type 243

WARNING: Civ types 2 and 21 have no unit of class type 244

PY:Revolt - Best defender set to Freak
PY:Revolt - Best counter unit set to Freak
PY:Revolt - Best attack set to Freak
PY:  Revolt - Found 7 plots out of 7 checked
PY:  Revolt - Repeat revolution, increasing enlistment
PY:  Revolt - Population modifier: 0.569 on eff pop 6.03 (6)
PY:  Revolt - New method from pop: 1.72, from troops: 0.75, total: 2
PY:  Revolt - Revised enlistment: 2, num defenders nearby: 1
PY:  Revolt - Owner keeps control of Coombe View (64,38), revs spawning at 64,39
PY:  Revolt - City occupation timer set to 4
PY:  Revolt - Spawning 2 units for city of size 6
08:34:46 TRACE: Error in EndPlayerTurn event handler <bound method Revolution.onEndPlayerTurn of <Revolution.Revolution instance at 0x3F7F71C0>>
08:34:46 TRACE: unidentifiable C++ exception
 
got a crash to desktop
Debugged it:

It says something about eReligion is not defined, and points at CvUnitAI::AI_spreadReligion()

Code:
ReligionTypes eReligion;
int iPathTurns;
int iValue;
int iBestValue;
int iPlayerMultiplierPercent;
int iLoop;
int iI;
bool bCultureVictory = kOwner.AI_isDoVictoryStrategy(AI_VICTORY_CULTURE2);

// BBAI TODO: Unnecessary with changes below ...
if (eReligion == NO_RELIGION)
{

eReligion is obviously NOT defined...
But regarding the code below, I think a simple eReligion = NO_RELIGION should do it.
 
When a boarding party captures a ship, the ship is moved to the original tile of the BP, but the BP moves to the tile of the ship, now it stands on water. Next turn the BP moves to the nearest non-enemy land.

Played around with this a bit and found I have two options for changing how this works:

1) Captured ship does not get put on land but is still punted to a different sea space leaving the Boarding Party unit on the water

2) Captured ship stays in its plot (and automatically loads the Boarding Party if it has cargo space), however, if there are other enemy ships in the plot, they get booted out

For now I'm using option #2.


Code:
Next, maybe not a real bug, although fixed by me :)
When a unit is converted, it adopts the UnitArtStyle of the capturer.
I inserted that into CvUnit::convert( CvUnit* ) before setGameTurnCreated(pUnit->getGameTurnCreated());

Looks good. I'll include it in the next release.

Another thing: In vanilla Civ was a gift-unit function. Did you remove it? It would be very helpful to give puppet states some workers.

That function was disabled by Kael. I think there were too many exploit options with unit-gifting in FFH. I can probably finagle it so that new Puppet States get a free Worker or two.

A Moon posted a saved game in my modmod thread which is crashing to desktop at the end of the turn. The logs clearly show that the problem is in Revolutions, so I figured I'd turn it over to you.

It's probably related to one of your new or changed units. I should be able to run a debug DLL with your mod and figure it out. I'll try and do that sometime in the next couple of days.

got a crash to desktop
Debugged it:

It says something about eReligion is not defined, and points at CvUnitAI::AI_spreadReligion()

Ha! You're running a self-compiled DLL from the Sourceforge repository! Meant to check in a fix for that issue last night but forgot about it. Just uploaded an update to Sourceforge a few minutes ago.
 
Regarding Sacrifice the weak.

Would it be possible to only have it cause instability for a couple turns then provide stability?

It would represent the fact that the "weak" or those with moral qualms have been weeded out/purged and only the terrible and cruel remain.

Also a diplomatic option to release vassals would be nice. ignoring of course puppets states.s


(Added)

Also It might be a good Idea to provide some stability bonus's for lanun cities via their capital or a unique civic.

Water seems to multiply any instability bonus immensely

On maps with lots of Islands/continents the lanun spread out quickly and unfortunately there is no good civic for Nations with multiple Islands.

In 6 separate games I watched them collapse into Multiple nations usually 2-3 but in the last game Hannah had seven small continents and each became independent.....
 
New Problem: In The Momus, the various armies raze cities with World Wonders in them, ensuring they are gone forever. Is this part of normal battle behavior?
 
Top Bottom