surely that a pretty poor structure? I would have thought the UI and AI would be able to interrogate a common "layer" where the functionality was implemented. Getting an AI to "press buttons" on a UI would require massive configuration for every mod and stop the underlying methods from exposing any AI relevant data that could help with the decision making?Eventually, we're also going to need something like this for LUA support- a meta-descriptor that can tell AIs, "hey, you might want to push this button on the LUA-generated UI, under these circumstances".
ThreatValue Multipliers
Moderators: hoijui, Moderators
Re: ThreatValue Multipliers
Re: ThreatValue Multipliers
Actually, the way that KAIK calculates unit benefits on the
fly (which are just ordinary heuristic scores) could be easily
extended to factor in any predefined multipliers, but it has
no means of reading them (yet).
fly (which are just ordinary heuristic scores) could be easily
extended to factor in any predefined multipliers, but it has
no means of reading them (yet).
Re: ThreatValue Multipliers
It would also require a huge amount of highly generic abstract reasoning code if it where to be anything remotely efficient.
The best bet would either be for a scripted solution, mod specific AI routines, or for AI specialization in certain game mechanic types. This is already in effect in some mods where cob based routines implement functionality and the AI has no way of knowing that functionality exists at all.
The best bet would either be for a scripted solution, mod specific AI routines, or for AI specialization in certain game mechanic types. This is already in effect in some mods where cob based routines implement functionality and the AI has no way of knowing that functionality exists at all.
Re: ThreatValue Multipliers
Let's see if I can make enough sense to clarify:
fibre:Capturing a neutral node is akin to capturing a piece of territory? So where approaching and remaining within a certain distance, for a certain time period in an FPS would acquire that territory, the AI has to approach, and capture that node, while defending it from opposing forces. The AI can look at those nodes, and go: Node. Mine 1/0. 1=ignore. 0=capture. If each sector is represented by a single node, the AI can use those to represent it's area of control.
Unless I'm completely mistaken about what fibre is. In which case someone explain it.
Squads: Does any AI build Krogoths? Why does it build them? Because for the resources spent, it does a lot of damage before it dies. Why would you build a nuke? The same reason. A squad should have a cost and projected damage (determined in AI, by algorithm), that are appropriate to each other. If a Krogoth does X damage per second, and costs Y to build, then a squad should be similar. The units contained in the squad when it's finished might be random, but the value of it's damage per second should be the same as a weapon in the unit def.
The value (dps) does not need to be in the unit def, just the name of the weapon the 'squad unit' is assigned. It doesn't matter if it's a real weapon. What we want is the dps to end up sufficient to warrant building the unit. The AI checks for new units each time a game starts, taking the longest the first time.
First it takes: Weapon damage*firing speed(in fractions of a second)=dps And checks that against the average of the cost (E+M/2). If the dps is a fraction of the average equal to the value of a krogoth or greater, the AI will build it.
That makes no sense. Assuming an average of 500, if the unit does >100 dps, it's not worth the effort. If it does <100, then it is worth building. This uses one-fifth the average as it's fraction.
fibre:Capturing a neutral node is akin to capturing a piece of territory? So where approaching and remaining within a certain distance, for a certain time period in an FPS would acquire that territory, the AI has to approach, and capture that node, while defending it from opposing forces. The AI can look at those nodes, and go: Node. Mine 1/0. 1=ignore. 0=capture. If each sector is represented by a single node, the AI can use those to represent it's area of control.
Unless I'm completely mistaken about what fibre is. In which case someone explain it.
Squads: Does any AI build Krogoths? Why does it build them? Because for the resources spent, it does a lot of damage before it dies. Why would you build a nuke? The same reason. A squad should have a cost and projected damage (determined in AI, by algorithm), that are appropriate to each other. If a Krogoth does X damage per second, and costs Y to build, then a squad should be similar. The units contained in the squad when it's finished might be random, but the value of it's damage per second should be the same as a weapon in the unit def.
The value (dps) does not need to be in the unit def, just the name of the weapon the 'squad unit' is assigned. It doesn't matter if it's a real weapon. What we want is the dps to end up sufficient to warrant building the unit. The AI checks for new units each time a game starts, taking the longest the first time.
First it takes: Weapon damage*firing speed(in fractions of a second)=dps And checks that against the average of the cost (E+M/2). If the dps is a fraction of the average equal to the value of a krogoth or greater, the AI will build it.
That makes no sense. Assuming an average of 500, if the unit does >100 dps, it's not worth the effort. If it does <100, then it is worth building. This uses one-fifth the average as it's fraction.
Re: ThreatValue Multipliers
...except that an AI does not know that it's building a squad, silly. It only knows it's building an individual. Hence threat multipliers, to give it hinting.A squad should have a cost and projected damage (determined in AI, by algorithm), that are appropriate to each other.
For example, in PURE, as of right now (i.e., not vaporware) you build squads of mecha. Each time you build a squad, you get a different, random mix of mecha, with different capabilities (it's what HQ has available, soldier- deal with it). An AI cannot know this. I don't expect it to. Instead, I want to tell the AI that the unit's real cost-for-power is, say, 3.5 (taking into account the random results where you get more powerful mecha, among other things).
AIs can't ever see this. Even if they could see the LUA through some sort of interface (not real plausible) they'd never understand what it's doing. All they can see is results.
A very, very smart AI would somehow note that when it chooses to build "one unit" from a given factory, it gets 3, and that the 3 may have differing capabilities. But meh, why bother trying to make 'em that smart, when game designers can just tell 'em that they're getting more than it appears from the stats they already read?
Moreover, this gives game developers a way to interact with AIs in a way that's not really restrictive. Want to make sure AIs never build X unit, which is totally dependent on very slick micro? Give it a ThreatMultiplier value of 0.1. Want to make sure they build lots of a stock unit that's good for flooding? Give it a value of 1.1, see if AIs build more of it. If not, either your balance is wrong, or you have a point to talk intelligently with the AI developers about their balance heuristics, among other things. This is a very useful little concept.
Re: ThreatValue Multipliers

I KNOW THAT THE AI DOES NOT KNOW IT'S A SQUAD. Rather than trying to force the AI to address another value that it determines already, I'm giving you a way to not need it.
Value of the unit is determined whether it can do a significant fraction of it's cost in damage. Assign the Squad a False weapon, with a DPS that is a significant fraction of it's cost. Want one built over another? Change the weapon damage. Unless it's intended as an AA squad, the AI will build it properly.
Now, if this the only thing the AI can build, it's a completely moot point. It won't need to know the difference, because it can't tell.
Re: ThreatValue Multipliers
have you ever made an ai triaxx
have you ever released one
you've been posting on the ai forum for 3 years and yet you've never actually done anything public
if it makes you happy fine but it's a little odd
have you ever released one
you've been posting on the ai forum for 3 years and yet you've never actually done anything public
if it makes you happy fine but it's a little odd
Re: ThreatValue Multipliers
Triaxx, I think you're looking at this through the rose tinted glasses of a sentient brain. Its all fine and dandy but your working with high level concepts and at some point your going to come crashing down as you realize you need to build supporting infrastructure that is capable of using these higher level concepts, which would take decades of research and the the very least a team of people. You'll start compromising your designs in order to realize them in functioning code, changing them to suit implementation needs and the reality of the way code works.
You may know the unit is an AA unit, but the AI doesnt, and usually we've had to make the AI figure out for itself either because the information isnt directly available or there's no clear documentation telling us how.
You may know the unit is an AA unit, but the AI doesnt, and usually we've had to make the AI figure out for itself either because the information isnt directly available or there's no clear documentation telling us how.
Re: ThreatValue Multipliers
I guess I'm talking to the wall here.
I'm not talking about anything higher level than simply reading the unit, and weapon defs. I did skip a step, in that AA squads should have a weapon with BadTarget=NotAir in it's definition. Other than that there shouldn't be a problem.
tombom: I'm currently working with an AI. No, I haven't released, because it doesn't work as well as I want it too yet. I haven't done anything public, because it doesn't work correctly. Yes, it makes me happy to watch and see what other people are doing.
I'm not talking about anything higher level than simply reading the unit, and weapon defs. I did skip a step, in that AA squads should have a weapon with BadTarget=NotAir in it's definition. Other than that there shouldn't be a problem.
tombom: I'm currently working with an AI. No, I haven't released, because it doesn't work as well as I want it too yet. I haven't done anything public, because it doesn't work correctly. Yes, it makes me happy to watch and see what other people are doing.
Re: ThreatValue Multipliers
Simply put, the AI will evaluate the "squad" unit that the factory builds. It will not evaluate the 5 "BigGunMech" units that its replaced with by lua.
As such you cant evaluate a squad as 5x power of BigGunMech because there are no BigGunMechs and there's no knowing thats what the squad turns into. All you're going to see is a placeholder unit with a pretty model and default statistics, no weapons etc that gets replaced immediatley.
As a result this placeholder squad unit scores horrifically. It's seen as innefficient because its expensive and it doesnt actually do anything.
It has a terrible combat rating because it has no weapons or armour, no shields, and dies almost as soon as its built having never destroyed anything.
As far as the AI is concerned its a pile of rubbish and it'd rather build a BigGunMech, but it doesnt have a BigGunMech entry in its build menu. How is it supposed to know that placeholder unit is just a palceholder that becomes a set of BigGunMechs?
And not all units are fully defined in their unit files either. Sometimes a specific unit can be given extra weapons and capabilities via lua that the unit type in general does not have. Look at pressurelines attempts at unit components for example. they have no impact on the unit defintion, its all lua wizardry and openGL.
As such you cant evaluate a squad as 5x power of BigGunMech because there are no BigGunMechs and there's no knowing thats what the squad turns into. All you're going to see is a placeholder unit with a pretty model and default statistics, no weapons etc that gets replaced immediatley.
As a result this placeholder squad unit scores horrifically. It's seen as innefficient because its expensive and it doesnt actually do anything.
It has a terrible combat rating because it has no weapons or armour, no shields, and dies almost as soon as its built having never destroyed anything.
As far as the AI is concerned its a pile of rubbish and it'd rather build a BigGunMech, but it doesnt have a BigGunMech entry in its build menu. How is it supposed to know that placeholder unit is just a palceholder that becomes a set of BigGunMechs?
The time for this has passed. Lua has made a laughing stock out of this solution, because now entire mods can be made that haven't a single line of fbi or TDF formatted text in them. No fbis, no tdfs, all .lua. Throwing an instance of TdfParser or CSunParser at the problem will leave you in a mess.I'm not talking about anything higher level than simply reading the unit, and weapon defs. I did skip a step, in that AA squads should have a weapon with BadTarget=NotAir in it's definition. Other than that there shouldn't be a problem.
And not all units are fully defined in their unit files either. Sometimes a specific unit can be given extra weapons and capabilities via lua that the unit type in general does not have. Look at pressurelines attempts at unit components for example. they have no impact on the unit defintion, its all lua wizardry and openGL.
Re: ThreatValue Multipliers
Then it's not even a unit. It's a template.
So LUA is the solution to that problem? The one of convincing my AI to build a block of units as one, instead of setting out each individual construction the way a human has too.
The rating won't be a problem. Does a con unit have a combat rating? Does it not get built then? Of course it does. If it's the only thing available, the AI won't have a choice not to build it. The rating being poor will mean nothing. The trick then becomes to get the AI to attribute the final Threat Value to the squad.
Until I see the final code, I can only work with what I know. LUA may give me an entirely different way to determine build power and effectiveness.
Edit:
On second thought, and after going back over my own notes, I see my problem. I've got what amounts to two threat values. One is mine for a sector, and one is the enemies for a sector. The AI is trying to make it's threat value higher than the opponents. The two obvious ways to do so are A) Increase my own threat value until it exceeds the opponents value, or B) decrease the opponent's threat value, usually through artillery strikes, or bomber attacks.
In any case, threat value is obtained on individual units, rather than on the unit being built. If the values change significantly after the 'unit' is built, and then 'dies', I'll program it to treat them as kamikaze units.
So LUA is the solution to that problem? The one of convincing my AI to build a block of units as one, instead of setting out each individual construction the way a human has too.
The rating won't be a problem. Does a con unit have a combat rating? Does it not get built then? Of course it does. If it's the only thing available, the AI won't have a choice not to build it. The rating being poor will mean nothing. The trick then becomes to get the AI to attribute the final Threat Value to the squad.
Until I see the final code, I can only work with what I know. LUA may give me an entirely different way to determine build power and effectiveness.
Edit:
On second thought, and after going back over my own notes, I see my problem. I've got what amounts to two threat values. One is mine for a sector, and one is the enemies for a sector. The AI is trying to make it's threat value higher than the opponents. The two obvious ways to do so are A) Increase my own threat value until it exceeds the opponents value, or B) decrease the opponent's threat value, usually through artillery strikes, or bomber attacks.
In any case, threat value is obtained on individual units, rather than on the unit being built. If the values change significantly after the 'unit' is built, and then 'dies', I'll program it to treat them as kamikaze units.
Re: ThreatValue Multipliers
Basically what your AI will see for this placeholder unit is:
A unit with:
no weapons
extremely low hitpoints
no armour
no shields
no build options
no construction abilities
no self destruct
no line of sight
no radar
nothing, just a place holder unit with a pretty model, no actual function. As far as anyone is concerned its a dead weight unit that does nothing but consume resources being built.
"See here commander we should defeat the evil 2000 feet high dragons of immense power with these small garden snails here."
The Commander weighs up options
"Put the snail option in the bin"
5 minutes later after the dragons have destroyed the world
"Oh noes why didnt we use the garden snails that transformed into deathstars?!?!?!?!?!"
A unit with:
no weapons
extremely low hitpoints
no armour
no shields
no build options
no construction abilities
no self destruct
no line of sight
no radar
nothing, just a place holder unit with a pretty model, no actual function. As far as anyone is concerned its a dead weight unit that does nothing but consume resources being built.
"See here commander we should defeat the evil 2000 feet high dragons of immense power with these small garden snails here."
The Commander weighs up options
"Put the snail option in the bin"
5 minutes later after the dragons have destroyed the world
"Oh noes why didnt we use the garden snails that transformed into deathstars?!?!?!?!?!"
Re: ThreatValue Multipliers
Now who's looking at it from a human perspective?
The AI won't have a choice. If it can only build one thing, that's all it'll build. Present the AI with the options of: Build this/Build nothing, it should default to Build this.
It won't care what the unit looks like, or that it dies instantly. All it will see is it's own threat value rising.
The AI won't have a choice. If it can only build one thing, that's all it'll build. Present the AI with the options of: Build this/Build nothing, it should default to Build this.
It won't care what the unit looks like, or that it dies instantly. All it will see is it's own threat value rising.
Re: ThreatValue Multipliers
it will only not have a choice if squads are the only offensive unit available, that would be a pretty boring mod in all honesty...
the fact remains that the AI will have no basis for comparison as to the effectiveness of the temporary unit. Surely the best way to do this is to expose some sort of interface to the lua synched code that can tell the AI what is going on?
If not the only other way I can see is to detect the units that get destroyed straight after they are completed and to see if there are any matching unit finished calls that might indicate a squad. -A solution that just actually made me sick in my mouth.
the fact remains that the AI will have no basis for comparison as to the effectiveness of the temporary unit. Surely the best way to do this is to expose some sort of interface to the lua synched code that can tell the AI what is going on?
If not the only other way I can see is to detect the units that get destroyed straight after they are completed and to see if there are any matching unit finished calls that might indicate a squad. -A solution that just actually made me sick in my mouth.
Re: ThreatValue Multipliers
Oh I love when a problem gets solved before it becomes a problem.
That also means we can have transforming units...

That also means we can have transforming units...


Re: ThreatValue Multipliers
You're wrong there are several options, mainly because they dont fit into the scope of concepts used by some of the AI designs in spring.
Options triaxx missed hehehehe
Options triaxx missed hehehehe
- Do nothing
- Self destruct
- Wait x minutes
- Re-evaluate options
- Copy another unit
Re: ThreatValue Multipliers
QFT. Which is why, in P.U.R.E., when I use transforms, I'm going to be very careful that the AI can get an accurate idea of what the Unit it's choosing does, and how it works, instead of having AI developers having to write custom code to "understand" the units, like in Fibre's case (which I think is addressable, with minor alterations of the game design). I already have most of it working. It wasn't hard.Basically what your AI will see for this placeholder unit is:
A unit with:
no weapons
extremely low hitpoints
no armour
no shields
no build options
no construction abilities
no self destruct
no line of sight
no radar
nothing, just a place holder unit with a pretty model, no actual function. As far as anyone is concerned its a dead weight unit that does nothing but consume resources being built.
"See here commander we should defeat the evil 2000 feet high dragons of immense power with these small garden snails here."
The Commander weighs up options
"Put the snail option in the bin"
5 minutes later after the dragons have destroyed the world
"Oh noes why didnt we use the garden snails that transformed into deathstars?!?!?!?!?!"
Re: ThreatValue Multipliers
It's starting to smell from my end as well. My XP arrived, and...DJ wrote:I love smelling vapour ware
I hate Microsoft.



Re: ThreatValue Multipliers
Tbh it's high time you stop making AI that try to guess the units worth, and start relying on man-made profiles, like NTai. Because there's no way an AI might guess the worth of a unit just by reading the /units/*.FBI and /weapons/*.TDF if the mod use any kind of trickery. I'm not even talking about lua magic here, even plain old TA BOS can do stuff like activating a damagemodifier or locking weapons, which completely change the worth of a unit. I'm not talking about theorical mod concept either, they're out and being played already.
There's a reason NTai was the only AI that ever managed to play KP, it's the only AI that didn't try to guess how to play following TA scheme, but instead listened to my text file.
But ultimately, we need mod specific AI. Because trying to grok Fibre in TA terms, lol!
There's a reason NTai was the only AI that ever managed to play KP, it's the only AI that didn't try to guess how to play following TA scheme, but instead listened to my text file.
But ultimately, we need mod specific AI. Because trying to grok Fibre in TA terms, lol!