the3dfxdude / 7kaa

Seven Kingdoms: Ancient Adversaries - Go to the main source repository at https://sourceforge.net/projects/skfans/ for source code and builds
https://7kfans.com
Other
253 stars 71 forks source link

improve ai economic management #256

Closed watery closed 1 year ago

watery commented 2 years ago

I don't know if this will be easy, however several matches against the AI (hardest level) end up with one or two kingdoms with big armies, but that ultimately self destroy running out of money, even if they have mines.

Can it be fixed or at least improved somehow? I almost never have a chance to fight against big opponents, because they estinguish before I can put together my big army.

the3dfxdude commented 2 years ago

1) What is your Computer's Aggressiveness setting? If you mean the hardest difficulty preset of V (5) or upwards to the difficulty score of 200, then the Computer's Aggressiveness is Very High. 2) Define more exactly, "against big opponents"? Are you suggesting multiple big (5-6) opponents? What is the expected population and military level? What are the size of the one or two kingdoms when you get down to that point? 3) Demonstrate the issue in a reproducible way, proving they run out of money, despite having a substantial income source. 4) Do you pause the game to issue orders? Do you use other potential AI exploits?

watery commented 2 years ago
  1. Difficulty is 193, set like this:

immagine

immagine

immagine

  1. I'll play again and try to make some saves, anyway they usually have military score over 300 points, and more than 5 villages controlled; and in the final part of the game it usually remains one kingdom, because it buys the others.

  2. I will try to; I say that they run out of money because I see their buildings loose hitpoints until they collapse and their units have loyalty that flips from 0 to like 15 and both happen to me when I bounce from 0 money to 100-200 due to tax income.

  3. I very rarely pause the game to do that, most of the times I do it to try to save my units before they die; the only other one I can think of is that I seldom "cover" a resource with a unit, to avoid the enemy to build a mine on it.

the3dfxdude commented 2 years ago

I'm not exactly sure if it will be possible to exactly show an issue using save games. Also being an economic based game, it's hard to say where to draw the line on what's good or bad, because money issues are allowed to happen.

I'm still trying to understand if your expectation is to have multiple (5-6) large opponents late into the game. Even 3-4. But that expectation is at odds with the Computer Aggressiveness setting of Very High. The way that feature is implemented, even though the devs scored that setting as a higher difficulty value, might not be harder in every game, or for how you play it. This setting makes the AI more aggressive to bring the game to a conclusion quicker by challenging you sooner. It seems most people complain there is an AI issue, or issue with buyouts, may be based on how the the devs wanted the AI players to unite to defeat you. The only thing without just removing this from the game is to prove that this directly causes an economic condition impossible to recover from, but so far I have not seen evidence to prove that this causes frequent chances for things to go wrong. In fact, it appears that it is a very rare chance, so what people perceive may be a series of unconnected things that people think is bad AI, but the AI isn't at fault here. Like I said, it is play styles at odds with each other, most likely.

So if we are not stopping all economic problems (the game devs intended some AI to play it risky with money...but we are not for removing all flavor of this in the game), and not stopping all diplomatic dialog based on aggression (little evidence this is a reason), then generally speaking it's hard to define if there are economic management issues really.

This is why I suggest to people to play with Computer Aggressiveness set to Medium. Because they generally want a longer game with larger AI, not a higher aggressive AI, and it's more likely to play that way with Medium for the setting.

watery commented 2 years ago

[...] I'm still trying to understand if your expectation is to have multiple (5-6) large opponents late into the game. Even 3-4. [...]

Thanks for your reply, and I'm sorry, looks like I should have explained it better. I just would like to have the remaining computer opponents, any of them (though there usually is just one lasting, due to the settings you mentioned), not self destroy.

Of course I understand this may be hard to change and I agree it may be per design or a consequence of several indipendent actions. Mine is just a question, not definitely a bug.

It just happened again today. Attached are several saves from a single match - skip the auto saves - it happened twice that the green opponent ran out of money - as I said, I guess that since its buildings start to lose points.

The first time is in GAMA_005.SAV, after loaded it should show a raw resource market that's being filled, indicating that the linked mine isn't exhausted; I then gave the opponent some money and it recovered. The second time is in the last save. if you let the game run all the green buildings should collapse; and it has a mine in the top part of the map full of resources.

7kaa.zip

watery commented 2 years ago

[...] This is why I suggest to people to play with Computer Aggressiveness set to Medium. Because they generally want a longer game with larger AI, not a higher aggressive AI, and it's more likely to play that way with Medium for the setting.

I will try this, thanks.

the3dfxdude commented 2 years ago

GAMA_0004.SAV is more interesting. They were having some rebellions. They also have a negative reputation and cash, and were at war with you. This wasn't the case in GAMA_0003.SAV, but this was much earlier. In 0003 they have a pretty robust economy, and should still be the case, given the factor workforce and pop. But they lost alot of pop. What happened before 0004? Did you kill alot of their people? They also have rather conservative AI preferences, meaning this AI tended to save up food and money and build up soldiers with high enough combat rating before expending. This might be why they lasted till the end.

For the most part, the game lasting 20 years is probably around 2 hours of game time, without much pausing, where they starting faultering. That is a pretty typical game. And not bad at all for a Very High aggression setting. But you kept them alive for around another hour after their impending collapse. Frankly they've been defeated somehow, but it wasn't economic. In this game, you have several ways of defeating an enemy. You don't have to kill them to the last man. They also play by the same rules and have to keep their people happy. They reputation tanked before they ran out of money. Why did their reputation tank? The event probably happened in the 1 year before 0004.

the3dfxdude commented 1 year ago

So while running some simulations the past couple weeks I noticed an ai town's rebellion and wanted to check it out. It is now determined that the ai does accidentally trigger rebellions due to an unfortunate code construct in recruiting. This is now fixed.

It is not an economic issue, so this does not really address the request topic you filed on. But it is similar to what I saw in your game, although I can't prove that to be the case, since I don't have the complete history of your match. I don't have any direct examples of bad economic management in your data. But since triggering rebellions is serious enough, I think it's fair to say, this is the kind of ai improvement we will need so closing on this fix. Please check the game when you get a chance.

6988eb3564277c0441d57362f2a95d442440f676

watery commented 1 year ago

@the3dfxdude I'm sorry, I haven't had much spare time in the last weeks to play.

What happened before 0004? Did you kill alot of their people?

Too much time passed, but anyway, if with "Did you kill alot of their people" you mean civilians, then no, I never do that. And in high aggressiveness games I undergo enemy attacks more often than me attacking them.

They reputation tanked before they ran out of money. Why did their reputation tank?

I have no idea about that play. But after your questions I put more attention to my actions. During games it happens very frequently that computer players propose friendhips or alliances, that I accept, just to suddenly request aid or embargos or declarations of war which I then reject, causing them to immediately break the friendship or alliance - which IIRC should lower their rep. But those same players usually re-propose the same really soon, and I do the same accept-and-reject cycle, hitting they reputation again, I suppose.

I guess this may be a source of their rep sinking.

Another one could be that they send so many spies one after the other - I often see 4 or 5 walking together - that are easy to identify and kill. Maybe this could be harder to review, I don't know.

So while running some simulations the past couple weeks I noticed an ai town's rebellion and wanted to check it out. It is now determined that the ai does accidentally trigger rebellions due to an unfortunate code construct in recruiting. This is now fixed.

Cool!

Please check the game when you get a chance.

Would like to, but how? I'm on Windows, can you provide an executable?

Moreover, I thought that maybe you could add some kind of log of AI decisions (i.e. to an ad hoc executable or triggered with a CLI option) so that I can then post back that trace.