[MOD] More Naval AI

I'm not really sure to be honest. I know pretty much nothing about OOS issues. Perhaps running a debug DLL and taking note of any asserts that come up when the Infernals are created will point in the right direction?

We decided to destroy the Infernals. We were the ones who summoned them and they were helping us with destroying all non Ashen Veil civilizations, but dealing with an OOS error every three turns or so was not worth it. We had a last OOS a few turns after we killed them, and the game has been running smoothly since then...

Once that I finish with some modcomp merging I'll try to learn about OOS debugging and give debugging this issue a shot using only More Naval AI. Although unlikely (they don't alter any specific civilization), it might be possible that one of the modcomps I use is causing this.

It would be quite helpful if someone else could confirm that he gets OOS errors as soon as the Infernals are summoned with either 1.8.5-beta or 2.0-beta. Thanks!
 
I did download them but I wasn't sure where I was supposed to put the files, possibly put them in the wrong place? Sorry I'm a complete failure with computers :p

You will have to unzip and copy the folder found in the BUG Mod ini files.zip into your BTS directory under My Documents (same place you find the CivilizationIV.ini file).
 
For OOS errors the starting point should be the OOS logs. They're sometimes enough on their own but more often they just tell you where to start digging. If the OOS log alone isn't enough you can run debug build to try to hunt it down.

I tried a multiplayer game with myself both playing as and against the infernals but didn't get OOS (didn't try to capture cities because they ended up landlocked and I didn't bother with ships). Decided to fix the OOS that happens when you change civilizations while I was at it.
In CvScreensInferace.py change the line CyGame().reassignPlayerAdvanced(iOldPlayer, iNewPlayer, -1) to CyMessageControl().sendModNetMessage(2, iOldPlayer, iNewPlayer, 0, 0)
Then in CvEventManager.py, onModNetMessage, add (under the somnium stuff)
Code:
		else: #iData1 is unused, to allow for a condition here. It must not be zero (would trigger somnium)
			CyGame().reassignPlayerAdvanced(iData2, iData3, -1)
Please note that this is not the only fix needed. Apparently events are bugged after switching civilizations. Some options were unavailable despite that they shouldn't be (even for the player that didn't switch!)
 
For OOS errors the starting point should be the OOS logs. They're sometimes enough on their own but more often they just tell you where to start digging. If the OOS log alone isn't enough you can run debug build to try to hunt it down.

Thank you for your advice. I'll check both OOS logs for differences to see if I can find why it fails.



I tried a multiplayer game with myself both playing as and against the infernals but didn't get OOS (didn't try to capture cities because they ended up landlocked and I didn't bother with ships). Decided to fix the OOS that happens when you change civilizations while I was at it.

Awesome, thanks! :D



Please note that this is not the only fix needed. Apparently events are bugged after switching civilizations. Some options were unavailable despite that they shouldn't be (even for the player that didn't switch!)

I did not suspect events... after checking the events I added from More Events it seems that their code has a lot of Infernal corner cases so that if the "random OOS bug" does not happen with only More Naval AI it is quite possible that the issue is from them. I'll try to debug it when I manage to get the other OOS log :)
 
Do you plan to activate BarbarianCiv? I had an idea about that: Some Barbarian Cities could have an human/elvish/dwarfish artstyle and produce human/elven/dwarfen units. The resulting BarbarianCivs have a Civ depending on that type.
Another problem is the starting location flavor of Rebels and BarbarianCivs (Elves should not be rebels in desert). Have you an idea yet how to solve that?
 
I played a bit with the revolution code to try to improve the choice of civ types in a revolution. So the attached code should do the following:
- Minor leaders are preferably spawned in revolutions (idea of Terkhen)
- Religious revolutions spawn compatible civs, e.g. a ashen veil revolution spawns Sheaim (I know that my selection is very subjective, to change it see RebelTypes.py)

Tholal, I hope you don't mind me posting that in your Thread, I coded it mainly for me and thought it could be useful for you or anybody.
 

Attachments

Tholal, did you do something to the Deepening? Because roughly 1/3 of my empire just went from grassland to ice.
 
Decided to fix the OOS that happens when you change civilizations while I was at it.

Thanks for the fix Snarko!

Do you plan to activate BarbarianCiv?

Not sure. I disabled it because it was causing Acheron's city to become a new civ, which was not a desired behavior. I want to get the Revolutions stuff in a better spot before I think about it too much.

Another problem is the starting location flavor of Rebels and BarbarianCivs (Elves should not be rebels in desert). Have you an idea yet how to solve that?

Not sure I completely understand. Dont rebels start in the borders of the civ they're rebelling from?


I played a bit with the revolution code to try to improve the choice of civ types in a revolution. So the attached code should do the following:
- Minor leaders are preferably spawned in revolutions (idea of Terkhen)
- Religious revolutions spawn compatible civs, e.g. a ashen veil revolution spawns Sheaim (I know that my selection is very subjective, to change it see RebelTypes.py)

Sounds good. Holidays are over and mother-in-law is leaving tomorrow (finally!) so hopefully I'll be able to get organized this week and start working actively on the mod again.

Tholal, I hope you don't mind me posting that in your Thread, I coded it mainly for me and thought it could be useful for you or anybody.

I dont mind at all. In fact I appreciate your input as you seem to have a much better handle on how the Revoutions code works than I do!
 
Tholal, did you do something to the Deepening? Because roughly 1/3 of my empire just went from grassland to ice.

Nope. It's the same as it is in base FFH. There's a 75% chance that the terrain changes. Grassland has a 40% chance to change to snow, otherwise it becomes tundra. Sounds like you just had a bit of bad luck.
 
Not sure I completely understand. Dont rebels start in the borders of the civ they're rebelling from?

Sorry, my bad english...

I mean when there is a rebellion in one of your desert cities, that rebels shouldn't be elves, first because it destroys some of the lore feeling when there is an elvish civilization in the desert, second because ljosalfar and svafaltar civs have benefits in forests and are probably lost in the desert.
 
Are there any modular civs that work especially well with your mod? I would like to flip over to it, and I would also like to add to the range of civs that are available, but I don't want to add civs that are somehow disadvantaged or incompatible with the fixes you have in place.
 
Nope. It's the same as it is in base FFH. There's a 75% chance that the terrain changes. Grassland has a 40% chance to change to snow, otherwise it becomes tundra. Sounds like you just had a bit of bad luck.

Heh, maybe I was panicking a bit. None of the ice seemed to be fading at the time, but it has now. Which makes me feel a bit silly for beelining to Commune with Nature, but meh.

Rest of the mod is great though.
 
One quick comment on the barbs: they seem a lot smarter now, and a lot less inclined to suicide themselves on my cities. Instead, they like to pillage and chase workers, forcing me to build more warriors and attack them. I consider this an improvement.
 
I played a bit with the revolution code to try to improve the choice of civ types in a revolution. So the attached code should do the following:
- Minor leaders are preferably spawned in revolutions (idea of Terkhen)
- Religious revolutions spawn compatible civs, e.g. a ashen veil revolution spawns Sheaim (I know that my selection is very subjective, to change it see RebelTypes.py)

Excellent! I like the changes and they seem to work great with the couple of test games I ran. Your changes will be included in the next beta release (coming soon). Thanks!

Tholal, I hope you don't mind me posting that in your Thread, I coded it mainly for me and thought it could be useful for you or anybody.

I certainly do not. In fact you might be able to help out with a couple of other things. I'll make a post soon with some notes about what I want to do with the Revolutions module.
 
One quick comment on the barbs: they seem a lot smarter now, and a lot less inclined to suicide themselves on my cities. Instead, they like to pillage and chase workers, forcing me to build more warriors and attack them. I consider this an improvement.

Glad you're enjoying it! ChrisAdams777 wrote the code for the new Barbarian AI. I had to dumb it back a bit because they were too smart!
 
Here are some notes I made about the Puppet States and Revolutions option.

Puppet States

Puppet States can be formed when a civilization with knowledge of how to form Vassal States conquers a city. Puppet States are created as a Vassal of the conquering player, and are the same civilization type as the previous city owner. Puppet States are a special type of vassal in that they don't get a Palace and are permanently a Vassal unless they achieve Legitimacy. A Puppet State achieves Legitimacy when it is the last remaining civ of it's civilization type. At that point it becomes a regular Vassal rather than a Puppet State.

Still to do:
  • Puppet States should be more prone to Revolutions
  • Puppet States should be unable to break away from their masters
  • Puppet States should have negative diplo penalty with their rival civ
  • Teach the AI to form Puppet States on occasion
  • Add text that shows up in Civilopedia when Puppet States option is turned on
  • Make sure this works correctly with cities that have changed hands from the original founder
  • Check for potential conflicts with Revolutions

Revolutions

Revolutions are based on the Revolutions mod.

Still to do:
  • Civics and buildings need to have their Revolutions XML tags tweaked and adjusted
  • Revolutions should occur more in large civs (happens to often to smaller civs at the moment)
  • Revolutions that are a result of a New Leader demand should spawn splinter civs rather than new civs
  • Check the way Revolutions choose to spawn rebel troops - maybe add weight for the leader's favorite troop types
  • New civs that are spawned should start as Minor civs?
  • Need a solid concept for what it means to be a Minor civ in FFH
  • Find way to incorporate the non-standard leaders (some work already done by lfgr)
  • Revolutions can allow defeated civs to come back into the game? - make sure this is working
  • Rebel units should be based on type of rebellion (for example, only give rebel religion-specific units when it's a religious rebellion)
  • Make sure AI understands how to handle Revolutions
  • Make sure this option works in multiplayer
  • Make sure the various player options work correctly (in particular, when the player is given the option of switching civs or taking over the rebel faction)
  • Add text that shows up in Civilopedia when Revolutions option is turned on
  • Bug - Rebel civs will sometimes be given civ-specific units that don't match their civ-type
  • Bug - Homeless Rebels can be Vassals
  • Bug - the Cede Power Revolution event seems to be doing weird things and sometimes crashing
 
Version 2.0 Beta2
  • BUG's Unit Naming module now works with Adept and Disciple units
  • Revolutions - Minor Leaders can now spawn as Rebels (code by lfgr)
  • Revolutions - Rebels that revolt due to Religious reasons will try to pick an appropriate civ type (code by lfgr)
  • AI - Fixed an issue that was causing the AI to build too many buildings
  • AI - AI more willing to use animal units for creating buildings
  • AI - AI more interested in Promotions that grant extra movement points
  • AI - AI civs in a Turtle strategy are more likely to Hurry production if they can
  • UI - disabled the Revolutions popup that appears when starting or loading a game
  • UI - new code for displaying ALTAR_OF_THE_LUONNOTAR progress on the Victory screen (code taken from Master of Mana)
  • UI - removing the RevDCMOptionsTab from Bug Options (most of these options arent currently implemented anyway)
  • UI - removing the power ratio options from Bug options
  • Bugfix - Scenarios should now work again
  • Bugfix - Temple of the Hand no longer adds +1 commerce on river tiles
  • Bugfix - added some missing BUG interface graphics
  • Bugfix - fix for ManaToggleHelpText issue that was causing python errors and not displaying the help text when mousing over the mana button
  • Bugfix - fix for python errors that would sometimes occur when founding a Religion
  • Bug fix - OOS fix by Snarko
  • Code - added some additional logging
 
Nice! :)

Yesterday I played a (scenario) game with r747 and noticed some issues. I have not tested them in the most recent revision (r758) but by judging from the revision log they probably have not been fixed yet.

The first one shows up when you try to start a scenario. It is just a python exception (I did not notice any problems). You can check it at the first screenshot.

The second one happens ingame, with the GP toolbar. At one time it displayed a 7% possibility of getting a Great Spy. I attached a screenshot too.

The third one is the Sevopedia. Some things (such as Traits) have an empty description page. Others (such as Units) have a description page that is only filled partially and they throw a python exception. The third screenshot shows an example of this.
 

Attachments

  • issue_scenarios.JPG
    issue_scenarios.JPG
    90.6 KB · Views: 59
  • issue_espionage.JPG
    issue_espionage.JPG
    288 KB · Views: 57
  • issue_sevopedia.JPG
    issue_sevopedia.JPG
    113.9 KB · Views: 50
Back
Top Bottom