Buffed AI for BNW

Thanks, I've downloaded the new Beta 10 version of the mod and will give the Irq another shot with it since I'd like to win with them first before moving to my next civ introduced in vanilla that I haven't played since then.
 
It's not just sea luxuries that the AI is slow to connect, it's also slow to connect calendar resources. Not a single one of them for their capital is connected and its turn 132!
Persia has Goddess of Festivals pantheon and has founded a religion.

See attached screenshot.
 

Attachments

  • 2014-09-09_00002.jpg
    2014-09-09_00002.jpg
    157 KB · Views: 45
It is difficult to know what is going on by a screen shot. I really need save games 50, 20, 10 and 0 turns before 132.

How many cities do they have and what is there happiness situation? If they have expanded they may have their workers allocated elsewhere.

Are you sure that the info you are seeing from world-view is up to date?
 
Finally was able to get reasonably far into a game (Emperor difficulty), and it's perhaps the weirdest game of Civ V I've ever seen. I understand it takes a few eras for the buffs to kick in, but I just entered the Renaissance without a single AI being competitive thus far.

This image should give a broad idea of the situation right now; no AI has any sort of science output, and the Maya are somehow miraculously getting by with 6 beakers per turn, in combination with a population 6 capital and negative -17 gold per turn. And they're second in the game in score by some incredible feat (they've built 4 wonders).

I also pushed the pedal down hard on growth mainly to see if I'd be griped at for tall expansion, but despite owning the two most populous cities in the game (and most populous empire by a good margin) there isn't a single negative diplo modifier for that. I did get surprise DoW'd by Sweden (which was very refreshing, couldn't remember the last time an AI caught me by surprise like that) but they brought a force of 1 comp bow, 1 pikemen, and a couple warriors. This was at turn 135 in the game, perhaps the most underwhelming invasion I've ever seen considering the turn. They gave up after about a half dozen turns and gave me a city in the peace treaty.

I'm running a standard size Pangaea map that roughly resembles Asia so I'm even more surprised by the AI's struggles. I should also mention that there's been almost no expansion by anyone--I don't think anyone has more than 3 cities, and Alex is in the game!

I should mention that this isn't the only mod active, but nothing really alters gameplay except for Separate Great Person Counters (which I adjusted slightly to make great people generate 25% slower to compensate for the separate counters) and a combat mod that gives a slight siege boost to melee units and a slight generic nerf to ranged. Still, I've played other games with those active and witnessed no significant effects.

I'll try to keep playing and see how the AI recovers from here on out, but the behavior thus far seemed pretty significant so I figured I'd report in. I haven't played at this difficulty in who knows how long, so I could be overreacting a bit to how far behind the AI is.
 
No, beta 9. I started this game just before you posted 10. And as I'm typing this I'm remembering that you can switch over mid-game, so I'll do just that.
 
You can substitute with #10, but there will still be game legacy left over from #9. I'll go and delete #9 from this forum now.

EDIT: Also, if you are using info-addict, don't focus in only on AI science. Take a look at the overall picture of AI production, GNP, happiness, tech difference etc etc, not the AI science rate (like I said a couple of posts up).

EDIT: Your combat mod could interfere with this mod I'm not sure. Also, if you are a deity player, suggest, playing this mod on deity.

EDIT: Any mod that alters handicaps is going to be a problem with this mod.
 
It is difficult to know what is going on by a screen shot. I really need save games 50, 20, 10 and 0 turns before 132.

How many cities do they have and what is there happiness situation? If they have expanded they may have their workers allocated elsewhere.

Are you sure that the info you are seeing from world-view is up to date?

Impossible to tell the AIs happiness situation since noone is even in Rean era yet.
I know they have the tech since they have exactly one copy of Wine and so one of their hidden cities connected that one, but a human would have connected all the wine by now. And yes, I think this behavior is also in the base game.
I'm thinking the only luxury types the AI ever improves all copies of as quick as a human does are the mining ones.
 
Thanks. I need to know what if anything is wrong with the BuffedAI code in this mod, before we move onto improving the AI otherwise it is too confusing.

So I'm looking at problems that are related to BuffedAI, not the base game. Once the BuffedAI code is stable, I can then look into making more extensive improvements to the AI.
 
Here's the worst happiness case I've seen in a long time to look at for after the boosting work is done.

Maya: Luxuries covered by Jungle. (This civ seems to be the one the AI has the most trouble playing, come to think of it it probably was the Mayas the last time I saw a case this bad.)

I just met them, in addition to embassy visibility I also have unit visibility of the whales and one of the gems copies (I opened Exploration) as you can see the jungle is covering all of the Gems.
They are dead last in happiness (and a lot of categories) and a check on demographics confirms they don't have even a single luxury copy for themselves hooked up.

I don't know what their tech path was, but it's obviously one not suited for Jungle starts.

They have a couple of units embarked, so they definitely have the tech to have connected the whales but may have suffered it being pillaged by that barb camp.
 

Attachments

  • 2014-09-09_00003.jpg
    2014-09-09_00003.jpg
    182.4 KB · Views: 50
If we can get to a stage where we are confident with the Buffed AI code, I'll then merge that code into the Various Mods Component DLL. Once we are confident that the BuffedAI code in the VMC DLL is working, Then gradually month by month, chip away at improving the AI.

Or to put it to you in another way. If I would instead fix the AI straight away before working on the BuffedAI, I would consider it such a hopeless task that I would have given up long ago, like Ninakoru has done in the Smart mod. He has disappeared and stopped working on smart mod. Why? Because any intelligent person that looks closely at the AI code in BNW, realises how totally rooted the whole design of the code is and asks the question why should I fix this for nothing? It barely functions, barely. The AI code is a hack, because it is just an evolution of already bad design from previous games.....yet it does its job, barely. Anyone coming from the outside looking at the AI code in this game, most walk away shaking their heads.

BuffedAI for me is basically a life support system for an AI that I consider almost terminally ill. I stand in admiration for the sheer brute force determination the developers had at Firaxis, to get the AI playable. Total blood sweat and tears working around a flawed design that was probably forced on them by limitations in budget.

EDIT:
So please, one step at a time. Lets work out if the BuffedAI code is actually producing a playable game from beginning to end. Maybe not a pretty game, but a playable game. Without buffing the AI, I too would have walked away a long time ago, like so many other much better modders than me, have.
 
BuffedAI for me is basically a life support system for an AI that I consider almost terminally ill. I stand in admiration for the sheer brute force determination the developers had at Firaxis, to get the AI playable. Total blood sweat and tears working around a flawed design that was probably forced on them by limitations in budget.

I'm wondering if that was part of the reason for the look delay in Firaxis releasing it to begin with? (Maybe the design was even worse at CD release and they took two years trying to clean it up to look good before presenting to others before giving up and releasing where they were?)

It will be interesting to see for BE if they rewrote the AI. If so, then after whenever they release that part of the source it might be possible to use BE's AI in Civ V instead of Civ V's AI.
 
Turn 173 (Late Midevil for me, early Rean for most of the AIs) : AI techs staying in good spot so far. :) This was about the point in V9 that the human fell to last place.

Does the increased war probability affect "Deceptive Attacks" or only normal attack? It was Persia, who is one of those civs in which your more likely to be DOWed upon if he's showing Friendly than Neutral. (Persia's message actually stated so, I personally did not regard them as friend)

However, I was seeing Quebec City (my city state ally) absolutely slaughter Persia's navy between their city bombard and Composite Bows, so maybe NERF_HUMAN_RANGED should also nerf the City State ranged units?

The new "expanding cities too aggressively" though doesn't seem to be properly hidden when the AI is pretending, my guess is that there's a different part of the code base that goes thru and masks them and it's checking against something about them one by one instead of simply looping thru them all and removing all negative ones.
 
The AI code is a hack, because it is just an evolution of already bad design from previous games.....yet it does its job, barely. Anyone coming from the outside looking at the AI code in this game, most walk away shaking their heads.

So true, I can only pray that Civ VI gets an AI makeover. Unfortunately, like most modern games, all the masses care about is pretty graphics. You would think, you would start with the AI and then build out to the graphics, but it always works the other way around.

Spoiler :
Civ VI: less features, dumber AI, but the graphics are going to be mind blowing awesome. Heck, maybe this time they'll just leave the AI out all together, Civ VI Online Only!


Oh by the way, I am still testing on lower levels (my kids and myself are all sick :( )
 
Irq Immortal Beta 10 + national wonder game

Turn 132, beginning of my Midevil era:

Me: 20 techs #1 crops
Greece: 21 techs
Songhi: 19 techs #1 population
Spain: 22 techs #1 everything else
Morocco: 20 techs. Worst troops
Persia: 21 techs
2 unmet civs, who between them are worst in everything else

Turn 181: Beginning of my Rean era:
Me: 31 techs. #1 pop, crops
Maya: 23 techs. Worst in everything else
Greece: 32 techs. Worst happiness
Songhai: 33 techs. #1 science
Spain: 32 techs. #1 man goods, gnp, land, troops
Morocco: 31 techs.
Netherlands: 31 techs. #1 approval
Persia: 32 techs.

Screenshots of beginning of eras attached.
Also attached is the screenshot confirming that the portion of the mod preventing barbs from attacking AI settlers is working.
 

Attachments

  • 2014-09-09_00001.jpg
    2014-09-09_00001.jpg
    297.4 KB · Views: 71
  • 2014-09-10_00001.jpg
    2014-09-10_00001.jpg
    289 KB · Views: 44
  • 2014-09-10_00002.jpg
    2014-09-10_00002.jpg
    247.7 KB · Views: 38
ZeroRPG, hope you and the kids get better soon. Remember that the mod is untested on low difficulties, I hope you get an enjoyable game. Even on a low difficulty the AI will track the player in tech more loosely and could pose a challenge....

I'm into the atomic/information in my game on emperor. It is producing a beautiful game I'm likely to loose (bring on my defeat!) Two of the AIs are exactly 3 tech ahead of me, others ahead but less. The buffing system has kicked the AI into life and it does interesting things. After a really long campaign to take Germany's capital (two attempts), I've finally won it and have hit the lead in score. But the other AIs have the capacity to do something about it and the denouncements have started and my empire is threatened. I have a beautiful tri-axis alliance with China and Assyria which is holding the whole show together, and it has been a solid relationship for a very long time. I just found a properly upgraded Greek navy off the coast. Beautiful! A genuine surprise awaiting a couple of my coastal cities. China is first into the information age and heading for a science VC.

For the first time ever, I'm actually exploring the Civ5 endgame much more often (it has got me hooked because it doesn't feel like a walk over). Its keeping me motivated. Hope so for you too. Without the motivation, I would just walk away from this broken game, when there is no ongoing support from Firaxis. To be honest with you, I cannot understand why they don't pay someone to stay working on Civ5 permanently. It is profit lost, but the money is regained by reputation. You don't have to pay them a lot of money. It could be a junior developer. They wouldn't even have to release official patches. They could release unofficial company patches that we the players could choose to opt-in on (Steam has that ability). We could work with that junior developer and that developer would get in-house experience. Win-win for everybody. Whatever.

Yes, the huge delay in releasing the code after Civ5 was very damaging to the modding community. A lot of modding talent was lost to other games because of it. I actually agree with you. I think Firaxis were embarrassed to release the code because it was in that bad a shape at release and so hacked together from Civ4 code. The hype would not have matched the reality I think.

Thankfully, Ed Beach is the lead design for Civ6 from what I hear. The guy is an amazing talent, truly special. What he did to save Civ5 from total ruin, was amazing. He completely transformed it. The most incredible thing is that he did it inside the budget they have.

The problem with the AI code is that it is not properly object oriented. It is very old technology and most developers would not be interested because if they were to work on this old technology, their jobs would be obsolete. The style of the AI design is still the same style of approach that was being used in the 20th century. Huge long non-object oriented functions that are bloated and that do too many different tasks. An absolute birds nest of dependencies, one piece of code to another. Towards the end, I can see where they have tried to convert over to a better object-oriented design (CvOperation) but it is tacked on. They have also done a hack of the multi-processor approach as well! In Stardock, they have moved over to an approach where each AI is working on an independent processor.

The huge design decision that Ed Beach has probably already locked Civ6 into, is whether to abandon the AI code or not. I would not like to be in his shoes for such a decision!

Joncnunn, the AIdeclarewarprob is both for deceptive and war approach, it increases both. Here's the code:
Spoiler :
Code:
////////////////////////////////////
// MODIFY WAR BASED ON HUMAN DIFFICULTY LEVEL
////////////////////////////////////

	if(GET_PLAYER(ePlayer).isHuman())
	{
		HandicapTypes eHandicap = GET_PLAYER(ePlayer).getHandicapType();
		int iWarMod = 100;

		CvHandicapInfo* pHandicap = GC.getHandicapInfo(eHandicap);
		if(pHandicap)
			iWarMod = pHandicap->getAIDeclareWarProb();

		viApproachWeights[MAJOR_CIV_APPROACH_WAR] *= iWarMod;
		viApproachWeights[MAJOR_CIV_APPROACH_WAR] /= 100;
		viApproachWeights[MAJOR_CIV_APPROACH_DECEPTIVE] *= iWarMod;
		viApproachWeights[MAJOR_CIV_APPROACH_DECEPTIVE] /= 100;
	}

If the AIdeclarewarprob is set too high, it actually makes the game easier, because the impulsive AIs get into a war that does not help their long term cause.

The "reckless populating" modifier does tend to hang around. I haven't changed how that would happen. In my game, Assyria resents it and rightly so. The entire game I have kept my population progressing tall, not wide, faster than he. Yet we are still very good friends and he has not backstabbed me.....yet!

EDIT:
I had not thought about nerfing the CS possibility. It is counter-intuitive but could be a good quick fix. It is appalling to see major civ attacks fail because they cannot handle the mindless tactical nuisance that is an intervening CS. I thought I fixed that by making sure that the CS don't get the adaptive buff. They don't even get the tech funnel buff! So they should already be weakened relative to a major AI.
 
It could be a junior developer. They wouldn't even have to release official patches. They could release unofficial company patches that we the players could choose to opt-in on (Steam has that ability). We could work with that junior developer and that developer would get in-house experience. Win-win for everybody. Whatever.

In some ways it would be BETTER to get a kid that's less than a year away from graduating with a BS in computer science as a summer intern for this. 20 year olds don't yet know it can't be improved and so may find a way.

The problem with the AI code is that it is not properly object oriented. It is very old technology and most developers would not be interested because if they were to work on this old technology, their jobs would be obsolete. The style of the AI design is still the same style of approach that was being used in the 20th century. Huge long non-object oriented functions that are bloated and that do too many different tasks. An absolute birds nest of dependencies, one piece of code to another. Towards the end, I can see where they have tried to convert over to a better object-oriented design (CvOperation) but it is tacked on. They have also done a hack of the multi-processor approach as well! In Stardock, they have moved over to an approach where each AI is working on an independent processor.

Yup, buy a rules engine and tie the AI into that would appear to be the best approach and also buy something that makes multi-threading as easy as possible instead of trying to code that in house would seem best.

They don't even get the tech funnel buff! So they should already be weakened relative to a major AI.

Actually there is another section of the base code somewhere that instantly grants City states for free whenever 2 civs have it. (It may be limited to civs the city states know about.) I think that was the Great Library's original power in Civ 1 & 2 so it was easy for them to repurpose. The reason that's in is because without it the city states would NEVER discover the late game resource techs as being miles ahead of all AIs in the base game shows. With several of the players are bunched up for most techs, then depending upon their techs researched, the city states may actually know more total techs that anyone, giving them extra strength city bombardment. :eek:

Beginning of Industrial era Turn 213:

Me: 38 techs. #1 population

Maya: 29 techs. Worst in everything except approval. (I granted them a spare copy of one of my luxuries since they were so far behind)

Greece: 39 techs. Worst approval.

Songhai: 40 techs. #1 science

Spain: 39 techs. #1 in everything else. Only Civ with an ideology (Order, happiness +5) They obviously entered the era via Industrialization and had a local coal that already had a mine.

Morocco: 39 techs. #1 approval

Netherlands: 40 techs.

Persia: 39 techs.

Spain & Songhai are at war.

Edit:

The combo of completing an RA [enhanced by both PT & bottom left Rationalism] + Oxford tied me back to first at the beginning of the modern era.

Turn 239

Me: 45 techs #1 population

Maya: 32 techs. Worst in the rest

Greece: 44 techs. #1 troops Worst approval

Songhi: 45 techs. #1 approval. Worst troops

Spain: 44 techs. #1 crops, man goods, GNP, land

Morocco: 45 techs.

Netherlands: 45 techs

Persia: 44 techs

Spain & Songhi are at war, Spain appears to be winning.

Screenshots attached:
 

Attachments

  • 2014-09-10_00003.jpg
    2014-09-10_00003.jpg
    303.9 KB · Views: 50
  • 2014-09-10_00004.jpg
    2014-09-10_00004.jpg
    326.4 KB · Views: 70
Having the best endgame I've ever played in Civ5. It has taken me four years to say that. The endgame is edgy, competitive, interesting.

Thanks for the tip on CS technology, something to keep an eye on.

I wonder what happens to your game when you hit the endgame. Your tech situation particularly. If the immortal passive buffs are significant, it will turn off the adaptive buff. That will leave the tech funnel buff, but that could turn off if the other AIs become unhappy.

Fingers crossed you get an enjoyable endgame like me.
 
Having the best endgame I've ever played in Civ5. It has taken me four years to say that. The endgame is edgy, competitive, interesting.

Thanks for the tip on CS technology, something to keep an eye on.

I wonder what happens to your game when you hit the endgame. Your tech situation particularly. If the immortal passive buffs are significant, it will turn off the adaptive buff. That will leave the tech funnel buff, but that could turn off if the other AIs become unhappy.

Fingers crossed you get an enjoyable endgame like me.

I'm actually still in modern era, but most of the AIs have joined me. (All but the poor Maya who only recently hit Industrial) We're yoyoing back in forth on who has the tech lead. :)

I'm not actually after a cultural victory in this time, so nobody's under cultural ideological pressure from me so far. However one of the AIs is under pressure from the Greek AI's autocracy, but still overall happy. (So am I, but also overall happy, looks like I may want Eiffel Tower anyway to get exotic over the Greeks to cancel this)

I seem to be drifting towards seeking Science victory. (Full Tradition + Explorer opener + top LEFT exploration [the hammer bonus] + the two standard Freedom early adopter ones [+25% great people & Civil Service]) Most of the Industrial techs are now back filled as Railroad is my next objective.
 
Top Bottom