Page 1 of 3
ThreatValue Multipliers
Posted: 05 Jan 2008, 03:55
by Argh
Dear AI people... I have an interesting challenge for you. I have units in PURE now, that when completed, become an entire squad, which may have random elements. LUA is allowing me to do these sorts of tricks, of course.
Needless to say, this is probably going to result in AIs having enormous trouble, unless some sort of generic variable is available to give them a hint about how much this "single unit" is worth.
NTAI, being fully configurable, doesn't care, so I'm leaving it to one side. AAI, KAIK and RAI are all going to have serious problems, though, because the "single unit" will look absurdly over-priced to them, and they're never going to build it.
So, can we finally have some sort of discussion about setting up a FBI variable, which AIs should read and use, that gives them an approximate real threat value of a given unit? I'm thinking a simple float used as a multiplier should do: "aiThreatMultiplier=6.5" means that AIs should multiply whatever threat value they've assigned to the unit, using whatever methods they use, by 6.5. Would that be ok with everybody? I don't want to force you into a box, or ask you to use standardized formulae, or whatever. Just make use of one variable that a game designer can control, that can give your AIs a hint about what the real worth of a thing is.
Re: ThreatValue Multipliers
Posted: 05 Jan 2008, 20:52
by submarine
I'm not sure I understood your post correctly - you have one (expensive) unit that is splitted up in a few independent units after being built?
If that is the case, AAI will have a problem and I have to modify it. A rather primitive but easy to implement solution would be a keyword in the mod cfg file that allows to set cost multipliers for certain units
If this is not the case and the (expensive) unit, that has been built accounts for all the kills of the "squad" , AAI will compare the combat efficiency of the squad to the costs and everything should be ok
Re: ThreatValue Multipliers
Posted: 05 Jan 2008, 22:47
by Argh
you have one (expensive) unit that is splitted up in a few independent units after being built?
Yes.
Re: ThreatValue Multipliers
Posted: 06 Jan 2008, 13:57
by submarine
hmm sounds strange to me and I have no idea how this can be done with the spring engine but I guess it's some kind of lua magic
Would it be sufficient to add a keyword to the mod cfg file, like
COST_MULTIPLIER unitname factor
so you could add
COST_MULTIPLIER unit1 2
COST_MULTIPLIER unit2 2.5
COST_MULTIPLIER unit3 5
to the mod cfg file?
(Default value would be 1)
I would prefer an AI-specific solution since squads are very rarely used in other mods and I dont think we should bloat the ammount of FBI variables without very good reason
Re: ThreatValue Multipliers
Posted: 06 Jan 2008, 18:55
by kiki
Argh wrote:you have one (expensive) unit that is splitted up in a few independent units after being built?
Yes.
win.
The advantage of an FBI variable is a more universal application, less redundency, and making AI's better incorporated into spring, to appeal more to the sp userbase.
Re: ThreatValue Multipliers
Posted: 06 Jan 2008, 20:31
by submarine
i commited AAI v0.853 to SVN featuring the COST_MULTIPLIER keyword mentioned above
Re: ThreatValue Multipliers
Posted: 06 Jan 2008, 21:02
by AF
The advantage of an FBI variable is a more universal application, less redundency, and making AI's better incorporated into spring, to appeal more to the sp userbase.
A threat value of 50 means one thing in NTai, another thing in AAI, infact in NTai those values are in a continuous state of flux like the AAI buildtable values.
Whatsmore as the game continues, the average values in NTai continue to change so the relationships between values changes aswell as their scales. For example one persons NTai may have 15 16 and 20 as values, whereas another person may have 150, 1600, and 20000.
Also the threat a unit poses can change rapidly depending on the game situation and the map used aswell as the AI using the value.
Re: ThreatValue Multipliers
Posted: 06 Jan 2008, 21:17
by submarine
AF wrote:
A threat value of 50 means one thing in NTai, another thing in AAI, infact in NTai those values are in a continuous state of flux like the AAI buildtable values.
...
+1
I guess it's better to let AI solve this problem in a way, that is suits best for the design of a certain AI. Anyway, I dont think it will be used that often that it requieres a special fbi tag. Currently it's only a request by Argh fpr some special "squad units"
Re: ThreatValue Multipliers
Posted: 07 Jan 2008, 14:05
by AF
Indeed its like two totally different situations, for example the german word for father sounds the same as an english word for breaking wind, but german fathers dont break wind when addressed by their children do they?
Re: ThreatValue Multipliers
Posted: 07 Jan 2008, 16:15
by Triaxx2
I think you're looking at it from the wrong direction. Threat value is how dangerous it is. Combat Value would be whether the mod is going to build it.
The threat value would simply be a sum total of the units the squad is comprised of.
Re: ThreatValue Multipliers
Posted: 08 Jan 2008, 01:45
by Argh
The threat value would simply be a sum total of the units the squad is comprised of.
Yes. How an AI chooses to interpret this is entirely up to the developer. I'd rather have a TDF tag, but I'll test with AAI soon and see how it goes first.
Re: ThreatValue Multipliers
Posted: 08 Jan 2008, 07:49
by Archangel of Death
How about instead having a way to tell the AI to assign the data on one type of unit to another (kills, threat values, effectiveness values, whatever it may use), with a multiplier. So, for example, it wouldn't look at fibre's beacons/factories for their effectiveness, but rather how effective the unit it spawns x 30 is (ignoring that no AI is probably anywhere near being able to play Fibre, or possibly ever will be). It should be able to take multiple unit types assigned to one and average them for a result.
Something like this could be set up in the AI's configuration file just as easily or easier than new fbi tags.
edit: Scanning last 2 posts ftw... its practically already been said...
As somewhat of an aside, practically everything in my mod is going to be deployed in squads.
Re: ThreatValue Multipliers
Posted: 09 Jan 2008, 13:24
by Triaxx2
Then all you need is the tag Issquad. That'll signify that the unit is actually multiples, and the total cost/efficiency is equal to 1/X, with X being the number of units in the squad, for the cost of the squad.
So: 3000/1000@1/10 cost = 300/100. That's the unit of efficiency the AI'll use. There does need to be a limiter so it's not trying to build these before it has sufficent economy though.
Re: ThreatValue Multipliers
Posted: 09 Jan 2008, 13:47
by Argh
IsSquad is a bad idea. What if I want to reflect the real effectiveness in ways that have nothing to do with the initial cost of that unit?
For example... in P.U.R.E., you're going to be able to build an Engineering Detachment. It'll consist of a squad of infantry and an Engineering Team (um, kind've like a com, only... not). So, do I give it the value of multiple infantry? Or do I just use a float that gives the AI a good idea of what this "unit" is actually worth, when you add it all up?
Using a linear multiplier will just lead to borked results. A float is much, much easier. I don't want AIs to even try keeping track of whatever bizarre unit-within-a-unit stuff LUA people figure out, they just need a way to know that the real value of a thing has nothing to do with the cost they read from the UnitDef...
Re: ThreatValue Multipliers
Posted: 10 Jan 2008, 12:38
by Triaxx2

Then don't use a static FBI value. Issquad=x could be the value multiplier for the specific unit. I don't have time to hunt down and pick the value for every unit my AI encounters. If you build the unit, you know it better than I do, and so you're better equipped to pick the value.
Re: ThreatValue Multipliers
Posted: 10 Jan 2008, 13:32
by AF
Your AI. Thats the point, there's AAI and NTai and KAIK and RAI too. KAI has no concept of variable efficiency, and NTai has no concept of a path, and AAI has no concept of a task list. This is where the concept of universal AI routines starts to break down.
You end up with a routine for a game mechanic thats only used by one mod and you end up supporting eahc mod in the code stretching yourself thin, or you end up amrginalising and specializing for differing gameplay types.
You'll never write an AI routine that plays fibre and TA without compromising on either performance or specializing for each case scenario, or playing favourites. At some point the modder needs to be involved. The times when modders can sit back and delegate responsibility to the AI developers just isnt possible anymore, and trying to encompass everything just wont work either, no special tag in a mod to help the AI will work unless its specialized for that AI.
Ontop of that such a tag would require that all AIs add lua as a dependency, since fbis may not actually exist, you cant guarantee that the file isnt a unitname.lua anymore.
Re: ThreatValue Multipliers
Posted: 11 Jan 2008, 01:54
by jcnossen
Your AI. Thats the point, there's AAI and NTai and KAIK and RAI too. KAI has no concept of variable efficiency, and NTai has no concept of a path, and AAI has no concept of a task list. This is where the concept of universal AI routines starts to break down.
Wouldn't the point be that you decide on something together?
Agreeing on "a unit's true cost is cost / squadsize" is not something that depends on how AI's are internally implemented. It is a very clear definition that every AI can use.
Right now there already is "a unit's true cost is cost * COST_MULTIPLIER" defined by submarine, so I would say just use that...
Maybe your AI doesn't use the cost defined in FBI or MOD, but that's up to the AI. What's important is that the AIs that do use the same definition of cost.
Re: ThreatValue Multipliers
Posted: 11 Jan 2008, 02:26
by Argh
Maybe your AI doesn't use the cost defined in FBI or MOD, but that's up to the AI. What's important is that the AIs that do use the same definition of cost.
QFT. In AF's case, though, it matters zero- NTAI does what it's told to do, no more, no less. It's the exception here. I'm mainly worried about AIs that don't adhere to that concept- if they all end up with fragmentary definitions, or have some stupid custom hacks just to support a game, it's pointless, tbh. Same thing with Neutral units- there needs to be a common framework.
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". Not a lockdown, just a way for AIs to see and make use of things that right now they either ignore, or crash upon encountering. Issues like this are going to become more and more common; this is just the tip of a very large iceberg, imo. Spring is changing, in some pretty fundamental ways.
Re: ThreatValue Multipliers
Posted: 11 Jan 2008, 14:28
by Triaxx2
You may not ever be able to build an AI that can play fibre. I can. An FPS AI can play capture the flag, so my RTS AI surely can.
On the other hand, I'm seeing now that I don't have to care. These would simply fall under the control of the Combat Control Agent. It'll simply see it as one powerful unit, and order it constructed to increase the offensive threat of a specific sector. It would be built the same way any large unit would be.
Re: ThreatValue Multipliers
Posted: 11 Jan 2008, 16:15
by AF
Somehow I think prior knowledge of your AI as its creator is filling in gaps of knowledge in your posts. Please ellaborate!