Donation

Help us to pay our server!
(: Consider a donation :)



Social Media

  • Facebook
  • Google+

Latest Posts

Topic: News about AI

Forums » Player Forums » Game Suggestions » News about AI



Tibor
Joined: 2009-03-23, 23:24
Posts: 799
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-03-08, 22:14

If the limits should be that specific, the best way would be to put them into lua configuration files. The C++ should not include hard coded values, especially per building and tribe.

As for redundancy - i dont like the idea of setting a hard-limit and immediately make exemptions to it face-smile.png

Anyway, changes to lua configuration is not directly related to my work on genetic algorithm... And when I watch AI in this branch it does not build second trainingsites, so the problem might be opposite than what is in trunk...


Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 152
Ranking
At home in WL-forums
Location: Saxony, Djermany
Posted at: 2017-03-13, 00:05

Tibor wrote:

So what should be limits for trainingsites? Max one of each type? Or max 3 trainingsites per player?

Not max one of each type. I don't know if a maximum would be good in general, but the relation 1 colosseum + 4 trainings camps is perfect for training fully promoted soldiers.

With barbarians, it's almost the same: The perfect relation is 1 arena + 4 trainings camps.

Atlanteans are better balanced, the perfect relation is 4 dungeons + 5 labyrinths.

Okay, well, in some extreme situations it's not the best to train mainly fully promoted soldiers, but some more evade-trained soldiers. But I don't often play like that.

king_of_nowhere wrote:

Tibor wrote:

So what should be limits for trainingsites? Max one of each type? Or max 3 trainingsites per player?

You have to differentiate here. colosseum only gives 2 promotions to a soldier, while training camp gives 8. so you could have 4 training camps and 1 colosseum and they would all work fine. So if we were to code for hard limits, i would suggest 1 colosseum 4 training camps for empire, 1 arena 3 training camps for barbarians,

Why 3 instead of 4? Do you think that the calculated values for this buildings are absolutely wrong?

and 2 labyrinths plus 2 dungeons for atlanteans.

Well, is a maximum needed at all? Isn't only the relation important?


*insert phrase about the necessity of saving the world here*

Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 799
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-03-13, 19:09

Also important question is how such relation can be listed in configuration file. To put there a limit is simple, but a proportion....


Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 152
Ranking
At home in WL-forums
Location: Saxony, Djermany
Posted at: 2017-03-19, 03:28

I don't know that much about coding, but maybe something like that:

"Don't build Colosseum number n if trainings camp number 4n-4 is not about to be finished or already existing"

Same with barbarian arena

"Don't build trainings camp number m if there are less than (m-1)/4 colosseums (or colosseums which are about to be finished)."

Same with barbarian arena

"Don't build labyrinth number k if there are less than k*0.8-1 dungeons (or dungeons which are about to be finished)."

"Don't build dungeon number n if there are less than n*1.25-2 labyrinths (or labyrinths which are about to be finished)."


*insert phrase about the necessity of saving the world here*

Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 799
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-03-19, 09:00

WorldSavior wrote:

I don't know that much about coding, but maybe something like that:

"Don't build Colosseum number n if trainings camp number 4n-4 is not about to be finished or already existing"

Same with barbarian arena

"Don't build trainings camp number m if there are less than (m-1)/4 colosseums (or colosseums which are about to be finished)."

Same with barbarian arena

"Don't build labyrinth number k if there are less than k*0.8-1 dungeons (or dungeons which are about to be finished)."

"Don't build dungeon number n if there are less than n*1.25-2 labyrinths (or labyrinths which are about to be finished)."

OK, but we still need a way to define these rules in lua files. I cannot come with a way. Perhaps with a single "proportions" number, like:

  • trainingsite1: 1
  • trainingsite2: 2

This would indicate just a proportions between these sites. Default would be 1, this would be safe enough in case of new tribes, or new trainingsites, or renaming of trainingsites...


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 1806
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-03-20, 11:10

How about a table in the AI hints, like this:

Dungeon

prerequisites = {
    atlanteans_barracks = {
        needed = 1
    },
    atlanteans_labyrinth = {
        needed = 0,  -- default value, so this line can be omitted
        proportion = 2
    }
}

Labyrinth

prerequisites = {
    atlanteans_barracks = {
        needed = 1
    }
    -- No entry for the dungeon, because the cyclic dependency would break stuff
}

Implementation: You can build a dungeon if:

  • There is at least 1 barracks
  • There are at least 2 * #dungeons labyrinths.

Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 799
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-03-20, 12:18

It seems too complex to implement. The minimalistic implementation could be:

f.e in dungeon's init.lua:

 traininsites_max_proportion = 0.6

Indicating that if there already is a dungeon, build another one only if #dungenons / #all_trainingsites <= 0.6. If smartly crafted, it would keep traininsites in required proportions. For example 0.01 would provide that there would never be second traininsite of the type. Default could be 0.5.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 1806
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-03-20, 14:46

Yes, that's a good idea face-smile.png

The default proportion if none has been set could be calculated in Tribes::postload().


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 799
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-03-20, 21:35

Well, if no entry in ai_hints section, the default would be 0.5, that would mean that in case of two buildings (types), the difference would never be more than one, so 0:1, 1:2, 2:3. Also the actual number would hint the preference, so 0.51 would be more preferred than 0.5 => build first - can it be?


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 1806
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-03-21, 08:58

But in case of 3 trainingsite types (Empire), the neutral proportion would be 0.33, not 0.5. And what about mods, maybe a tribe could have only 1 trainigsite (1.0) or 4 trainingsites (0.25), ... calculating the neutral proportion in Tribes:: postload() is no problem at all. I can code that part it you want, since I'm more familiar with the tribes code.


Top Quote