Latest Posts

Topic: AI Algorythms

the-x
Avatar
Joined: 2019-01-19, 13:23
Posts: 638
Ranking
One Elder of Players
Posted at: 2020-10-15, 12:40

Can someone help me who is familiar with AI? I try to program the training sites so that the AI trains each unit up to its maximum level. But what the AI does is, it closes the training spots and sometimes opens them briefly and only when all the goods are really available. Can you make the icons a little bigger? You have to lean pretty close to the screen to see everything exactly, as is the case with the goods: coal is a small black point, iron is also almost invisible.

Kann mir jemand helfen, der sich mit der KI auskennt? Ich versuche die Trainingssites so zu programmieren, dass die KI jede Einheit bis zu ihrer maximalen Stufe ausbildet. Was die KI aber tut ist, sie schließt die Trainingsspots und öffnet sie manchmal kurz und und zwar erst dann wenn wirklich alle Waren vorhanden sind. Das andere: Kann man die Icons ein bisschen größer machen? Man muss sich schon ziemlich nah an den Bildschirm lehnen um das alles genau zu erkennen, eben so bei den Waren: Kohle ist ein kleiner schwarzer Punkt, Eisen kann man ebenfalls fast nicht erkennen.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 1554
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-10-15, 13:36

Hi, first of all the issues with the small icons are not related to the AI topic. However they are known as an issue (see https://github.com/widelands/widelands/issues/3392), but are not that easy to fix.

Regarding the AI the described behaviour is intended exactly to achieve the goal you described. If all wares needed to train a soldier in all steps of this trainingsite are present the training starts (the slot opens). This is to ensure that the soldier can have all training steps one after the other and it is coded here https://github.com/widelands/widelands/blob/d19fe926edaf0119368b02b24039b6635d29c64d/src/ai/defaultai_warfare.cc#L766

Please explain exactly how you would try to achieve the described goal in a different approach, and which steps you took to change it.


Top Quote
the-x
Avatar
Joined: 2019-01-19, 13:23
Posts: 638
Ranking
One Elder of Players
Posted at: 2020-10-15, 13:59

Is it the goal to only use rookies and heroes? Since we have 5 attack, 2 armor, 3 health and 2 evade upgrades i wonder why we should not use them when it comes to a contact with another player?

Here are the steps I was testing; i added minor things in trainingssite like a raise in costs of food and time and reducing sleeping time. After some tests back and up i can recommend to test this Idea too. https://www.widelands.org/forum/post/35053/


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 1554
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-10-15, 14:22

the-x wrote:

Is it the goal to only use rookies and heroes?

I don't understand. You asked for help to make the AI train each soldier to its maximum level. Maximum level is what is called a hero, I thought. So maybe I misunderstood what you want the AI to achieve. Please explain in more detail then.


Top Quote
the-x
Avatar
Joined: 2019-01-19, 13:23
Posts: 638
Ranking
One Elder of Players
Posted at: 2020-10-15, 14:35

Ah i think i got it. The maximum level of course is dependent of each game situation. I like this game very much, but in this point i disagree with the idea that i play only with heros and 0 level soldiers. I mean why are all the upgrades not used? Detailed, i want the trainingssite to train my soldier to lvl 3 if i have the needed wares inside and that it sends this one back and trains another one to lvl 3, atm it sends him back and instantly the highest promited soldiers, which in this case is the lvl 3 goes back again to trainingssite.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 1554
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-10-15, 14:59

the-x wrote:

Detailed, i want the trainingssite to train my soldier to lvl 3 if i have the needed wares inside and that it sends this one back and trains another one to lvl 3, atm it sends him back and instantly the highest promited soldiers, which in this case is the lvl 3 goes back again to trainingssite.

now I am confused. do you want the AI handling of trainingsites to be changed, or do you want a change in the selection of soldiers by the trainingsites for every player (including but not exclusivly the AI)?


Top Quote
the-x
Avatar
Joined: 2019-01-19, 13:23
Posts: 638
Ranking
One Elder of Players
Posted at: 2020-10-15, 15:06

This is not so importat at all, since it works quite nice at the moment. Actually it aims at making the AI more efficiently to train, so the "handling of trainingssites by AI" so that they are competitive to an experienced player. The way they build they are performing very good indeed and also in decisionmaking of when is the best point in time to attack the player


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1942
Ranking
One Elder of Players
Location: Germany
Posted at: 2020-10-15, 18:06

hessenfarmer wrote:

the-x wrote:

Detailed, i want the trainingssite to train my soldier to lvl 3 if i have the needed wares inside and that it sends this one back and trains another one to lvl 3, atm it sends him back and instantly the highest promited soldiers, which in this case is the lvl 3 goes back again to trainingssite.

now I am confused. do you want the AI handling of trainingsites to be changed, or do you want a change in the selection of soldiers by the trainingsites for every player (including but not exclusivly the AI)?

I guess the-x's definition of AI here refers to the logic behind trainingsites, whereas the main definition of AI is the logic behind automated opponents.


Top Quote