[BTS] Development thread

A new development version has been posted, 0.60H!

I'm attempting to make 0.60 a particularly stable and solid release for other mods to incorporate, so it would be wonderful if you help make this happen! I've already done a bunch of testing, so the mod should not crash on you so you can play with this. When the full 0.60 release comes out you will be able to switch to playing with that, all Better BTS AI releases are save game compatible. Be warned, however, that the debug DLL used here is significantly slower than the normal DLL. I can play Large maps at acceptable speeds with an optimized DLL but usually stick to Standard with the debug version.

If you get a crash, an assert popup, or see some odd behavior, please post and include a save if possible.

The full change list is included above, though it's from vanilla 3.17 and not the immediately prior version. Newer changes are always at the end of the sublists though.

Several of the more interesting changes, fixes to spark you interest:
- Fixed bug in CvPlayerAI::AI_calculateUnitAIViability which blocked main logic for AI building of Privateers
- Created new logic for AI to run assault transports to reinforce its existing positions without building up new full invasion force
- AI can now time smaller transport loads to arrive at the same time as bigger invasion stacks
- Vassals will now be better prepared to participate when their AI master is planning a war. If their master is a human, they will be probabilistically be a bit better prepared.
- Fixed bug where settlers with no path to city sites on same continent would idle indefinitely and never load on transports
- AI will now transfer some troops to the new world to conquer barbarian cities if it isn't doing anything else with them
- Holding down SHIFT+ALT and clicking on a leader in the scoreboard now sets your civ's warplan to WARPLAN_PREPARING_TOTAL, like the AI does when beginning war preparations and can be used to signal to Vassals that they should begin preparing for war (not multiplayer compatible)
- Modified CvMainInterface.py to show on scoreboard when player is set to planning a war against another player using WAR in yellow instead of red
- Air units can now be set to explore, they use the same explore logic as AI planes and then have extra logic if that doesn't push a mission. Note that planes on auto explore always move at the very beginning of your turn.
- In debug mode the game places colored circles on the map for the plots where civ's want to build cities (you have to change which unit you have selected to get them to show initially or update after a turn)
 
Wow. It is very cool that we even can get to a stage where this type of higher level behaviour can be tested. Congrats! Sounds like 0.6 could become a convergence milestone release for all the hard work that has been done on the AI up to now.
Seriously, thanks.
Cheers.
 
Exactly! Well put glider, a lot is coming together in 0.60 especially on naval transport AI.

Attached is a replay from my most recent test game which I think might spark some interest. It's a standard sized test game with just two big continents, one with 4 players and one with three.

I've been working with Terra maps and Archipelago maps recently while focusing on the transport AI. I wanted to test out how two major power would fight an intercontinental war ... I was not disappointed! The English came from behind to dominate the eastern continent, the Germans had a lot of space and came to dominate the western continent. The English and their vassals attempted several invasions of the other continent starting in the 1800s, both they and their fairly powerful vassal the Byzantines captured a couple cities but couldn't sustain the pressure until the 21st century. You'll be able to see how vassals now build up for war as Churchill's two bigger vassals both make contributions early in the invasions. In the end, Frederick surrenders after losing much of his main territory with about 85% of his spaceship completed, Churchill then wins a combination Domination and Conquest as he vassalizes the whole world.

Enjoy!
 

Attachments

A couple of questions so far regarding the save game above:
1) Ragnar on the eastern continent is interesting. Starting at 1100AD, he captures barb cities in the far north along way from his home in the south. This effectively means that the vikings stradle germany in the centre, by being both germanies southern and northern neighbour. Ragnar presumeably struggles to hold the north because of distance, fragmentation and poor resources and eventually looses the north to Fred in the centre via war and is forced to capitulated when Fred makes progress on him in the south as well. Considering that Fred had long term control of the centre of the continent with good resources and remained a single massed empire, it seems obvious that Fred would beat Ragnar's invasion in the north through superior finances and production and then begin to trouble Ragnar on home soil in the south as well.

Question. How did Ragnar decide to take the barbarian cities in the north 1100AD? Did he get to the area through Fred's territory or by sea? The contention is that civs may begin to exploit barbarians through more progressing long distance offensive deployments by land and sea, but forget the implications of not being able to hold the territory long term.

2) With vassal cooperation like this, what is the future for the cultural victory condition? Is it still viable? I will do testing on this myself.

Cheers.
 
1) I don't have the save anymore to go back and check exactly, but I believe Ragnar's troops walked through to the Barb cities. If it has troops and isn't in a war, the AI will hunt down Barb cities both overland and by sea, without too much thought as to the benefits or costs of capturing the city. Each leader type has their own rules about whether to keep captured cities that are far away, so there is a decision being made after the city is captured which depends on the leader's personality.

I take your point though, the costs of the distant cities played a role in Ragnar falling behind Frederick in tech (though with this particular pair it probably would have happened anyway ...), which then contributed to him losing the two front war.

2) What exactly are you thinking about re cultural victory? Vassal cooperation makes AI blocks a little more potent in war because the whole block is ready from the beginning. It certainly makes domination/conquest victories more likely, and also makes it more likely that vassals will break free. The Byzantines did break free of their capitulation to Churchill in that game through conquest on the other continent. But with good defenses and strong allies, cultural victory should still be just about as possible as before I would think.
 
What exactly are you thinking about re cultural victory?

I'm working through a 0.6 test game at the moment. The debug build is slow but boy is it worth it. The changes to AI behaviour are big time significant and very very interesting. The number of defense pacts has increased heaps as well as vassal agreements. You are wise knowing that it is important to maintain that personality profiles should remain a differentiating feature of AI to AI behaviour.

So far I'm working on a standard aggression game and the civs that want to get cultural are still doing a good job. I was concerned that it was going to make warfare much more dominant, all these defense pacts and vassal agreements making global war inevitable. However I am wrong so far....

If anything, civs are forming much more coherent arrangements on standard aggression, allowing culture to flourish through maintaining status quo peace arrangements. That said, civs are having trouble developing positive relations with civs on other continents during the renaissance. It will be very interesting to see whether the late game collapses into world war every time, or whether civs can settle their differences on standard aggression, if they want to go for a peaceful win.

There is still a lot of testing to do because this change is appearing to me to be as significant as the first days of the discovery of the closeness bug! So far signs are looking real good!

If in that sample game, Ragnar was doing the "Ragnar" thing and trying to win territory against barbs rather than contesting Fred, well and good on him! It would have been interesting to see how delusional Ragnar was on his prospects. Your sample game is set to seven civs, and so there was a fair bit of room for this type of conquest behaviour to emerge early against the barbs. No problem there. It's just keeping an eye that these great changes to the AI don't highlight big weaknesses in other areas.

The build so far is very stable as well. Great stuff!!
Cheers.
 
Check this save out. Noteable are these features:
1) The number of defense pacts Catherine is involved in.
2) Saladin's intercontinental invasion and subsequent acquisition of Hammurabi as a vassal. He did this in total cooperation with his neighbour Napoleon in a simultaneous intercontinental invasion, with both eastern civs getting a city in the west each.
3) Willem's incredible culture dominance.
4) The general long term status quo stability of the eastern continent, and the early wars in a much less stable western continent.

Historically here are a couple of major points:
1) The western continent was marked by a middle age war between Willem and Shaka with both of them ending up with split territories and Shaka the big time looser. Willem stops his warring and get's on with culture and Shaka and he never form any vassal arrangements. This is in complete contrast to the eastern continent, where civs are forming pacts left right and centre thanks to all being christians.
2) Mao, Shaka's immediate neighbour then starts to take advantage of Shaka and DOWS for very good reason. The war lasts for a long time and I'm not sure why Mao doesn't make more progress territorially.
3) Catherine on the eastern continent sorts out her issues with her neighbours, signs defense pacts and then manages to secure an important iron resource on available territory on the western continent, without getting into a war!
4) Saladin and Napoleon are immediate neighbours on the eastern continent. They end up in a war on Hammurabi on the western continent. They both invade the western continent, grab a city and switch to pure culture creation and buildings in those acquired cities.
5) Saladin is the one who makes more progress on Hammurabi winning another city on foreign soil forcing Hammurabi to capitulate. This pisses Napoleon off because he still hates Hammurabi and Napoleon now goes to war on Saladin.

EDIT: this was not an automatic trigger, but a considered one by Napoleon at some later stage...

Thus the once stable eastern continent is now in a war between two neighbours that were pleased with each other the whole time up till then! Napoleon is justified in going to war on his neighbour, because his power graph is real good, best in the world.

I will continue on working through this game and I have not even got to the modern era yet!...But so far it is looking very nice 0.6H :goodjob: Much more interesting and diplomatically coherent, and finally some truly successful intercontinental cooperative warfare. How cool is that?

I have all the saves and will keep them.
Cheers.
 
5) Saladin is the one who makes more progress on Hammurabi winning another city on foreign soil forcing Hammurabi to capitulate. This pisses Napoleon off because he still hates Hammurabi and Napoleon now goes to war on Saladin.

:lol: This made me chuckle.
 
Yeah seriously this is new ground for BTS. I have not seen behaviour like this ever. I'm slowly trying to pick through exactly what happened between Napoleon, Saladin and Hammurabi. It's all on autoplay and I have to back track to see what happened.

The sequence goes like this:
Saladin and Napoleon are christian neighbours on the eastern continent. They get on well (pleased) and share a dislike for Hammurabi, a Buddhist on the western continent.

1650AD: Saladin dows on Hammurabi, picking a long thin island just off Ham's mainland to invade. He arrives with a decent invasion fleet, divides the island in two and Ham cannot get support in quick enough.

Shortly after, Napoleon dows on Ham as well. Saladin takes the centre of the island, Napoleon the north. Napoleon, brings in a decent fleet of invaders and they were on the move before Napoleon dows on Ham it seems.

Together Saladin and Napoleon hold the island and build culture on the acquired cities. Saladin however, continues on the invasion onto the mainland and wins a city! This forces Ham into a capitulation and immediately ends Napoleon's war on Ham as well.

1812AD: Napoleon is the most powerful civ on the planet. He still is pleased with Saladin, but is getting more annoyed with Ham again.

1814AD: Napoleon now DOWS on both Saladin and his capitulated vassal Ham. Remember that Napoleon is an immediate neighbour of Saladin both in the eastern old world and on the western island adjacent too the western mainland.

1816AD: The save game above indicates this situation with Napoleon!
1) He is invading Saladin his neighbour in the old world
2) He is harrassing Saladin's acquired territory in the west with infantry on the western island, and with navy on Saladin's tentative mainland stronghold.
3) he is very powerful.

Check the save game out because it will show whether Napoleon is crazy or not, or actually has a chance. Remember that he was pleased with Saladin and this relationship is now dead! Incredibly, none of the other Christians in the eastern continent seem to care about Napoleon's behaviour, despite that nobody apparently has a problem with Saladin.

Go figure that. I will post what happens but progress on autoplay will have to wait for now. This game is full of variety and once again, check out Willem's culture and his broken territory and the remains of his past war on Shaka. I also do not understand the number of defense pact's that Catherine is involved in.

Cheers.
 
First thing I noticed when I loaded up your save glider1, is that the French city of Lyons is producing the National Park. Turns out there is not a single junle or forest in the BFC, except for a forest which Saladin has in his territory instead.

Regardless, even with one forest I'm sure the decision to build that wonder could be checked out, jdog.
 
If any changes are contemplated with the National Park issue, please keep in mind the anti-pollution benefits of the NP! Trees are not necessarily required.
 
It does have a small health problem, but it's far from serious. It has a coal plant.

I hadn't thought of the reduction in :yuck: faces but I don't think even that is a big reason to build it in such a city as this.

Honestly, I think the reason he's buidling it is he's pretty much run out of other things to build! :)

The other building left is the salon - the observatory replacement.
 
Keep in mind that Napoleon has an attack going on Baghdad and could very well take it. The national park would then come more into play again with the culture and access to a forest tile. In any case, if you play through this scenario further, Napoleon get's Combustion next turn and begins building a public transportation system in Lyons.

However......

Napoleon's hot head decision has landed him in diplomatic trouble. He is now facing a multi front war both from other Christians on his home continent for turning on Saladin, and is facing war on the western continent from Willem the head of the Buddhists, for having dowed on Ham, a Buddhist. Cyrus, attacks him at that very city of Lyons you were talking about and all of Napoleon's military advantage is gone.....

By 1874AD, Napoleon is in big trouble.

In terms of the game experience, 0.6H is still ok. Napoleon's decision to attack Saladin was a very bad one, but what other choice did he have? He was getting squeezed out by the other Christians and he could not attack Catherine his other weak neighbour, because of all her defense pacts (never seen this before)

Napoleon made a big mistake, but in terms of the game experience, if Napoleon wanted to be a hot head militarist, he really didn't have any other option.

Cheers.
 
Jdog, did you fix the "vassal relations bug"?

The vassal relations bug is that the attitude a civilization has to it's vassals seems to be as important as the attitude to the master.

So if you and a buddy go to war on a 3rd party (and naturally you hate that 3rd party), and one of you vassalizes him... your effective attitude towards the old friendly master is the average of your attitudes towards the master and the vassal.

What worse, this average is on the scale of "attitude steps" instead of "attitude totals".

I ran into it a long while ago, and posted on it. It basically meant that once I vassalized a "bad guy" civilization through conquest, none of my old friends would ever talk to me again.

This could explain naploeons's treachery.
 
Yeah I've got all the saves if needed to study how Catherine got to all those defense pacts...

Napoleon was pleased with Saladin right up to the war declaration on Saladin and his vassal Ham. I think it is in Napoleon's personality profile to be able to go to war on someone he is pleased with on standard aggression? One addition point of disapproval came between them because of border closeness.

Here is the save at the moment before Napoleon goes to war. This should be able to clear up the context Napoleon was using in terms of military deployments and diplomacy.

One possible candidate for there being an "issue" regarding Napoleon, is if there is code that forces Napoleon to DOW on an intercontinental target, if Napoleon has clear military supremacy, irrespective of the diplomatic consequences at home. Just not sure at this stage.

Cheers.
 
So defense pacts can now be signed by more than one other civ, like in Rhye's?

Sorry don't quite understand. I'm not used to seeing all these defense pacts again. Basically in the above save, Catherine has a pact with Alex and Alex has a pact with Napoleon. This is an example of defense pact chaining. That has always been possible hasn't it?

EDIT: Issue with capitulation
At a guess I think an "issue" that has emerged here is regarding the great new behaviour of civs being able to win intercontinental territory, and capitulation. Saladin captures Ham's island city then captures a city on the mainland (see the 1816 save above). Ham then capitulates.

Problem is that Saladin cannot long term hold onto this capitulation arrangement because Ham only needs to regain control of one of his cities and the arrangement is dead. That could be fine because Saladin probably doesn't want the capitulation to endure anyway. However, Napoleon perhaps now sees Saladin as being much more influential than he actually is (just barely hanging onto Ham as an enforced vassal) and this adds to his war declaration motivations.

Cheers.
 
Yeah I've got all the saves if needed to study how Catherine got to all those defense pacts...

Napoleon was pleased with Saladin right up to the war declaration on Saladin and his vassal Ham. I think it is in Napoleon's personality profile to be able to go to war on someone he is pleased with on standard aggression? One addition point of disapproval came between them because of border closeness.
Sure, he's pleased with the "player". But the bug I found was that the internal "make a decision" code looks at the attitude to the team, and the attitude to the team averages in the attitude to vassals.

So someone can be pleased, yet treat the target like an enemy in actual diplomacy decisions, simply because they have a capitulated vassal that they dislike.
 
@Yakk
Yeah good point. Sorry to be a pest, but could you direct me to the function where this would be happening? This could be cleared up quickly. What do you think about the theory that intercontinental warfare is now highlighting the problem AI's have distinguishing between threats overseas verses threats at home?

If Napoleon dows on Saladin for spurious reasons in the code regarding vassal arrangements, for some reason, Napoleon neglects to think correctly about the threats to him at home for declaring an intercontinental war that feeds back into the home continent...

Basically because of Napoleon's dow on Ham in the new world, he now faces a neighbour war in the old world, which all of Napoleon's former Christian buddies resent, the fact that Napoleon has effectively dowed on a fellow christian in the old world. Napoleon is screwed by this. (EDIT Christianity is actually at 51% influence. This is pretty impressive and should be a big threat to Napoleon if he wants to dow on a fellow christian)

There could be something in the theory that war declarations are now more complicated and problematic, in the light of the AI's new found tactical abilities to invade incontintentally and make it work tactically, but at the expense of being a strategic debarcle. This is the equivalent of us humans, having given the AI a new "club" to beat fellow civs up with, neanderthal AI now needs to be taught more refinement and how to be a new age sensitive AI if need be. Think of it like the movie "My Fair Lady" becoming "My Fair AI".
Cheers.
 
Back
Top Bottom