A Better AI.

I do not see that as being a big problem. This is after all a test site.

All Blake or Iustus have to do is say this version needs a new game to be started. Then testers can choose to keep playing with the old version (that is what I tend to do) or download the new version and start a new game. :)
Actually what I'm saying is that if the save file is in XML (I really don't know; maybe I should look?) or partially so, then if there are some tags and data in there that the previous version(s) don't understand, they might be safely ignored. Hopefully nobody was clever enough to have the game crash with a message like "PANIC!!! UNRECOGNIZED NODES IN SAVE FILE!!! ERROR #3993822!!!" Meaning that if you load a game from a "newer" version into an older core, stuff like extra settings will simply be lost but the rest will be fine, and you could continue play.

It's not like the good old days when everything was binary crapola that, unless carefully thought out by the design team, was not particularly extensible.

Considering I'm supposed to be an alpha nerd, I should probably start looking at some of this stuff in person rather than making you folks proxies.
 
Governor issue...running Caste Syste and Pacifism, my Globe Theatre and National Epic city with a healty food surplus...my desire is to get a Great Merchant, but the governor prefers to assign tons of Scientists regardless of the setting I choose (without any emphasize, emphasize GP, emphasize Commerce or additionally emphasize commerce/GP...should not at least the last variant make the governor assigning merchants?).

Either this is still an old routine from stock rules (where the governor prefers scientists as well) or it has to do with the booster buildings in the city:

Science:

Library (+25%)
Observatory (+25%)
University (+25%)
Academy (+50%)


Commerce:

Market (25%)
Grocer (25%)
Stock Exchange (65%)


Thats 125% vs. 115% for the Science department...but shouldn't my focus "commerce" overwrite that? Even if that is less efficient in terms of maximizing output - a GM is a valid goal as well.

If needed, I can provide a save.

There are 3 types of commerce: gold, research and culture.

In a previous build, I equated commerce with gold, because there was no way to emphasize gold directly. This had some issues.

Now, when you emphasize commerce, it uses your gold/research/culture slider as a modification on which specialist to use. If you are 100% culture, you should get artists (and down to 80% or 70% culture as well). If you are at 80%+ to gold, you should get merchants. Under normal high research conditions you will get scientists.

Now, I know this is not perfect. But the problem is that the interface does not provide a way to specify emphasize gold or culture. The engine actually supports it, and under cultural victory conditions, the AI actually turns on emphasize culture in the top cities, but there is no way for a human to do it.

I fear that in the case where you want to spawn great merchants, you are just going to have to manually force merchants, unless you are willing to run a high gold rate.

You can leave the governor on and still force merchants, the correct procedure is to just hit the "+" key by the merchant, and it will increase, with the highlight around the box. The governor will remain on. If you want to decrease the number of forced specialists, you can hit the "-" key, but only to the point of removing the specialists you forced. If you remove more than that, it will turn off the governor.

Unless it has no more plots to work, forcing specialists will cause the governor to not assign any specialists on its own. (Unless you only force one specialist and your civics and wonders force two, in which case it has to assign one).

-Iustus
 
I do not see that as being a big problem. This is after all a test site.

All Blake or Iustus have to do is say this version needs a new game to be started. Then testers can choose to keep playing with the old version (that is what I tend to do) or download the new version and start a new game. :)

This is against one of the design goals of this project, which is to preserve save game compatibility. We want it to be easy to drop in and out the BetterAI, without having to worry about save game compatibility.

-Iustus
 
Actually what I'm saying is that if the save file is in XML (I really don't know; maybe I should look?) or partially so, then if there are some tags and data in there that the previous version(s) don't understand, they might be safely ignored. Hopefully nobody was clever enough to have the game crash with a message like "PANIC!!! UNRECOGNIZED NODES IN SAVE FILE!!! ERROR #3993822!!!" Meaning that if you load a game from a "newer" version into an older core, stuff like extra settings will simply be lost but the rest will be fine, and you could continue play.

It's not like the good old days when everything was binary crapola that, unless carefully thought out by the design team, was not particularly extensible.

Considering I'm supposed to be an alpha nerd, I should probably start looking at some of this stuff in person rather than making you folks proxies.

The save file is binary. The way that save files are created (basically just streaming out class information), makes it incredibly easy to make a save game file incompatible. If you take a look at a lot of the mods out there, they do exactly this. The worst is when each new build breaks save games. We want to avoid this in BetterAI.

Now, Firaxis could take the initiative and re-do their save games to allow for expansion in a much more sensible fashion, then that would open a lot of possiblities. Something as simple as a class writing in the file how many bytes it wants to use, so that subsequent versions can make the size bigger without throwing everything else after it out of sync.

Spoiler :
There are a few cases of some zeros getting written out in the save file which are never used, and we are looking at using these for some values, if we can do it in a sensible fashion. (We already have added one used to determine city roles). The problem is we need to be sure that we will not cause problems if the save is read by an unmodified game. (For example, there is a whole array of numbers, one for each plot on the map, for each player in the game, which is blasted every turn with new numbers, and if the save game read just regenerated the numbers, we could reuse all of those values, but the problem is that the firaxis version just uses the values from the save until the next turn.)


-Iustus
 
It's not like the good old days when everything was binary crapola that, unless carefully thought out by the design team, was not particularly extensible.

Hey - how did you know I was from the good old days. :D

And you are wrong about the design team - they designed what the salesmen wanted. :p

It was us poorly paid programmers that had to redesign things to get the computers to work properly, as the orriginal design was usually impractical - and we got no thanks for the extra effort we put in. :cry:

If we had followed the design spec - it would have not worked and we would have got the blame anyway - not the designers etc.

And I speak from experience. But hey - I later became a designer. Revenge is sweet. (just joking - about the revenge).
 
The save file is binary. The way that save files are created (basically just streaming out class information), makes it incredibly easy to make a save game file incompatible. If you take a look at a lot of the mods out there, they do exactly this. The worst is when each new build breaks save games. We want to avoid this in BetterAI.

That's kind of disappointing. So the deserialization process goes wrong if there's stuff there it doesn't expect? It would seem like there's a way around that, but you're the expert.

You could add a separate XML file (per game) for meta information like additional options. That's not beautiful but not that bad, especially if you could get other mod writers to use it. How do the various gizmos in the HOF modpack do that anyway? Or do they break the save file. (I was kind of grossed out by those mods so I never got around to looking at that.)

And yes I think it's a very good idea not to fork (or bork) the save file format.
 
Hey - how did you know I was from the good old days. :D

Because there are a disturbing number of old farts like me playing this game. My first computer was a TRS-80 Model I, before it was called a Model I, although my programming experience really began with an SR-52 ....
 
Because there are a disturbing number of old farts like me playing this game.

Well all I can say is - hello fellow old fart. :D

I started programming (job) in the late 60s. Using a semi- computer/accounting machine. We wrote hexi-decimal machine code.

My first home computer was a Sinclair ZX80 - in the early 80s.

Only used it to play and modify games for fun (games were written using a simplified basic and some machine code). At work, in the 80s and 90s, I either programmed/designed systems for real - or trained other professionals (customers - who had bought our systems) how to write software for real-time fault tollerant computer networks.

Of course in those days there were a lot of propriety operating systems. So a lot of people doing similar work for different companies, with different operating systems.

Sigh: The good old days. :cry: :p ;) :)

Oops - sorry for the off topic thoughts.
 
Regarding build 11/02, played a game yesterday:

The warmonger (Genghis in my game) took a very long time moving into a dagger strategy. Most of the time was spent him building himself up (didn't have copper and took a while getting iron). He disliked his neighbour but did nothing until he commited to a limited war. Then he went into a dagger strategy and chopped an army. It took a very long time to get to this point though.

Maybe it might be better if the warmongers started in a dagger strategy and then when they start to 'choose' their target, they will then be prepared to strike. The 'choosing' process takes quite a long time in my opinion. Maybe with this way of going about it, the dagger strategy might give them more war options if it were pre built and allow them to settle on an opponent much earlier.

The fluctuating power ratios in the early part of the game I think screw up the warmongers up when choosing their targets. Because the power ratios move around so much in the early expansion stage, no warmonger really chooses war until the power ratios start to settle down and remain constant (at around 250ish or more in my game. The higher, the more stable I would think).

Maybe there could be a stage where the warmongers would ignore the power rating initially and instead focus more on their ability to take a city or something. Maybe looking at initial attack strategies or combinations that are available to them. For instance:

* 5 warriors can take down 2 archers defending a city convincingly.
* 4 axemen can take down 2 archers defending a city convincingly.
* catapults can take down city defenses, rendering them useless. When the city defenses gets too high, the need for seige becomes more important.
* etc.

Basically, the warmonger would be looking to set itself up to hit a city (ie, a dagger attack) without regard for the power rating -- especially in the begining where the power ratings are bouncing around too much. It might result in more ambition in the conquests of some leaders. The decision making order might be:

* set up for a dagger strat (resolving production (chopping, pop rushing, etc), techs, building good stacks, etc).

* when ready, go after the one that is most likely gauged at being attacked (the one with the highest value).


Basically, instead of focusing on power ratios, focus the warmongers on attacking in a tactical sense: "Build what I need to attack that city and keep it; Build what I need in order to keep advancing." A lot like the human does. Using the power rating to gauge whether a civ should go to war or not isn't really an accurate way for a warmonger to know whether they'll succeed or not. It should be calculated in a tactical sense based on what it can muster up and whether it will be effective at accomplishing its objective. The power rating will then increase with this way of thinking anyway. Right now, the warmongers just sit there until they find themselves (by accident) in a better position by the normal process of building and then seek to build what's needed (ie, dagger strat) to capitalise on it; Instead: have them intentionally put themselves in a good position (with a dagger strategy) which will then give it more opportunities to go to war and be in a generally better position for war.

In my opinion, it's this lack of 'ambition' - or intention - for the warmongers that is what's missing the most in this game. The dagger attack is fantastic to watch: To see them chop a force; stack 'em and take down a rival: Great to watch! That's the ambition/intention I am talking about. The warmongers (mainly the conquerors in the game moreso than the warmongers) need to take this ambitious, intentional approach right from the first unit built. That is, Genghis and co need to start off with a dagger strategy right away and then capitalise on that and keep going. The warmongers goal should be to build a decent attack force first, not to compare power ratios, wait for it to stablise, decide on an enemy, move into a dagger strategy and then go to war.

It is a very distinct difference to see the warmongers play the game normally and then shift into 'dagger mode'. If, at the very least, the 4 conquerors were in a permanant state of 'dagger mode' that takes into account the tech, economy, cities, growth, production, etc, then I think the conquerors would feel right. (hopefully).

Great work you guys :) :thumbsup:
 
Regarding build 11/02, played a game yesterday:

The warmonger (Genghis in my game) took a very long time moving into a dagger strategy. Most of the time was spent him building himself up (didn't have copper and took a while getting iron). He disliked his neighbour but did nothing until he commited to a limited war. Then he went into a dagger strategy and chopped an army. It took a very long time to get to this point though.

Maybe it might be better if the warmongers started in a dagger strategy and then when they start to 'choose' their target, they will then be prepared to strike. The 'choosing' process takes quite a long time in my opinion. Maybe with this way of going about it, the dagger strategy might give them more war options if it were pre built and allow them to settle on an opponent much earlier.

The fluctuating power ratios in the early part of the game I think screw up the warmongers up when choosing their targets. Because the power ratios move around so much in the early expansion stage, no warmonger really chooses war until the power ratios start to settle down and remain constant (at around 250ish or more in my game. The higher, the more stable I would think).

Maybe there could be a stage where the warmongers would ignore the power rating initially and instead focus more on their ability to take a city or something. Maybe looking at initial attack strategies or combinations that are available to them. For instance:

* 5 warriors can take down 2 archers defending a city convincingly.
* 4 axemen can take down 2 archers defending a city convincingly.
* catapults can take down city defenses, rendering them useless. When the city defenses gets too high, the need for seige becomes more important.
* etc.

Basically, the warmonger would be looking to set itself up to hit a city (ie, a dagger attack) without regard for the power rating -- especially in the begining where the power ratings are bouncing around too much. It might result in more ambition in the conquests of some leaders. The decision making order might be:

* set up for a dagger strat (resolving production (chopping, pop rushing, etc), techs, building good stacks, etc).

* when ready, go after the one that is most likely gauged at being attacked (the one with the highest value).


Basically, instead of focusing on power ratios, focus the warmongers on attacking in a tactical sense: "Build what I need to attack that city and keep it; Build what I need in order to keep advancing." A lot like the human does. Using the power rating to gauge whether a civ should go to war or not isn't really an accurate way for a warmonger to know whether they'll succeed or not. It should be calculated in a tactical sense based on what it can muster up and whether it will be effective at accomplishing its objective. The power rating will then increase with this way of thinking anyway. Right now, the warmongers just sit there until they find themselves (by accident) in a better position by the normal process of building and then seek to build what's needed (ie, dagger strat) to capitalise on it; Instead: have them intentionally put themselves in a good position (with a dagger strategy) which will then give it more opportunities to go to war and be in a generally better position for war.

In my opinion, it's this lack of 'ambition' - or intention - for the warmongers that is what's missing the most in this game. The dagger attack is fantastic to watch: To see them chop a force; stack 'em and take down a rival: Great to watch! That's the ambition/intention I am talking about. The warmongers (mainly the conquerors in the game moreso than the warmongers) need to take this ambitious, intentional approach right from the first unit built. That is, Genghis and co need to start off with a dagger strategy right away and then capitalise on that and keep going. The warmongers goal should be to build a decent attack force first, not to compare power ratios, wait for it to stablise, decide on an enemy, move into a dagger strategy and then go to war.

It is a very distinct difference to see the warmongers play the game normally and then shift into 'dagger mode'. If, at the very least, the 4 conquerors were in a permanant state of 'dagger mode' that takes into account the tech, economy, cities, growth, production, etc, then I think the conquerors would feel right. (hopefully).

Great work you guys :) :thumbsup:

But so many people here(include me) reported exactely the other way around! The AI builds a big dagger aqttack, but then just didnt go to war! It waited too long to go to war abd then the units were kinda of obsolete already..
But this was in 3 versions ago or so, perhaps they changed this, I still have to see the last version more deeply, I dont have much time to play right now hehe.
 
test of 12-02

Diary part 2

BC 1330

First 3rd AI city: Rome, Russia

BC 995

First 4th AI city: Spain (she was latest to start settlers at size 7 of Madrid!)

BC 625

First 5th AI city: Spain – Toledo – Now, was THAT a good move???

BC 130

Brennus gets Confucianism – he is the other religious civ

410

Shaka strongly prepares for a war…
Taoism is by Japan

575

Japan attacks Spain with a big stack ca. 10 units!!! :D
Spain is weak, with only a few archers per city…

900

While Japan kills Spain, Rome has a kind of sneak attack on Japan! :goodjob:

1322

A funny thing happened – I am killed off by a co-team of Shaka and Alex!
The stacks of doom were impressing, I could not cope with two fronts
And the tides of the stacks!

Well, I made myself an isolated tiny island to watch the game on…

On the other continent, things are exciting indeed!

Japan has reduced Spain to Madrid and Barcelona, alright.

First Toku could hold off Augustus, but then
Toku went on and captured Madrid BUT in the meantime
Augustus went around and captured 3 of Japan’s cities!

What is more, Brennus on the north is now also in war with Toku!
I think Toku will have it real bad...

Oh, pretty soon after this Japan became vassal of Rome! :lol:
 
But so many people here(include me) reported exactely the other way around! The AI builds a big dagger aqttack, but then just didnt go to war! It waited too long to go to war abd then the units were kinda of obsolete already..
But this was in 3 versions ago or so, perhaps they changed this, I still have to see the last version more deeply, I dont have much time to play right now hehe.
Interesting. I have only just gotten into this mod though, so I don't know of the past issues of this mod (and I *aint* reading this whole thread, especially at the speed this thread moves, I wont ever catch up :lol:).

Maybe they should just build it up and then go for it *BASED* on their ability to attack rather than waiting for the AI to settle on a target. So, go straight into the dagger strat, then when they have the military built, they then go after the one who has the highest value. So being prepared triggers the war, not just a random number generator or something. That would make more sense and they wont attack with an obsolete military as they will attack shortly after building their stack.

The problem here is the AI making its mind up with whom to attack and I think that has to do with the fluctuation changes of the power rating in the begining of the game. Once they settle, the values start to intensify and wars start.

Kettyo said:
You misunderstand this i think.
I'm very confident that 'MaxWarNearbyPowerRatio' and 'MaxWarDistantPowerRatio' mean how much power we must have compared to rival to able to declare war on them.
So 50 means 50% power is enough (would be foolish).
200% means you need double the power rating (cowardly )
Having looked at this 11/02 build, I have noticed what the maxNearbyPowerRatio really is. The 200 value I had for Genghis actually is the opposite of what you were thinking (and I was completely way off): A nearby power ratio of 200 means that it will consider any 'nearby' civ (what ever that entails) that has a power rating no more than 200% of its own power rating. Iow, if the other civ has a power rating less than 2 times its own power rating, it will still consider it for war. Thus, the higher the value, the more 'brave' they are and the lower the value, the more 'cowardly' they are. Generally, the warmongers are over the 100% mark and the peaceful leaders are below 100%.

So, maxNearbyPowerRatio means the maximum power ratio the other leader can have in order for them to be considered a potential target for war. If the other leaders power ratio is greater than <maxNearbyPowerRatio> percent of their own power rating, then they will be scrubed out as someone to go to war with.

This explains why it went to war with a value of 200.

@V. Soma: That game looks great :)
 
I just made a test in my last game, and the result is really interesting*stupyd*.

First off, Tokugowa just declared war on me, showing up 2 galleons + 2 frigates near a small island where I have 2 little cities. I dont know what is inside that galleons, but lets just say Im 2 Eras in front of him.. And lets not forget that my power is almost the double of him(I was preparing myself to attack Shaka as soon as Rocketry comes online) and Im in the other side of the world in anothewr continent..
So I reloaded 1 turn before for test, and did some arragements..First off, I made Brennus(and his vassal Wang) to declare war on him, they are in his same conmtinent and togheter have double his power..Then I signed a defensive pact with Monty(that by the way is friendly heh) that is the second in power and have like 3 times his power..

So I pressed enter, and what was my surprise to see that Toku declared war on me anyway....He will get so mssed up my god..

I think you guys should *fix* it..
 
I just made a test in my last game, and the result is really interesting*stupyd*.

First off, Tokugowa just declared war on me, showing up 2 galleons + 2 frigates near a small island where I have 2 little cities. I dont know what is inside that galleons, but lets just say Im 2 Eras in front of him.. And lets not forget that my power is almost the double of him(I was preparing myself to attack Shaka as soon as Rocketry comes online) and Im in the other side of the world in anothewr continent..
So I reloaded 1 turn before for test, and did some arragements..First off, I made Brennus(and his vassal Wang) to declare war on him, they are in his same conmtinent and togheter have double his power..Then I signed a defensive pact with Monty(that by the way is friendly heh) that is the second in power and have like 3 times his power..

So I pressed enter, and what was my surprise to see that Toku declared war on me anyway....He will get so mssed up my god..

I think you guys should *fix* it..

AFAIK, this has always been the case. Once an AI has decided to attack you, going back a few turns and changing things won't affect that decision.
 
AFAIK, this has always been the case. Once an AI has decided to attack you, going back a few turns and changing things won't affect that decision.

That is exactely the PROBLEM :p

They HAVE to consider the defensive pacts and others attacking them even after the decision, isnt it logical?

Toku is getting owned out here..And I didnt use that save, I just asked Brennus to declare war on ihm after he declared war on me!

The stack of Toku was only some knights and trebutchets, easy..
 
diary of 12-02, part 3

ca. 1350

Monty attacks Bismarck in the north of &#8220;my&#8221; continent

1418

Monty&#8217;s war against Bismarck is a stalemate, but now Stalin declares war on Bismarck!
My guess is that Bis is strong
Yes, the Germans defend well &#8211; peace is set

1526

Monty attacks Alex
Early middle ages war
It is a quick draw (1-1 city changed owner)

1589

Shaka and Caesar has gunpowder

1670

Spain becomes peacefully vassal of Celtia

1706

Big war: Rome/Japan vs Celtia/Spain &#8211; outcome seems to be clear, Rome has greandier...
In some 5 turns: Spain is destroyed, Brennus is vassal of Caesar
The whole continent is under the rule of Caesar!
Rome has 30&#37; of land and 30% of population
 
1825

The Rome &#8220;colaition&#8221; attacks Greece
Will the overseas war be successufl and efficient?

1850

The war is silent, the inital stack was destroyed by Alex.
Rome has Rocketry, Greece is yet to have Rifling

1867

Monty attacks Alex, thus joins Rome...
Cavalry vs Rifle
Monty recaptures a city of his, then heads to and captures Athens!
After which peace is set btw. Monty and Alex

1890

Stalin peacefully becomes vassal of Shaka
but not for long

Rome lands a second wave of forces on Greece&#8217;s land

1919

Rome lands a third wave of forces on Greece&#8217;s land
These have gunships and tanks

Caesar completes Apollo Program

Alexander gives in &#8211; vassal of Caesar!
Rome has 36&#37; of population, 35% of land

1973

Rome and Co attacks Monty

1988

After the second tide of attack, Monty becomes vassal of Rome!
Rome has 4 vassals, and has 46% of population, 42% of land

Rome prepares war agains Russia

1998

UN is built
Rome needs 3 more parts for the SpaceShip

2004

Rome and Co. declares war on Russia

Again, when the second tide came, Russia becomes vassal of Rome!
Rome has 50% of population, 46% of land

2018

Rome wins Space Race
 
Oh my god!! Caesar almost won a domination victory!!!!
DO you know how unlikely is this??!!?!

Man, nice game!


Is it all because of the Better AI mod? How lovely!
 
AFAIK, this has always been the case. Once an AI has decided to attack you, going back a few turns and changing things won't affect that decision.
I'm not sure what the lead time is but it must be on the order of 10 turns. You have to go several autosaves back if you want to "change the past to alter the future." Funny, when you do that enough, you realize that probably someone was going to attack you -- if you appease the guy you know is coming after you, often someone else shows up after things would have started originally.

I think that some of the AIs should have the ability to "change their minds" after beginning prep for an attack. Monty, Alex, they're just bonkers, but Mansa Musa for example might prefer to mellow out at the last minute.

Also I think this has been said in one form or another here before, but I'd like the AI to sue for peace more quickly in some situations - I don't know what's the fun in Alex landing boatload after boatload of, say, knights that I mow down. He can do the math: no territory gained, no significant pillage, units going away quickly. Even Alex might get the hint and go look elsewhere for a while.
 
After this test:

My fear is that the non-agressive civs are hindered now.
There should perhaps be a tweak on diplomacy so that a clever culture-civ could "win" a "big brother" that can be called to be ally...
or something like that...

hm?
 
Back
Top Bottom