Latest Posts

Topic: Some small Ideas, improving a lot

king_of_nowhere
Avatar
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2020-04-12, 05:15

hessenfarmer wrote:

the-x wrote:

If we want to strenghten AI in the mid and long game, maybe adding soldiers randomly would help after 1 hour every 10 min a soldier who is randomly trained -?

only a few posts above we already discussed that the Ai is wasting its soldiers attacking with half healed and every single soldier until they are completely worn out. if we can get it to not doing so and increase their ability to train this might help better. I know this is also hard to achieve but I belive the effort is better spent on this then on any "simple" hack which might cause a lot of side effects all around the code.

on the other hand, the AI was trained by random games, and the current mechanics favor attack. so, the AI is attacking with all as soon as it makes first contact because that's the best strategy. which, as I stated in many other places, is IMO the major flaw of this game at the moment, and should be fixed by making defence better.

as for the AI wasting soldiers that are almost dead, remember that the option to choose which soldiers attack was added recently. perhaps the AI still can't do that?

hessenfarmer wrote:

king_of_nowhere wrote:

Nordfriese wrote:

Ähm… could you please define how exactly this X value is to be determined? It first sounded like a per-player factor that can reduce production times for hard AIs, now it's suddenly a single number…?

it's a single number for every player. so, at most 8 numbers.

but the number stays the same throughout the game once defined. So, you start blue player and as human X is 1. Say you set up a hard AI, with X=0.5. Then for the rest of the game blue player has X=1 and red player has X=0.5

Have thought a second time about your proposal. This will only work if the AI has full productivity in the whole chain. If it lacks some ressources which it constantly does this might not have the desired effect anyway.

even if the AI has a bottleneck through its economy, having the buildings work twice as fast will also make the bottleneck work twice as fast.

only if the AI completely lacks some building then its economy won't work, regardless of how fast it goes. but it rarely does that bad.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-04-12, 12:34

blind3rdeye wrote:

Regarding the AI's decision making for attacks. I think one of the flaws in the way the AI uses soldiers is that they trickle in attackers who have essentially no chance of doing any damage. The AI is just throwing away soldiers. So I've got a suggestion about AI behaviour. (I haven't read the existing code for this, so I'm not sure if what I'm saying is a viable or sensible idea.)

When the AI launches an attack, it should remember:

  • Where it chose to attack (or at the very least, which player it was attacking)
  • The net strength of its attack (a rough sum of all the stats of the soldiers sent out)
  • Some measure of the outcome; perhaps a ratio like (net strength of enemies killed) to (net strength of our soldiers killed), or perhaps something just as simple as number of enemy soldiers killed

My basic idea is that if the AI launch an unsuccessful attack, it should then know to not attack again until it can launch of a stronger attack force. unsuccessful could simply mean that zero enemy soldiers were killed; or it could be something more complex related to the ratio mentioned above. And of course, the decision making should include a random chance to just attack again anyway, just so that players can't predict & exploit the AI behaviour too easily.

This suggestion is not bad I will keep it in mind when I finally find some time to dig into the code of attack decisions.

...

And as a complete aside, someone mentioned defender advantage - and I know that has come up a few times in other threads. I've got a little thought-bubble idea for that. Someone recently informed me the chance of a soldier winning a skirmish was significantly affected by which soldier strikes first. Perhaps the rules of battle could be such that the home-ground soldiers always strike first - or are more likely to strike first - or strike first under certain circumstances (such as when they come out of a building). It's not really on-topic for this thread, but its just a little idea that I haven't yet given a lot of thought too.

I have suggested this before But I didn't find the time to try to implement it. However the code made it more complicated that I first thought which player to get the advantage. As I can't say from the code yet which one will strike first it might be a chasing defender could do this as well.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-04-12, 12:45

king_of_nowhere wrote:

hessenfarmer wrote:

the-x wrote:

If we want to strenghten AI in the mid and long game, maybe adding soldiers randomly would help after 1 hour every 10 min a soldier who is randomly trained -?

only a few posts above we already discussed that the Ai is wasting its soldiers attacking with half healed and every single soldier until they are completely worn out. if we can get it to not doing so and increase their ability to train this might help better. I know this is also hard to achieve but I belive the effort is better spent on this then on any "simple" hack which might cause a lot of side effects all around the code.

on the other hand, the AI was trained by random games, and the current mechanics favor attack. so, the AI is attacking with all as soon as it makes first contact because that's the best strategy. which, as I stated in many other places, is IMO the major flaw of this game at the moment, and should be fixed by making defence better.

as for the AI wasting soldiers that are almost dead, remember that the option to choose which soldiers attack was added recently. perhaps the AI still can't do that?

Yes the Ai can't do so currently. And yes some part of AI is dependent on training and has been trained. However some behaviours haven't been improved by training and we already fixed some of them as they were lying in the code not in the training (examples are dismantling military buildings in enemy presence, not expanding into unguaded enemy land and a few others). I have the strong suspicion that this migth be the case with the attack decision as well, cause it is attacking further and further although it could measure the enemy is much stronger. The AI knows how strong the enemy is in a certain region. by this it should make better deciisions.
Implementing attacker selection would be a benefit as well so I will look if this is possible as well.

hessenfarmer wrote:

king_of_nowhere wrote:

Nordfriese wrote:

Ähm… could you please define how exactly this X value is to be determined? It first sounded like a per-player factor that can reduce production times for hard AIs, now it's suddenly a single number…?

it's a single number for every player. so, at most 8 numbers.

but the number stays the same throughout the game once defined. So, you start blue player and as human X is 1. Say you set up a hard AI, with X=0.5. Then for the rest of the game blue player has X=1 and red player has X=0.5

Have thought a second time about your proposal. This will only work if the AI has full productivity in the whole chain. If it lacks some ressources which it constantly does this might not have the desired effect anyway.

even if the AI has a bottleneck through its economy, having the buildings work twice as fast will also make the bottleneck work twice as fast.

only if the AI completely lacks some building then its economy won't work, regardless of how fast it goes. but it rarely does that bad.

We already increased the AI willingness to build up more economy and still it is not working at a very high efficiency level. I doubt that this proposal would have as much effect as it costs to code and test that. It is just my personal opinion but we have to choice where to spend our work in the moment. So please don't expect us to achieve too many things at once. And yes spending some work in a feature is always dependent on personal taste as motivation is only to invest time in things you are personally convinced about.
Although the idea isn't that bad to achieve different levels of AI.


Top Quote
the-x
Avatar
Topic Opener
Joined: 2019-01-19, 13:23
Posts: 967
Ranking
One Elder of Players
Posted at: 2020-04-12, 13:54

We already increased the AI willingness to build up more economy and still it is not working at a very high efficiency level. I doubt that this proposal would have as much effect as it costs to code and test that. It is just my personal opinion but we have to choice where to spend our work in the moment. So please don't expect us to achieve too many things at once. And yes spending some work in a feature is always dependent on personal taste as motivation is only to invest time in things you are personally convinced about.
Although the idea isn't that bad to achieve different levels of AI.

I'm saying the the AI is really a sign for excellence. In many different ways it know how to otpimalize perform. Though many cases you of course wonder why the AI does that, but in general and for all the work, the knowlegde the AI has it is a genios thing i think. I mean we dont have to put a lot more work in it, since its work ;-D i mean if it is fun, then of course why not. As conclusion maybe we can try to improve little things, by adding parameters, starting conditions or an "eco" AI which builds up eco first, a fast AI which all parametrs aim at fast producing, or any Idea.


Top Quote
the-x
Avatar
Topic Opener
Joined: 2019-01-19, 13:23
Posts: 967
Ranking
One Elder of Players
Posted at: 2020-04-12, 14:04

The Altanter need something like experience in the smithy, so that not so bleak times arise that after 16 minutes you have a full hero or in the game after 19 minutes. This is way too early, not only because they have a significant advantage over the others (it doesn't help that they have fewer units to start with), there is nothing better than one full hero ... except two full heroes

The experience is an exciting thing that Sir Ver first came up with with the barbarians / empire. It works very well there, for example the mines of the barbarians or the upgrading of the inns. At the moment experience is something that seems superfluous, you have it But mans does not use either. Since it would definitely not be in the inventor's interest to gain experience, it might make sense to think about several expansion stages. These are graphically the same, so they are an effort only in terms of numbers.

Alternatively, it could be done so that the building is not expanded, but the person inside needs a certain experience based on different Making things. This is exactly the founding idea of ​​Widelands that SirVer had, for example among the barbarians. I rarely spoke to him, but some things still in my head.

Concrete:

Trident - level 0

verb. Trident - level 8

Steel trident - level 16

verb double triangle - level 32

This helps a lot to do justice to the hero of the Atlanter problem, who is too fast. It also solves the "what's stronger than a hero paradox" by always making the next stage possible after a certain time (30 min, 45 min, 1h).

Das mit der Erfahrung ist ja eine spannende Sache, die Sir Ver sich erstmals mit den Barbaren / Imperium ausgedacht hat. Dort funktioniert das auch sehr gut, beispielsweise die Minen der Barbaren oder die Aufwertung der Wirtshäuser. Momentan ist Erfahrung ja so etwas was überflüssig erscheint, man hat es zwar nutzen tut mans aber auch nicht. Da es ja bestimmt nicht im Sinne des Erfinders wäre Erfahrung raus zu machen, könnte es Sinn machen über mehrere Ausbaustufen nachzudenken. Diese sind grafisch gleich, also einzig und allein von den Zahlen her ein Aufwand.

Alternativ könnte man es so machen, dass das Gebäude nicht ausgebaut wird, sondern die Person drin einen bestimmten Erfahrungswert benötigt um verschiedene Dinge herzustellen. Dies ist auch genau die Gründungsidee von Widelands die SirVer hatte, beispielsweise bei den Barbaren. Habe leider erst selten mit ihm gesprochen, aber einiges noch im Kopf.

Konkret: Dreizack - level 0 verb. Dreizack - level 8 Stahl Dreizack - level 16 verb Doppeldreizack - level 32

Dies hilft sehr stark auch um dem zu schneller Held der Atlanter-Problem gerecht zu werden. Außerdem löst es das "was ist stärker als ein Held Paradoxon" indem immer die kommende Stufe erst nach gewisser Zeit (30 min, 45 min, 1h) möglich wird.

Edited: 2020-04-12, 14:07

Top Quote
JanO
Avatar
Joined: 2015-08-02, 11:56
Posts: 177
Ranking
At home in WL-forums
Posted at: 2020-04-12, 14:06

Would it be easier to code something that forbids AI to attack too frequently? Just a simple timer which is triggered by each attack and sets a time between, lets say, 20 and 30 minutes (or whatever).

I like the idea to set the right to hit first to the soldier who is in his own borders. But I would suggest to set it to the soldier who is closer to his home land. Imagine a battle on neutral ground.

Also sometimes I miss more general statistics, too. Something which counts an artificial value for the wares where each ware is not just 1. Like primary goods that are produced without input count 1, improved goods like hardened log count 2, ore count 2, improved food count 3, weapons and tools count 4 or 5. Similar for soldiers: I would like to have second statistics which only count numbers, not strength.

Last but not least: Can the visualization in the statistics window be changed in a way that the y-axis is either manually scalable or scales based only on the visible x-interval?


Top Quote
the-x
Avatar
Topic Opener
Joined: 2019-01-19, 13:23
Posts: 967
Ranking
One Elder of Players
Posted at: 2020-04-12, 14:12

JanO wrote:

Would it be easier to code something that forbids AI to attack too frequently? Just a simple timer which is triggered by each attack and sets a time between, lets say, 20 and 30 minutes (or whatever).

+1 like this Idea very much

We can do this ramdomly so the player doesnt know or exponential like starting

30, 40, 60, 100, 150 minutes in gametime

so later waves will get more production and bigger and harder to solve

if this is not enough, we can add randomly generated soldiers for AI after 2 hours, 3 hours, so you are not sure you win when you survived the first wave

Also sometimes I miss more general statistics, too. Something which counts an artificial value for the wares where each ware is not just 1. Like primary goods that are produced without input count 1, improved goods like hardened log count 2, ore count 2, improved food count 3, weapons and tools count 4 or 5. Similar for soldiers: I would like to have second statistics which only count numbers, not strength.

Yes, maybe we can remove lost buildings, lost soldiers and add this instead


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-04-12, 14:13

the-x wrote:

The Altanter need something like experience in the smithy, so that not so bleak times arise that after 16 minutes you have a full hero or in the game after 19 minutes. This is way too early, not only because they have a significant advantage over the others (it doesn't help that they have fewer units to start with), there is nothing better than one full hero ... except two full heroes

The experience is an exciting thing that Sir Ver first came up with with the barbarians / empire. It works very well there, for example the mines of the barbarians or the upgrading of the inns. At the moment experience is something that seems superfluous, you have it But mans does not use either. Since it would definitely not be in the inventor's interest to gain experience, it might make sense to think about several expansion stages. These are graphically the same, so they are an effort only in terms of numbers.

Alternatively, it could be done so that the building is not expanded, but the person inside needs a certain experience based on different Making things. This is exactly the founding idea of ​​Widelands that SirVer had, for example among the barbarians. I rarely spoke to him, but some things still in my head.

Concrete:

Trident - level 0

verb. Trident - level 8

Steel trident - level 16

verb double triangle - level 32

This helps a lot to do justice to the hero of the Atlanter problem, who is too fast. It also solves the "what's stronger than a hero paradox" by always making the next stage possible after a certain time (30 min, 45 min, 1h).

So in short: The smith needs to gain a lot of experience until he can make more advanced weapons. If this experience threshold is set fairly high, this means we would have several game stages where the soldiers players can have successively grow from quarter-trained over half-trained and three-quarters trained to hero.
Now this is an idea I love very much! face-smile.png Though unfortunately this will be extremely difficult to balance properly (even balancing only rookies and heroes is already hard, balancing partly trained soldiers as well might be next to impossible) and I guess this idea will not gain everybody's favour as it changes the game mechanics a lot…

JanO wrote:

I like the idea to set the right to hit first to the soldier who is in his own borders.

+1 from me as well

But I would suggest to set it to the soldier who is closer to his home land. Imagine a battle on neutral ground.

Should happen only in rare edge cases…


Top Quote
the-x
Avatar
Topic Opener
Joined: 2019-01-19, 13:23
Posts: 967
Ranking
One Elder of Players
Posted at: 2020-04-12, 14:22

Nordfriese wrote:

the-x wrote:

The Altanter need something like experience in the smithy, so that not so bleak times arise that after 16 minutes you have a full hero or in the game after 19 minutes. This is way too early, not only because they have a significant advantage over the others (it doesn't help that they have fewer units to start with), there is nothing better than one full hero ... except two full heroes

The experience is an exciting thing that Sir Ver first came up with with the barbarians / empire. It works very well there, for example the mines of the barbarians or the upgrading of the inns. At the moment experience is something that seems superfluous, you have it But mans does not use either. Since it would definitely not be in the inventor's interest to gain experience, it might make sense to think about several expansion stages. These are graphically the same, so they are an effort only in terms of numbers.

Alternatively, it could be done so that the building is not expanded, but the person inside needs a certain experience based on different Making things. This is exactly the founding idea of ​​Widelands that SirVer had, for example among the barbarians. I rarely spoke to him, but some things still in my head.

Concrete:

Trident - level 0

verb. Trident - level 8

Steel trident - level 16

verb double triangle - level 32

This helps a lot to do justice to the hero of the Atlanter problem, who is too fast. It also solves the "what's stronger than a hero paradox" by always making the next stage possible after a certain time (30 min, 45 min, 1h).

If this experience threshold is set fairly high, this means we would have several game stages where the soldiers players can have successively grow from quarter-trained over half-trained and three-quarters trained to hero.
Now this is an idea I love very much! face-smile.png

Yes, that is adding very nice gameplay as for example Player A going to the full hero stage, while Player B is still at 3/4 stage, so now is the perfect timing to attack whilst hes having hes 3/4 hero in the labyrinth to upgrade. It adds somce nice elements and stategies.

Edited: 2020-04-12, 14:33

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-04-12, 14:24

the-x wrote:

JanO wrote:

Would it be easier to code something that forbids AI to attack too frequently? Just a simple timer which is triggered by each attack and sets a time between, lets say, 20 and 30 minutes (or whatever).

+1 like this Idea very much

We can do this ramdomly so the player doesnt know or exponential like starting

30, 40, 60, 100, 150 minutes in gametime

so later waves will get more production and bigger and harder to solve

We shouldn't hardcode such times as the ideal strategy will differ between maps depending on size and resource availability. But yes, teaching the AI to attack less often and with stronger total forces would be good.
Btw, I believe the AI already cheats by counting how many soldiers with which promotions are in a given enemy milsite (or at least it could do this easily), this info should be used for estimating whether an attack makes sense now or whether to wait.
Allowing the AI to choose which soldiers to attack with is easily possible, but for now it just selects the number of attackers without handpicking the best, this should also be changed.

if this is not enough, we can add randomly generated soldiers for AI after 2 hours, 3 hours, so you are not sure you win when you survived the first wave

I have thought about game mechanics changes for the AI again. And in my opinion those should be avoided because it's just plain cheating; it's unfair to the human players. Currently all players start with the same resources and the game outcome is based entirely on who makes the better decisions. Letting the AI win through cheating even when it makes worse decisions is not fair to the average non-champion player.
We should aim to make the AI make better decisions, then it won't need to cheat like that.


Top Quote