[MOD] More Naval AI

Congratulations on r1000 :)

I'm thinking that maybe the new dynamic scale code could be used for the Adaptive trait too. Also, I noticed that Paramanders can only be built if you have copper. I would expect to be able to build them if I own only iron or mithril too.

EDIT: While testing some changes unrelated to AI with AIAutoPlay, the first thing that the AI did (leading the Grigori) was switching to Religion. Since Agnostic leaders cannot benefit much from Religion, shouldn't they prefer Nationhood or Pacifism instead?
 
I'm thinking that maybe the new dynamic scale code could be used for the Adaptive trait too.

Good idea! I'll add that to the next release.

Also, I noticed that Paramanders can only be built if you have copper. I would expect to be able to build them if I own only iron or mithril too.

Interesting. I wonder if there was some sort of lore reasoning behind that or if it was just an oversight. I'll look into it.

e first thing that the AI did (leading the Grigori) was switching to Religion. Since Agnostic leaders cannot benefit much from Religion, shouldn't they prefer Nationhood or Pacifism instead?

Religion does seem an odd choice for Agnostic leaders. I'll muck about with the Civics code a bit and see what I can do.
 
That has nothing to do with Tholal. Unrestricted leaders has worked that way in FfH2 in a long time. Personally I prefer it that way.
 
I think that we can always have two different options, if the current one is desirable too. If Tholal prefers to not implement it, I still would like some pointers, as I would like to add it to my own build but I was unable to find where is the problem in the code.
 
I have a question about something that bothered me about vanilla BTS and I *think* carries over to FFH:

In BTS, if I have a Privateer blockading a rival city, at some point the AI decides to do something about it and will build a ship. Said ship attacks -- but I lose my Privateer. Not because I lost in a fair combat, but because two ships attacked. Meaning, when the AI builds a ship, it builds two simultaneously, giving the AI a naval advantage over human players.

I haven't directly seen this happen in FFH, because I tend to use more of a land-based strategy over a sea-based one (even as Lanun), but if this is the case, this ability of the AI needs to be nerfed.
 
I am curious about quests and the AI. If I were to add a "Holy Mountain" style quest where you must control a certain plot would the AI actively try to complete the quest? If yes, then how active would they be about trying to control the plot i.e. would they declare war if need be to get the plot?
 
Could you make it so that Enraged units use an AI type that causes them to attack the nearest unit whenever possible rather than running off?


Why it is that in your mod it seems like the Airport Icons are not showing up in the city bar, but in my modmod they are showing up as smiley faces? I would rather them show up as the Dimensional Mana icon or something, but have not figured out how to change it.
 
I'm attaching the required code for splitting the Puppet States and Revolutions options. I ran two test games with AIAutoPlay for each option and everything seemed to work fine. It could use more testing though :)
 

Attachments

  • Split_puppet_states_and_revolutions.rar
    1.3 MB · Views: 50
I think that we can always have two different options, if the current one is desirable too. If Tholal prefers to not implement it, I still would like some pointers, as I would like to add it to my own build but I was unable to find where is the problem in the code.

The option is GAMEOPTION_LEAD_ANY_CIV. I dont know where in the code the AI players are picked. I would imagine its in CvGame or CvInitCore or somewhere like that, but I wasnt able to locate it myself.

Does anyone have any stategies for Into the Desert?

I havent played that Scenario myself. You might be better off checking/posting in the Strategy sub-forum.

Meaning, when the AI builds a ship, it builds two simultaneously, giving the AI a naval advantage over human players.

The AI does not get any sort of advantage like that in FFH.

I am curious about quests and the AI. If I were to add a "Holy Mountain" style quest where you must control a certain plot would the AI actively try to complete the quest? If yes, then how active would they be about trying to control the plot i.e. would they declare war if need be to get the plot?

It could probably be done but would require implementation of a new victory type and coding the AI to understand what that victory means and how to achieve it.

Could you make it so that Enraged units use an AI type that causes them to attack the nearest unit whenever possible rather than running off?

Don't know what you mean by running off. I just checked the code and they're set to look for targets within 3 tiles at first but they dont just hit the first target they see. They might be trying to find targets that are more than 1-turn away. I'll try setting them to first go for targets they can reach immediately before looking farther afield.

Why it is that in your mod it seems like the Airport Icons are not showing up in the city bar, but in my modmod they are showing up as smiley faces? I would rather them show up as the Dimensional Mana icon or something, but have not figured out how to change it.

Good question. Are you using a different Gamefonts.tga file?

I'm attaching the required code for splitting the Puppet States and Revolutions options. I ran two test games with AIAutoPlay for each option and everything seemed to work fine. It could use more testing though :)

Cool! I'll check it out.
 
Don't know what you mean by running off. I just checked the code and they're set to look for targets within 3 tiles at first but they dont just hit the first target they see. They might be trying to find targets that are more than 1-turn away. I'll try setting them to first go for targets they can reach immediately before looking farther afield.
Thanks.

People in my thread were complaining about Berserkers (which have Crazed and thus can get enraged in my modmod) running off to find targets, but what really bothers me personally is that enraged summons ignore nearby targets to move towards something they cannot reach before their duration expires.

Good question. Are you using a different Gamefonts.tga file?
I do have custom Gamefonts.tga and Gamefonts_75.tga files, as I added icons for 2 new resources, some new religions, and I reorganized the religions. I did not touch the bottom couple rows of icons in either file though. The smile faces and all the icons used by BUG seem to be unchanged.

The thought just crossed my mind that it could have to do with the fact that my obsidian gates allow 2 airlifts rather than one, but editing yours to be the same did not make the smilie faces appear.
 
Version 2.2 Official Release (not compatible with any previous saves)

Download link

Bugfixes
  • Paramanders can be built with any metal, not just copper
  • Adaptive trait switches are now dynamically scaled by game speed
  • Stasis, Arcane Lacuna and Sanctuary are now dynamically scaled by game speed
  • World class units can no longer become slaves
  • Summoned transport units will try to unload cargo when they expire
  • Diseased Corpses and Soldiers of Kilmorph will never be obsolete
  • Religious units can no longer upgrade to religious units of other religions
  • Barbarians can no longer create Puppets
  • Tolerant is now a Civilization trait for the Elohim
  • Insane trait switch will no longer affect Civilization traits; Insane will now dynamically add traits based on how many it removed (previously it would always add 3)
  • Infernals and their Summoners will now have Embassies auto-established with each other upon summoning
  • Great Generals can now join Adept units
  • SPELL_RECRUIT_MERCENARY is now considered an Ability rather than a regular Spell (ie, its no longer affected by Arcane Lacuna)
  • Fix for Theatre of Dreams graphic in city mouseover help
  • Add to Freak Show now requires a Freak Show in the city
  • Illusions can no longer do Great Works, Golden Ages, Construct Buildings, Join cities, or Join troops
  • Fix for potential crash in mod-mods if they didnt have the teach_spellcasting spell
  • Hall of Mirrors will now randomly choose a nearby unit to copy (previously it was always choosing the last one)
  • Fix for Auto-explore units not healing
  • Eyes and Ears network will no longer grant techs that the owning player is not allowed to research
AI
  • AI will calculate actual maintenance costs when evaluating civics (code from K-mod)
  • AI will now consider number of defenders when picking a barb city to target
  • AI more interested in attacking civs that control their cities; AI more interested in attacking weak players if they are pursuing a Conquest victory or the Aggressive AI option is on
  • AI now takes level and ExplodesInCombat into effect when choosing a best attacker from a group
  • AI more willing to use melee units for city defense
  • AI more interested in techs that give free Great People
  • AI more interested in techs that allow them to connect cities when playing with the Revolutions option
  • AI more likely to build Missionary ships if it finds itself with an overabundance of Missionary units
  • AI more interested in using Summoned units for combat

User Interface
  • Sevopedia - Civilization heroes are only displayed once on the Civilization screen
  • Sevopedia - all buildings and units should now be displayed in the Sevopedia
  • Improvements to the way Negative and Positive factors are displayed for Revolutions data
  • Announcements for Projects completed by civs that you have not yet met will display a more ambiguous message (code by Terkhen)
  • Spread out the icon spacing a bit on the Unit Upgrades graph
  • Slightly more descriptive text for Freak Show Cages
  • New Spell that allows players that are at peace with the Barbarians to declare war on them (code by Terkhen)
  • Alphabetically sorted Leader and Civ lists (code by Terkhen)
  • Lots of text updates (Hall of Mirrors, Demonic Altar, Flammable features, mana-providing features, more)
  • Captured/converted units will retain their original artstyle (code by lfgr)
  • Mirrored units will copy the artstyle of the unit they are mirroring
Misc
  • Advanced Tactics - Advanced Diplomacy: Disciples and Tier 1 Scout units can cross borders with a Rights of Passage agreement
  • Flavor Tweak - Insane trait switch also results in a random -3 to +3 attitude change will all other players (idea and code taken from MagisterMod)
  • Code - Opening up Espionage for modders (requires that the NO_ESPIONAGE option is not set to off by default in the XML)
  • Code - speed tweak from lesslol
  • Revolutions - change to the way the Revolutions mechanics calculates civ size
 
inflation kills - inflation is the biggest expenditure financially. thre are building and civics for maintenance reduction but not for the infltion. I'm playing with no inflation option in Magister's mod now.
 
Thanks for the new version, but it seems like the change I requested ("Summoned transport units will try to unload cargo when they expire") is not working. All the units I loaded into my Rift were still killed along with it. (I'm pretty sure that it was working fine in Broader Alignments, so if you have any trouble figuring it out on your own you can look at its code.)

I just tried to see if I could add another spell with its effect in the prereq to unload all the units from the Rift once it has moved, but it seems that unloading units is not exposed to python.
 
Did you add the tweak that speeds up the turns?

It's listed in the new version's log under "misc". I did not notice the improvement while testing, though.

Yep. Its in there. To be honest, I didn't quite see how that change could improve turns from 120 seconds to 4 seconds as lesslol stated, but I did incorporate his code.

I think the mod already plays pretty quickly. I definitely don't ever have any 2 minute turns unless the Illians are finishing their Deepening project. *shrug*


Thanks for the new version, but it seems like the change I requested ("Summoned transport units will try to unload cargo when they expire") is not working. All the units I loaded into my Rift were still killed along with it.

I just tested using your mod with a Water Elemental. Loaded up a ship, hit end turn, and the elemental was gone but the ship remained. I couldn't find a 'Rift' unit in Worldbuilder to test with.
 
Top Bottom