tldr: new update to the AI in areas such as shrine placement, consulate and church upgrades, use of new cards by Africans and Inca such as houses gathering wood and age 2 neftenyas. improvements to dojo spawning by forcing yuumi so it doesnt constantly cancel production.
as always, anything I made or modified is free for anyone to use, no need to contact me. no credit is wanted or required, have fun with it.
Increasing Aggression
I actually reduced how aggressive the early ai can be by modifying the setMilPopLimit since I preferred a tech advantage over a larger military. it now maxes out at 50 units for each age under maximum to ensure speedy age ups, but if someone wants to massively increase aggression you can.
just change the limits to 160 for each age in setMilPopLimit, and reduce the priority in the ageUpgradeMonitor rule. expect a horde mode style relentless attack from the ai, but with significantly slower age up times.
notepad++ with language set to c++ makes reading and modifying it significantly easier. ctrl+f is your friend. ctrl-z to go back, ctrl+shift+z to go forward when troubleshooting mistakes.
Figuring Out Shrine Manager
I knew the forwardshrine manager was awful and that I could make something much better, but as I dug deeper into influenceposition and kbUnitQueryCreate I realized had I no idea how they worked. if anyone could explain them to me that would be great, because after hours of messing with them I’m still not certain on how they function.
I wanted the ai to check for viable hunts spreading outwards from the main base, with priority on those closer to main base and a preference for jap monks over villagers. this was harder than I realized and I’m still not satisfied completely with the result.
in the end in selectShrineBuildPlanPosition I made the search range into 1000 units, and made a linear falloff influence position of 1000 units as well with a 1000 point value. the results are significantly better than before, but I’m still not entirely happy with it.
I then thought of using a global bool to check if a jap monk was alive and if so use him, but again I wasn’t entirely sure how the kbUnitQueryCreate query worked or global bools for that matter.
so I went with a simpler solution of hacking repurposed tc code into the addbuilder section so that whenever an ai wanted to build a shrine, it would first look for a Japanese monk and if that failed a single villager. that solved the big issue of villagers walking halfway across the map to build a shrine.
I used that same code so that heroes are priority for trade posts.
Consulate Livestock Pen Issues
I found out while testing the ai that for some reason it liked to spam livestock pens after unlocking them at the consulate. this was unacceptable, and after failing to troubleshoot why this happened I resorted to addbuilder again.
whenever it wants to build a livestock pen it now checks if there is one already alive. if so, no builder is added to the livestock pen and none is built. hopefully this means the ai only loses 200 wood reserved for a new livestock pen, and it seems to work. whenever a livestock pen is destroyed the ai builds a single livestock pen to replace it.
Dojo And Plaza Spawning
ai just keeps switching dojo choices, resulting in lots of wasted seconds. I removed dojo switching in favor of just spamming Yumi. you can never go wrong with more Yumi.
also unit spawns from plaza are completely disabled except for warrior priests. they hurt the ai far more than they help, especially with the constant switching.
I also tried to get Inca to spawn priestess using Aztecs warrior priests as a basis, but that made the game crash. what’s up with that?
New Cards and Kancha Wood
thankfully most cards have the same techname as they are ingame, and that made them very easy to add, early kallanka being an exception. I wanted to do some more aggressive stuff, but as I am not entirely sure how influence manager functioned I held off on cards that buffed units like maigadi. early neftenyas are a compromise on that, though I’m not sure if this helps the ai enough to warrant its usage over a different card (probably not).
I knew as soon as I saw the patch notes that I wanted the ai to use wood gathering houses, and it was surprisingly easier than I expected. using factorytactic code as a basis and finding the inca house tactics file, inca houses now switch to wood when they have at least 1000 food in the bank and food is atleast 1/10 of the resources they own.
Going Forward
One of the things that I really wanted to implement was a chance for different individual ai strategies as well as teamwide fb aggression. having an ai execute a 5 hussar semi ff, a Spanish tower ff, a dutch pike flush, a German tower rush or an ottoman Fast revolt as well as a good human player, as well as a chance for a teamwide fb rush on a player would really put the ai in a place that i would say its nearly finished. but like unitquery I am not sure how ForwardBaseManager functions.
walls are a big issue and may need work from the devs for it to function optimally, but hey CWALLGATE IS HERE WE CAN START MODDING IT IN FOR EVERY CIV. its on the things I want to add to the ai for sure.
the Africans are a little strange and slow to age up, same for the Lakota. idk why, I haven’t touched their age up choices at all. but they fight very well.
overall the addition of an error message that explains the error when loading the map has made modding the ai much more fun, faster and less stressful, and I actually enjoyed messing around with it after this was implemented. major qol upgrade. the base ai is also so much better that i left most of it intact, mostly things like cards and unit compositions are modified. and that’s always a good sign, and hopefully an indicator of things to come.
thanks for reading, and gl hf.