RHQ Artificially Intelligent AI Mod

RHQ Artificially Intelligent AI Mod RHQ AI Mod 2.10

Had a look into the mod code - it strongly deemphasizes coastal tiles for settling - so I guess I found my explanation why settling doesn't work as well on Fractal (and similarly watery) maps, too. It's probably not Carthage, but the slightly more snaky part of the continent in @KayleeR 's case.
Are you saying as of today, with this mod, the AI would on average perform better on continents vs Fractal from a settling aspect, due to that code you found to de emphasize coast?

March 25 they release the “unbalanced” starting position maps so maybe those will be better. (Sounds like not just a different starting position but a different MAP altogether)

March 25 also will touch forward settling but this mod already addresses some of that so shall see how much impact.

I play fractal now coz maps shapes are more interesting less predictable, but I don’t want to keep playing this map type for the next 10 days knowing the AI is handicapped, as my whole objective is to keep the challenge high.

P.s. I am paranoid to try modded maps atm due to potential bugs / conflicts
 
Last edited:
@Morgawr I think the mod is simply optimized for the typical continental blocky maps (since @notque mostly uses those in his autoplays, I assume?). Or maybe it's just harder for some water-oriented civs? Not sure.
Anyway, the base AI has always looked better to me on Fractal than on Continents (possibly because it values coastal settlements highly) - so the difference in performance is still there, but gets smaller.

You could go for a large fractal map (with Gedemons mod), I guess? Looked good to me when I tried it and would give the AI more continental space to settle (but probably result in fewer wars?).

There are other settling preferences the mod changes / flattens, so this is more complex than this one dimension. And it's not based on hard data (just what I think I'm observing).

(And: FXS may have shot themselves in the foot by releasing these blocky "balanced" map types first, but that's a different issue.)
Got it thanks! Think I will play thru my fractal game first - this time I’m determined to finish and see how AI does in cultural victory, unless I become super runaway by end of exp.

After that will revert back to Continents+ and after that the March 25 map will be out
 
Had a look into the mod code - it strongly deemphasizes coastal tiles for settling - so I guess I found my explanation why settling doesn't work as well on Fractal (and similarly watery) maps, too. It's probably not Carthage, but the slightly more snaky part of the continent in @KayleeR 's case.
It's possible that Carthage has another hidden coast bias somewhere that brings added confusion, but I didn't find anything suspicious.

Edit:
@notque This one
View attachment 725327
needs to look like this to work properly
View attachment 725326

... I doubt that it makes a huge difference though.

There are several reasons I have it avoid coast.

1. Coast isn't inherantly better. Having high values for wanting the coast overrides resources.
2. It makes an ideal city being all coast tiles, and 1 land tile often. These cities are not great.
3. Being on the coast, especially in antiquity is a negative. There are IPs with heavy boats. Just like humans, settling one tile or more off coast is better. You can build a quay, and do your own thing.

But it's mostly that having the values be stronger than actual resources creates very bad city locations, and very weird settling decisions.
 
Hello, I wanted to ask: Did you guys change something in AI behavior when it comes to winning by the economic route in modern age?
I will describe what happened: I was playing on an immortal difficulty, Asoka AI leader finished the economic route in modern age (all 500 points) before anyone could even start it. I was happy for it since it meant that AI is challenging and expected Asoka to win in like 15ish turns max. Then after like 20-30 turns I was able to catch up to Asoka and got my Great Banker and yet Ai still didn't win. After next 20 turns I was able to complete almost all the capitals with my GB and the game was still on, despite Asoka sitting on like 1700 points in the economic path. I waited another 20-30 turns to see if Asoka will win but nothing was happening besides him and other AI getting another steps towards other victories. At some point I noticed Asoka's Great Banker just swimming near borders one of my cities which surprised me since I started doubting he even moved him. But it was strange, why Asoka was just normally moving his GB instead of teleporting him to other civs capitals like player can do? Maybe AI isn't coded to teleport GB? Not saying that it had to be your guys mod doing, just asking since I know vanilla AI is already horrible at certain simple tasks. Perhaps me playing on a modded map had to do something with screwing AI? For the record, AI was playing well and normal on this modded map, the whole game was normal until this economic win issue and Asoka still won by the science route in the end when I decided to wait and see what will happen. Sorry for this essay, just wanted to provide as much context as needed.
There are changes in the AI behavior to encourage them to actually try to win.

I assume whatever the particular case is, we have to look at it specifically, and make adjustments.

That is Roman Holiday's side of the mod, so when he has time to look at it, I'm sure he will continue to refine it.

I could not imagine it's any worse from anything that has been done. It's just multi variant on the things that need fixed, and each one requires more adjustments.
 
You think that AI can decide to go for a different path even if it already has one path completed and ready to win?
I can't answer without looking. I think Roman added something specifically to have them try to stay on one path.

It's always in the details though, it takes time and effort to sort out every potential way it can go off path.
 
I just played through a game in Antiquity age with ynamp's continents plus where Augustus as Carthage didn't settle a single town until very late in the age and only managed to get to 3 settlements by age end. There might be something messing with the AI logic when playing Carthage. I didn't even expand towards him early so he had plenty of room (Korinthos was pretty late) and I saw a settler roaming right through the middle of my territory in early-mid game as well. This is with version 2.03.

View attachment 725242
There are so many different ways this can happen. I've fixed many of them.

I would have to see the exact auto play of this particular method it's happening to trouble shoot. I'm sure it will come up for me on autoplays at some point.

It's find them, sort out why, fix the specific reason that particular settler got stuck.
 
I've seen this in vanilla quite a lot but only rarely with this mod. I think what happens is that the settler gets stuck and they don't build a new one. In my games with this mod, Carthage tends to expand like crazy, but they have the same issue as Egypt and some others where they favor expanding very far away for some reason. Since IPs are so rampaging in this mod, it's probably more likely for their settlers to get ganked.

There are so many different ways it can happen, I just can't talk about it generally. I fix them every time I get a case where I find them.

But I have to run into each one, and then devote the time to sort it.
 
Are you saying as of today, with this mod, the AI would on average perform better on continents vs Fractal from a settling aspect, due to that code you found to de emphasize coast?
That would be the wrong conclusion, and would make me believe you don't understand the net impact of the coastal change.

Of course weird things happen, I don't test on fractal map as much. But I do test on it.

What that does is give points additionally to a plot for having coast. In the base game, that number is super high, making a 1 tile land with all coast around it the best possible settle spot.

You wouldn't agree it's the best possible settle spot. So what we know then, is the value of a single coastal tile is less than the default number.

Okay. So what is the value? If a bonus resource has a value of 2 points on the tile, how valuable is it if that tile is coastal?

I argue that so far, the best possible setting for that is 0. It shouldn't be concerned with the number of coastal tiles. It will naturally settle close to the coast, and be able to make ships.

You can see that in the autoplays. I don't see how that would do anything but improve the AI on Fractal.
 
3. Being on the coast, especially in antiquity is a negative. There are IPs with heavy boats. Just like humans, settling one tile or more off coast is better. You can build a quay, and do your own thing.
100% agree, in my current game the same thing happened that you mentioned a few weeks back in your autoplay: AI lost a coastal town to an IP galley, galley invaded and razed the town, then the galley got stuck on land in the old town hex for the rest of antiquity like 80 turns! (Not sure why it can’t just move back on the water…)
 
I will be doing some modding and autoplaying on twitch in the next few minutes. just getting some tea ready.

I will be hunting for bugs and weird things to improve. I also have many other stacked ideas I need to get to, maybe I work on some of those.

For this autoplay, I will be using the classic civ mod allowing all civilizations to be played through all ages so you can stick with 1 all game.

I will specifically looking for anything I need to do to improve support for it.

Also on fractal since it was brought up
 
Last edited:
To be clear, you're probably right about that.

But I'm confident that I have seen some weird / weak settling behavior on Fractal (especially from Carthage).

The rest is guesswork from me, but it seems reasonable that the AI is looking for a certain settlement value and in some cases either doesn't find it at all or travels across the map to get to the spot. (Since there are simply fewer non-coastal plots on Fractal.)
The changes do nothing to make it avoid coast.

It doesn't value coast. That's different. The AI often settles coastal.
 
Last edited:
In the autoplay on fractal, the biggest limiting factor for the AI was not building enough boats.

Nothing to do with settling, it was that it couldn't effectively handle the IP boats. I will make adjustments to try to help that.
 
They do (especially on protected spots inside bays, that's nice) - just not always where I would expect them to. But probably the AI just can't deal with Carthage's strangeness.

There can be a lot of black ships on Fractal that may come to attack - or not... Hard to balance the risk and ending up with a bunch of useless + expensive ships (and they'll probably build some stupid ships in inland seas etc.).
The way to deal with them (as a player) is usually to shoot at them with archers / catapults from safety until they sink or go away. The AI likes to take their archers on a swim though.

And the base AI naval logic is still not great, I hope FXS work on that. I spotted them sinking themselves on Open Ocean a couple of times (in Exploration)
Yes, this is the largest problem.

The risk of the worst case scenario, and the best case scenario are so wildly out of distance with each other that it is impossible to handle many of those cases.

You hit the nail on the head.
 
I think I’ve encountered a significant bug.

Attached the save files. In the first one at turn 50, I realized I was likely going to lose, so I used the Shift + Enter shortcut to skip through the rest of the match (this lets you pass the turn even when notifications are active). I did this just to see when the AI would eventually secure its victory.

One odd thing I noticed was that Amina took an unusually long time to conquer just one of my cities—about 20 turns—while I was just passing turns and occasionally moving a unit out of the general's area without actively attacking. After taking that one city, she suddenly offered peace, even though another of my cities was on the brink of falling.

However, the main issue seems to lie with my only island city to the east.. In the attached save from turn 65, Benjamin destroyed the city’s walls (few turns ago), but since then, he’s been repeatedly attacking the city with bombers, while all his other units just stand still in front of it. No idea why they’re not moving. After another 20 turns or so, a new units arrived from somewhere and finally captured the city.

I’m wondering if the use of airplanes might have caused some kind of bug or disruption with the rest of his army? I remember the mod was mainly tested in antiquity, so maybe the inclusion of airplanes broke something? He's basically using almost everyturn an airplane to attack a city with 0 HP while instead the untis to take the city do not move.

Aside from this issue, the mod and the match were really enjoyable. This is actually the first time I’ve lost to the AI, and they even managed to take one of my cities in antiquity, so that was a nice challenge.
 

Attachments

I think I’ve encountered a significant bug.

Attached the save files. In the first one at turn 50, I realized I was likely going to lose, so I used the Shift + Enter shortcut to skip through the rest of the match (this lets you pass the turn even when notifications are active). I did this just to see when the AI would eventually secure its victory.

One odd thing I noticed was that Amina took an unusually long time to conquer just one of my cities—about 20 turns—while I was just passing turns and occasionally moving a unit out of the general's area without actively attacking. After taking that one city, she suddenly offered peace, even though another of my cities was on the brink of falling.

However, the main issue seems to lie with my only island city to the east.. In the attached save from turn 65, Benjamin destroyed the city’s walls (few turns ago), but since then, he’s been repeatedly attacking the city with bombers, while all his other units just stand still in front of it. No idea why they’re not moving. After another 20 turns or so, a new units arrived from somewhere and finally captured the city.

I’m wondering if the use of airplanes might have caused some kind of bug or disruption with the rest of his army? I remember the mod was mainly tested in antiquity, so maybe the inclusion of airplanes broke something? He's basically using almost everyturn an airplane to attack a city with 0 HP while instead the untis to take the city do not move.

Aside from this issue, the mod and the match were really enjoyable. This is actually the first time I’ve lost to the AI, and they even managed to take one of my cities in antiquity, so that was a nice challenge.

Great news that I got air units to work. Terrible news that they aren't taking the city.

It means the base game behavior tree is broken there. So I will have to create a custom test to solve it, or someone needs to give me the Behavior Tree log, and tell me what turns it happened, and what player number.
 
Great news that I got air units to work. Terrible news that they aren't taking the city.

It means the base game behavior tree is broken there. So I will have to create a custom test to solve it, or someone needs to give me the Behavior Tree log, and tell me what turns it happened, and what player number.
What is the behavior tree log? If it's something I can give you I will, but I've no idea how
 
I've come across the AI not fighting back with their naval units. I killed a fleet commander and scattered the packed fleet, and I wiped the fleet without AI fighting back.
That's weird. In the current released version?

Is it the same in base game? There are times where units get stuck. I don't think there's anything in particular we have changed regarding that.
 
Back
Top Bottom