Topic: News about AI
Tibor Topic Opener |
Posted at: 2017-03-08, 21: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 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 |
Posted at: 2017-03-12, 23:05
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.
Why 3 instead of 4? Do you think that the calculated values for this buildings are absolutely wrong?
Well, is a maximum needed at all? Isn't only the relation important? Wanted to save the world, then I got widetracked Top Quote |
Tibor Topic Opener |
Posted at: 2017-03-13, 18: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 |
Posted at: 2017-03-19, 02: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)." Wanted to save the world, then I got widetracked Top Quote |
Tibor Topic Opener |
Posted at: 2017-03-19, 08:00
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:
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 |
Posted at: 2017-03-20, 10:10
How about a table in the AI hints, like this: Dungeon
Labyrinth
Implementation: You can build a dungeon if:
Busy indexing nil values Top Quote |
Tibor Topic Opener |
Posted at: 2017-03-20, 11:18
It seems too complex to implement. The minimalistic implementation could be: f.e in dungeon's init.lua:
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 |
Posted at: 2017-03-20, 13:46
Yes, that's a good idea The default proportion if none has been set could be calculated in Tribes::postload(). Busy indexing nil values Top Quote |
Tibor Topic Opener |
Posted at: 2017-03-20, 20: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 |
Posted at: 2017-03-21, 07: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. Busy indexing nil values Top Quote |