[MOD] More Naval AI

Getting a WoC hang at the end of this turn: just hit "Enter" and watch that globe spin ... and spin ... and spin ......

I reloaded the earlier autosave and did a few things differently, but still get the WoC problem. Hope it's helpful for your debugging.
 
What kind of advanced tactics features can we expect? Is it safe to assume it includes those super forts? That seems like it could end up being quite useful for implementing some things I've been wanting in my modmod.


Could you give a rough estimate on when the next release will be? I'd like to know whether I should just polishing up what I have now to release it or wait to include your changes.


If just got to thinking that it would probably be a good idea for the pedia to to separate the spell sphere promotions, the same way it does races, items, and effects. I've never really tried editing the pedia and and still rather confused by things like SevoScreenEnums. I believe that actually determining what should go in that list would be quite simple in my modmod though, as all the spell sphere promotions and only the spell sphere promotions have bonus prereqs with bonusclass_mana. (In base FfH2 or More Naval AI it would be a bit more complicated, as only the first level of each sphere has the bonus prereq. I guess you'd have to check for channeling promotions as prereqs instead.)
 
What kind of advanced tactics features can we expect? Is it safe to assume it includes those super forts? That seems like it could end up being quite useful for implementing some things I've been wanting in my modmod.

Yes, I have merged Super Forts. The new stuff it adds will only be active if advanced tactics is on. Forts, castles, and citadels will offer new possibilities now. Special care was taken to make it appropriate for FFH2 by preventing forts from being built on mana resources (there is a new XML tag in bonusinfos to easily identify mana resources).

I can't answer your other questions. I was hoping Tholal would answer, but decided to answer what I could after a day.
 
Something I've noticed using this mod... On any premade scenario map (but not on a random map), Hyborem will always spawn on the southernmost tile that is on the same continent/island as an existing civilization, or within a few tiles of the southernmost tile, provided that tile is not within/very close to a civilization's borders (and then the script will choose the southernmost tile that otherwise meets those criteria and is not within/very close to anyone's borders). I have no idea why this would be, but it seems odd to me, and sort of frustrating when creating scenario maps that result in Hyborem always spawning in the same place. (Even random seed reloads don't change it.)

In general, I also feel as if the summoning of both Hyborem and Basium happens later than it should (and later than in base FFH2). Perhaps any AI with COS and following Veil (and with a given number of other techs?) should be forced to beeline Infernal Pact, and any AI following Order (or perhaps any Good AI) should be forced to beeline Fanaticism and build the Mercurian Gate if Hyborem has been summoned. Might also be good to improve the AI's selection of cities for the Mercurian Gate since Basium seems to get summoned in core cities of large empires frequently. Then he has very little territory to work with, no room to expand and no one nearby to conquer, which makes him boring and irrelevant. Alternatively, an AI who summons Basium could maybe be programmed to then donate some cities to Basium to make him a significant player.

As an addendum to the issue of Hyborem being summoned late, the AI appears to put very little stock in Sacrifice the Weak despite it being arguably the most powerful civic. I've never seen the AI adopt StW even when it's had Infernal Pact and followed the Veil for a long period of time. Perhaps the AI does not understand the benefits of StW while seeing that it has a lot of penalties? Similarly, the AI seems to overvalue Aristocracy, and nearly every AI will adopt Aristocracy unless they have a different favorite civic in that category--and they'll often run a cottage economy rather than a dedicated Aristocracy economy.
 
I've always found that feature of Basium to be the most frustrating. I'm talking about him as an opponent.

You have to fight your way in to get him, and he gets reinforcements the whole way. It's pretty easy for him to get huge, huge stacks of angels that he will throw at you.

Hyborem by comparison is really easy to take out.

Been a while since I've played this mod specifically as opposed to Magister's, but I've seen the Mercurians go pretty far afield. I've also seen them do nothing but stay close to home. No idea what's up with that.
 
Part of the problem with Hyborem is that the AI sucks with Mane usage.

For the AI ... either get a random +1 population point per "mane" and don't even bother with manes, or give the AI free upgrades for manes- but that may be OP.

I think the way that the code works currently is that EVERY mane for the AI becomes a useless unit that you must pay to become useful.

I have seen an AI with roughly 100 regular units and 300-1000 manes. On what I think was diety, mind you, but still sucky.

Currently the AI gets a (permanent) mane for every mane, meaning its always going to be a unit. Honestly though, I'm not sure about in Naval AI. I thought my test game was in naval AI, but its been so long ago ...

I see 2 solutions.

#1. teach the AI how to use the "add to city" spell for manes. And tell it to do this 99.9% of the time. (unless it has less than 2 units per city, which is unlikely)

#2. Have a random infernal city gain +1 population (if AI) and circumvent the mane production completely (again, only if its under the control of an AI)

---> I could see both of these, though mainly #2, producing some potential Bugs for multiplayer.

I'm not really sure how close the FFH modding community is to solving his problem (meaning the collective code libraries of all mod-mods), but I suspect that it has not yet been completely solved.

Also in the current code (at least in .41n) i seems that a point of population IS added for some fraction of the # of manes created. If that code is indeed there, then perhaps that fraction should be upgraded into a 1:1 ratio. Then of course, the AI should be taught to delete their mane units once completed.

So possible solutions (assuming that manes are going to be produced regardless, lest we produce even MORE bugs)

#1. increase passive Pop growth to 1:1 with mane production and teach AI to delete all manes.

#2. Teach the AI how to settle manes into cities 99.9% of the time, while reducing the "passive" pop growth to zero (or some decidedly small fraction as a 'buffer boost' to the AI)
 
I've always found that feature of Basium to be the most frustrating. I'm talking about him as an opponent.

You have to fight your way in to get him, and he gets reinforcements the whole way. It's pretty easy for him to get huge, huge stacks of angels that he will throw at you.

Depends who summons him. If it's a follower of the Order, sure. But he's frequently summoned by a follower of OO or FoL (or Esus), and then he's not even getting benefits from his ally's units dying. He also seems to turtle and not be aggressive when surrounded by ally territory (not really a surprise). I mean, it's great that there's this super-duper city that will be a hard nut to crack, but that really just makes AI Basium an easier Acheron.

Hyborem by comparison is really easy to take out.

True. The Manes issue Tasunke describes is part of it. Would help if Hyborem were routinely summoned earlier, too. He'd be less far behind in expansion, have more space to expand into and get more Manes.
 
In basic FfH2, the code that generated Manes includes these lines:

Code:
							if (pPlayer.isHuman() == False and iUnit == iManes and pCity != -1):
								if CyGame().getSorenRandNum(100, "Manes") < (100 - (pCity.getPopulation() * 5)):
									pCity.changePopulation(1)
									newUnit.kill(True, PlayerTypes.NO_PLAYER)
In my version I changed it to this, because the Add to City spell also spread the units religion and adds its xp to the city's production and culture in my modmod.
Code:
							if not pPlayer.isHuman() and pCity != -1 and iUnit == iManes:
								if CyGame().getSorenRandNum(100, "Manes") < (100 - (pCity.getPopulation() * 5)):
									if newUnit.canCast(gc.getInfoTypeForString('SPELL_ADD_TO_CITY'), False):
										newUnit.cast(gc.getInfoTypeForString('SPELL_ADD_TO_CITY'))




I wonder if it might be better to change the code so that the number of units that the player currently owns matters more than the population of the local city when determining whether the Mane should automatically added to the city. You could use a line like if pPlayer.getNumCities() *3 > bPlayer.getNumUnits():



On the other hand, it would be easier to just increase SPELL_ADD_TO_CITY's <iAIWeight>. It is currently only set to 10. It it were changed to 1000 then Manes should be as likely to add themselves to city populations as Basium is to claim a city where the Mercurian Gate was built.




The Infernals are probably already strong enough in my version though (especially since their are seven of them, and those summoned later usually start out with really nice cities which are likely near enemies who already have AV in their cities), so I don't know that they need such a boost in Magister Modmod.



It would not be difficult if you wanted to make it so that units belonging to Basium's teammates returned as angels, regardless of their religion, the same as do units belonging to Basium himself. You would just replace this
Code:
			if (unit.getReligion() == gc.getInfoTypeForString('RELIGION_THE_EMPYREAN') or unit.getReligion() == gc.getInfoTypeForString('RELIGION_THE_ORDER') or unit.getReligion() == gc.getInfoTypeForString('RELIGION_RUNES_OF_KILMORPH') or (unit.getUnitCombatType() != gc.getInfoTypeForString('UNITCOMBAT_ANIMAL') and [B]pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_MERCURIANS')[/B])):
				cf.giftUnit(gc.getInfoTypeForString('UNIT_ANGEL'), gc.getInfoTypeForString('CIVILIZATION_MERCURIANS'), unit.getExperience(), unit.plot(), unit.getOwner())
with this
Code:
			iBasiumTeam = -1
			iBasiumPlayer = cf.getLeader(gc.getInfoTypeForString('LEADER_BASIUM'))
			if iBasiumPlayer == -1:
				iBasiumTeam = gc.getPlayer(iBasiumPlayer).getTeam()
			if (unit.getReligion() == gc.getInfoTypeForString('RELIGION_THE_EMPYREAN') or unit.getReligion() == gc.getInfoTypeForString('RELIGION_THE_ORDER') or unit.getReligion() == gc.getInfoTypeForString('RELIGION_RUNES_OF_KILMORPH') or (unit.getUnitCombatType() != gc.getInfoTypeForString('UNITCOMBAT_ANIMAL') and unit.getTeam() == iBasiumTeam)):
				cf.giftUnit(gc.getInfoTypeForString('UNIT_ANGEL'), gc.getInfoTypeForString('CIVILIZATION_MERCURIANS'), unit.getExperience(), unit.plot(), unit.getOwner())
 
On an aside: Has anyone ever managed to make Lord of the Balors work in MNAI? I just did a crude attempt at editing ScenarioInfos and the Worldbuilder save to try to eliminate the null "Player 3" that seems to cause the problem. Unfortunately, my changes resulted in the three human players starting at war with Basium, Lethe (the last AI) not getting any starting units, and the game hanging at the end of the first turn. (Better than the auto-defeat that happens if you try to load the scenario in MNAI without edits, but far from a success.) I'm sure someone who actually knows their way around could do better than I, and I'd like to try Lord of the Balors out against a competent AI.
 
What kind of advanced tactics features can we expect? Is it safe to assume it includes those super forts?

Yes. Super Forts will be part of Advanced Tactics for the next release. Red Key imported the code and is tweaking and polishing it now.

Could you give a rough estimate on when the next release will be?

I can give a minimum estimate of two weeks, though it will likely be much longer than that.


Something I've noticed using this mod... On any premade scenario map (but not on a random map)

I use scenarios for testing all the time and have never noticed this issue. What scenarios are you playing where this happens?

Perhaps any AI with COS and following Veil (and with a given number of other techs?) should be forced to beeline Infernal Pact

Why is that? Summoning the Infernals does little to nothing to help the summoning player.

As an addendum to the issue of Hyborem being summoned late, the AI appears to put very little stock in Sacrifice the Weak despite it being arguably the most powerful civic.

Are you talking about the Infernals or other civs following the Veil?

Part of the problem with Hyborem is that the AI sucks with Mane usage.

I just ran a test and the AI was using Manes to grow their cities.



In basic FfH2, the code that generated Manes includes these lines:

Code:
							if (pPlayer.isHuman() == False and iUnit == iManes and pCity != -1):
								if CyGame().getSorenRandNum(100, "Manes") < (100 - (pCity.getPopulation() * 5)):
									pCity.changePopulation(1)
									newUnit.kill(True, PlayerTypes.NO_PLAYER)

Yet another strange AI workaround hiding in Python. I commented these lines out and the Infernals didnt seem to have any problems using their Manes to increase their city populations.

On an aside: Has anyone ever managed to make Lord of the Balors work in MNAI? I just did a crude attempt at editing ScenarioInfos and the Worldbuilder save to try to eliminate the null "Player 3" that seems to cause the problem.

You have to put a player into Slot 3. I'll include an updated scenario file for my next release.
 
I just ran a test and the AI was using Manes to grow their cities.

Sounds good.

I think I'll do a test sometime over the weekend to see if we still see the "mass 300 manes" issue or not.
 
I'm very happy with this mod. I had stoped play fall from heaven as the AI was so silly building only warriors and bankrupting themself.

When I played the barbarian invasion scenario as Ljosalfar Sheelba was not in the game so it did not seem winnable.

Also Hippus seems to underestimate the strengh of the withdraw promotions. All his chariots had only strength.

After we defeated Hafnar, Hippus declared war on me while being friendly. I did not think the AI did that.
 
hmm.

If every unit has an inherent withdrawal chance ... does said chance cancel each other out? Also, what is the precise value for this inherent chance, or does it depend on the unit.

(For instance, did you add +5% withdrawal to all units, meaning that Champs now have 5, Mercs now have 15, and horsemen now have 35)
 
There is something wrong with XPs. Seems like most units can't get more then 100. I had an archer with 100 that was unable to get more, but then I upgraded him to a horse archer and he was able to get experience again.
 
Could you add a <iInstanceCostModifier> tag in CIV4ProjectInfo.xml? I find that the repeatable rituals are being completed too often and too close together in my modmod, and would really like to be able to make them become more expensive every time they are created.
 
There is something wrong with XPs. Seems like most units can't get more then 100. I had an archer with 100 that was unable to get more, but then I upgraded him to a horse archer and he was able to get experience again.

was he fighting barbarians as an archer and nationals(Civilized Soldiers) as a Horsearcher?
 
Back
Top Bottom