Buffed AI for BNW

Update of my above game thru the rest of the Modern era:

I hosted the World Olympics, Indonesia completed the Louvre, Austria completed Statue of Liberty.
Austria married a 3rd city state.

Indonesia declared war on Celts, so far they took 2 Celt cities and burned both to the ground, the war is still ongoing.
Later Austria declared war on Indonesia, but all that's happened from that is that Indonesia conquered Austria's remaining city state ally. This war is still ongoing.

This leaves a total of only 4 city states left in the game (from the original 8), of these 3 are my allies and Indonesia is allied to the remaining one.

The world council expanded its infrastructure from half the civs reaching modern era a few turns before I entered the Atomic Era.

Turn 289 stats (beginning of Atomic Era)

Austria is 8 techs behind. They are content with their Freedom. Their happiness is +7. They are #1 in food production. I'm currently on pace to become influential over them in 18 turns.

China is 7 techs behind. They are experiencing Civil Resistance to their Order. Their happiness is -1. They are #1 in land area. I'll become influential over them next turn.

India is 8 techs behind. They are experiencing Civil Resistance to their Order. Their happiness is +1. They are #1 in population. I'm currently on pace to become influential over them in 36 turns.

Indonesia is 13 techs behind. They have not adopted an ideology yet. They are #1 in troops. I'm already influential over them.

Sweden is 18 techs behind. They are dead last in happiness. I'm currently on pace to become influential over them in 19 turns.

The Celts are 21 techs behind. They are dead last in everything else. I'm dominant over them but its questionable that they've survive the rest of the game.

Austria, China, and India are the only AIs that have been making RA agreements with each other.
 
Thanks Joncnunn. I think you would agree that the AI is still too far behind in tech late game. It is very likely that is because the AI is getting unhappy and turning off the buff. In the next V18 beta, I'm making the adaptive buff gradually turn off with AI unhappiness. At the moment it completely turns off at -1 unhappiness. So I'll make it turn off with increasing unhappiness. I think at -10 it will be fully turned off.

EDIT:
I'm also testing a method to adaptively buff the AI when it starts lagging behind in tech. It has the added bonus that it stops the incentive of humans from bulbing great scientists to avoid the adaptive buff. With the change, if you bulb a great scientist and increase your tech lead, you just feed more science yield to the AI. I found that there is too much incentive to bulb great scientists in my opinion.
 
Ok, I think this version will be the final for V18 (I hope!)

  • AI adaptive buff gradually tapers off with unhappiness
  • AI adaptive buff adds extra buff for AI-player tech difference

Been thinking about the national college. I don't think there is any need for it to be changed, same for Oxford. The reason is that in V18 beta 5, there is no hurry for a player to build them, because often the benefit just feeds to the AI adaptively anyway.

Also, in this version, bulbing scientists on mass, or gaming the RA system is not going to help the player much, because if the tech difference between the player and the AI builds up, the adaptive buff leaks more science to the AI to compensate.
 
Ok, I think this version will be the final for V18 (I hope!)

Been thinking about the national college. I don't think there is any need for it to be changed, same for Oxford. The reason is that in V18 beta 5, there is no hurry for a player to build them, because often the benefit just feeds to the AI adaptively anyway.

If you're referring to delaying the tech that's tied strongly to switching national wonders logic to no longer require a copy in every city. A variation of prisoner's dilemma applies for building NC due to its strong strength. If an AI is first to build NC, then during that time they will rocket ahead of both the human and all the other AIs even though the science adaption would be turned off. Of course if the human is first, then the human building it would turn on the adaption. So the human is best off if everybody delays, but cannot rely upon the AI to do so and so is compelled to race to it when its as early as Philosophy. (It's still kind of a race at Education, but there's a whole lot more tech paths to that.)

Also the base game timing is quite a bit off for a 500 turn limit, and the last thing it needs is NC built even faster than in base game.
 
Thanks for the analysis. I'm looking forward to you and anyone else trying V18 beta 5 because it totally changes the whole science race, give it a go. You won't be familiar with the changes I've made since V18 beta 4, they are different.

In beta 5, if an AI does get early NC, it means that the AI won't get the extra buff to help it catch up in tech because it is already teching ok. As we know, its tech rate never really snowballs however, and so the player then has the chance to bulb scientists at crucial points to catch up and exploit a specific strategy. On the other hand, if the AI delays NC, they fall behind in tech but then get the extra science buff to help them catch up. In that case, human bulbing of great scientists is not going to work well unless there is some tech that is really badly needed, because quick tech gains will invoke the extra science buff.

So V18 beta 5 is a game changer in the science race. I think it calms the science rate issue right down and causes the game to be about population, culture, building, warfare, faith, territory and tourism (and specific science strats) which I think is better for an all round experience.

The other thing about V18 beta 5 is that I honestly doubt that any of the big civs are going to be behind in tech any more, which should make the endgame a lot more exciting.

EDIT:
Fingers crossed. I've tested it and it works mechanically, just need game experience with it (including help from you guys) before releasing proper.
 
Hey there. Pulled V18 beta 5 because something weird is going on (build crashes on first turn in autoplay) and Mongolia stopped teching about 100 turns in.....All the other civs were fine :crazyeye:

Beta 4 was fine and I played through an entire game on it.

Should be able to sort it soon.

In the mean time V18 Beta 4 and 5 are save game compatible.

Cheers
 
Hey there. Pulled V18 beta 5 because something weird is going on (build crashes on first turn in autoplay) and Mongolia stopped teching about 100 turns in.....All the other civs were fine :crazyeye:

AI Mongolia using its UA and getting all the other AIs mad so it wasn't able to trade luxuries in turn causing happiness problems?

Edit: My above game is now over. Cultural Victory turn 301 (1862 AD), still in the Atomic Age. My score was high enough for Abe Lincoln.
Basically I faith bought a Great Musician when it was worth 3830 the same turn a natural born one spawned at 3560.
On Turn 299 my tourism peaked at 401 per turn right before the closing ceremonies.
On Turn 300 my tourism massively dropped but the two Great Musicians both reached Indian territory and performed tours to bring me above 100% for all remaining civs.
 
Thats what I was thinking too, along those lines. Turns out:

The crash on turn 1 autoplay is because I stupidly deleted my own divide by zero population check.

Mongolia stopping teching was because I accidently substituted m_eOwner for getOwner() when I need to find out who owns a city. Apparently it makes a big difference.:crazyeye: (because the two return different owners when a city is captured?)

Now it plays through autoplay, but the irony is, it is pointless checking it with autoplay because the changes depend on a human actually playing the game!

That is what makes the testing phase so slow.....

So I'll check it through by hand myself before uploading,

and if anyone wants to help me with beta 5 let me know and I'll upload it now.

I'd appreciate it because it speeds things up.

EDIT:
just realised v4 beta might show the same bug
 
That is what makes the testing phase so slow.....

So I'll check it through by hand myself before uploading,

and if anyone wants to help me with beta 5 let me know and I'll upload it now.

I'd appreciate it because it speeds things up.

EDIT:
just realised v4 beta might show the same bug

Sunday afternoon (US Time) is the next time I'll have time to start a new game.
 
Thanks Joncnunn that gives me a target and enough time to hand test the code, make sure it works so that you can give it a run from a players perspective.

EDIT:
I think I can release this beta in less than 24 hours from when I edited this post.
 
With the new code in V18 beta 5, instead of adaptively buffing the AI with free techs (I can't do that because who decides what techs to give?), instead the adaptive system in this mod controls the science rate according to tech differential with the player and lets the underlying AI code decide what tech to choose. That means that the AI can still be improved despite the buffs.

The mod at the moment aims to get a competitive AI that is already showing signs of doing well, to be roughly in the range of 0-4 techs ahead. AI's that aren't able to compete, don't get the extra science buff, but still get the other adaptive buffs.

Question.
For any emperor/immortal players, how many techs ahead of you would you like a competitive AI to be, come industrial era, to feel like the AI has got a chance of beating you?


EDIT:
Scrub the question, it is basically impossible to answer there are so many variables. I think 0-4 techs ahead should be a good target, what do you think?

Persia on this system just dealt me a convincing science victory on emperor, but 3/4 of the game was on autoplay until I hand tested the endgame manually with the best civ at the time (Korea). It felt like Persia was much more competent than usual, because Darius could keep up and even exceed me in tech. His construction rate of space parts was really impressive. He finished 4 techs ahead and 3 parts ahead.
 
Here's the latest beta. Enjoy!

I almost forgot to upload it because I've been absorbed in playing the game instead of modding it for once.

This beta build I think achieves what I've been aiming for more than any other previous version, to make every game interesting and playable through to the end (so long as you play well and put in the effort according to your difficulty level). In previous builds of this mod, the AI would usually fall behind in tech despite all attempts to buff, and would cause me to loose interest in the game. But in this version, the competitive AI's are much more likely to keep up and even exceed the player a bit in the end game.

The changes I've made are to the adaptive buff algorithm:
  • An extra adaptive science yield buff starts kicking in when the AI reaches its renaissance. It is adjusted by difficulty level to kick in softer or harder.
  • If an AI is within 3 techs of player, apply an extra science buff to help them catch up and stay competitive with the player unless of course they loose their productive capacity and don't have the cities or population to do it.
  • AI's that are more than 3 techs behind still get an adaptive buff from previous versions, but not the extra adaptive science buff.
  • AI's that are 3 or more techs ahead don't get the extra adaptive science buff either.

Think of it like a feedback system that locks the science yield rate of the AI within +/-3 tech window, until the AI cannot maintain the lock or the AI is naturally exceeding the lock parameters on its own. Of course it is sensitive to what is happening on the map (it is not a purely mathematical buff). I'm thinking about modifying the algorithm to taper off the science buff a bit more gradually, but I really need to give modding a break for a while. Maybe next version.

If you think it is good enough to release proper, let me know. This version means that bulbing great scientists don't bypass the buffing system.

EDIT:
The way to cheat this beta build, would be to try and get four techs ahead of all other civs before they hit their renaissance, so as to avoid the extra adaptive buff kicking in. From my experience though, that is going to be really difficult to do because the AI already gets adaptive buffs to science before renaissance if it is falling behind the player. Just not the extra locked in science buff.

Please note that this mod doesn't mean that there is no point working on the AI to improve it. It just means that the shelf life of Civ5 is increased, and in fact tend to inspire efforts to improve the AI rather than to give up on it.
 
Here's the latest beta. Enjoy!

A started a new game with Beta 6 + the national wonder changes I'd mentioned earlier.
I'm playing Sweden on Immortal level.
Turn 119 (Beginning of Midevil era, entered via Civil Service)

Lake Victoria is on my land mass, but there was little else to go with that city site (2/3rds of the land tiles are ice with the remaining 1/3rd being tundra) so it ended up being my fourth city to found. There are also two potential fifth city spots if the AIs don't take them first.
Overall, the production potential of my capital does not look suitable for a cultural victory but the overall empire gold potential looks really good for a diplomatic victory (and to a lesser extent a science one)
I have a DOF with Netherlands & Poland. (Poland is my nearest neighbor)

The Huns are just on the far side of Poland, and are in last place in science. (6 techs behind, looks like they've built a bunch of their UU, so AI Poland needs to watch out)

Poland is 2 techs behind in science. None of the other AIs are yet in range for trade routes.

I've finished Tradition and opened Patronage.

Two turns ago I made contact with Venice, which may end up changing my plans for a Diplomatic victory into one for a science victory.

Egypt & Polynesia are also in the game. (There's also one civ I haven't met yet.)

Religious Idols was used to springboard me to Protestantism (3rd to found in the world). The usual Tithe chosen. With limited faith available, I went with +2 happiness from Temples.
By the time I enhanced, the remaining 2 religions were taken and one of the AIs enhanced theirs, with one of them taking Feed the World and another having taken the percentage hammer from followers. Pagodas was actually still available so I took that along with the usual Religious Texts.
 
Yeah, the huns are interesting in this beta build. Attila falls behind in science but is capable of great devastation. I'm hoping that games will show that Attila can get competitive once he stabilises his potentially vast territory.

Joncnunn, if you manage to get four techs ahead of the AI before renaissance, I will laugh myself into oblivion, because you will have achieved what I thought couldn't happen :) You are a tradition specialist, and I have to admit I am not, so it is good to have you around to test this mod out!
 
Yeah, the huns are interesting in this beta build. Attila falls behind in science but is capable of great devastation. I'm hoping that games will show that Attila can get competitive once he stabilises his potentially vast territory.

Joncnunn, if you manage to get four techs ahead of the AI before renaissance, I will laugh myself into oblivion, because you will have achieved what I thought couldn't happen :) You are a tradition specialist, and I have to admit I am not, so it is good to have you around to test this mod out!

I came close ...

This is thru Turn 177 (7 turns into Rean era when I researched Astronomy and a Harbor completed in my capital to allow trade routes to give me that info.

Polynesia ruined the primary 5th city site I had in mind by founding a city 3 tiles away from it. :( (The spot I would have founded was 3 tiles away from two different luxury types. Polynesia chose to found next to one of the luxuries but will need to found a separate city to get the other luxury.)

As expected Huns did indeed declare war on Poland. At one point they got one of Poland's cities down to 40% health remaining. But during the war Poland completed the Great Wall and beat off that attack.
Polynesia intervened on behalf of Poland, but all their action so far is similar to what Japan did during the Great War, they just helped themselves to a population 2 one tile island that the Huns had founded prewar, reducing it to population 1 when they captured and puppeted it.

Poland and the Huns later signed a peace treaty.

Venice has Marco Polo just sitting there doing nothing. :eek: See attached screenshot. It does not look like they've bought any city states.

Egypt & Venice are building a lot of great wonders.

Egypt was first to Rean era, entering on turn 165, (I'm still number 1 in techs, they bypassed some)

I entered Rean era on turn 170 via Printing Press.

This past turn Egypt completed the Forbidden Palace. :mad: I don't even have the tech for that.

I've discovered all natural wonders, 6 of the 8 city states that are in the game but still have not discovered the last major AI civ.

Egypt: Has 2 techs I don't and is missing 3 techs.
Venice & Polynesia: Are both missing 5 techs.
Huns & Poland: Are both missing 6 techs.
Netherlands: Is missing 8 techs.
The unknown civ is in last place according to the demographics screen.

The secondary 5th city site I have in mind is still vacant. (Two tile island with Mt K. 3 hexes away and a couple of fish)

My DOF buddies are now the Netherlands, Poland, Venice, and Polynesia. That's 40% faster Great People than normal.

My social policies are full Tradition, Patronage opener + Consulates, and Rationalism opener.

Polynesia & the Huns are still at war.
 

Attachments

  • 2014-08-24_00001.jpg
    2014-08-24_00001.jpg
    266.1 KB · Views: 81
If I hadn't had Venice in my last test game of V18 beta 6, I would be worried that we have found a bug. But in that test game, Venice had gotten to four cities, not as competitive as other civs but doing well enough.

In your game, it looks like Egypt is locked in to your science pace now because they are within +/- 3 techs, and they are into the renaissance as well. Unless you or somebody else starts reducing their productive capacity, Egypt looks to be your only rival.

You play on maps I never test this on which is good. I may have to widen the window of the adaptive science lock to +/- 4 techs and look into tapering the algorithm differently or reduce the era by one, where the adaptive science kicks in.

EDIT:
Heck, I might even turn on the adaptive science lock on from turn 1 at the rate you are going!
 
In case anyone wants to try this beta version, I've made a significant improvement to the adaptive science buff that make it less arbitrary, less complicated, and produces better games because it can handle wide playing AIs better and help them to catch up in tech when they fall behind (I'm talking to you Attila).

The way to imagine how the adaptive science buff works, it is like a funnel that gets bigger with each era. The AI's that are outside the funnel don't get it's benefits (AI's that are teching too well or not well enough). Those AI's that are inside the funnel boundaries get a boost to science yield that varies with how far behind or ahead they are in tech (as well as difficulty level).

It is just a few lines of code that I think are going to produce more interesting games. What I think should happen, is that when Attila finishes his rampage, he may end up with 8 cities by the late renaissance. He will be teching too slow to stay competitive with the player, but as the eras go on, the funnel gets bigger and Attila starts to get the extra science buff again with his 8 healthy cities (remember, it is all relative to the players tech rate). This should mean that he rapidly accelerates back into a competitive position with the tall AI's. Also, I think the beta 7 algorithm, should help accelerate the culture AI VC, as well as the science AI VC, but not as much as it helps the domination AI VC.

EDIT:
So if you want a more competitive game, switch over to beta 7.

Beta 7 is save game compatible with Beta 6.
 
Is it possible to include everything in Various Mod Components into your mod?

Many mods require it and to use this mod I would have to exclude others that depend on various mod components, and with the source code available I think whoward intends for others to include his dll mod in theirs so others can make their DLL mods more compatible.
 
Back
Top Bottom