Preferred target category
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Preferred target category
Basically just a tag to assign targeting priority. Atm the tags we have to control this are a bit clunky for that purpose.
Re: Preferred target category
Perhaps 'goodTargetCategory' to suggest it is the antithesis of badTargetCategory. Not all that clear I suppose. I for one can never remember how to spell preferred correctly. Except just then!
But yes, +1.
But yes, +1.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Preferred target category
It's easy Just remember 1 f, 2 r's :=D
I agree with your logic, but good suggests something different than preferred.
I agree with your logic, but good suggests something different than preferred.
- KingRaptor
- Zero-K Developer
- Posts: 838
- Joined: 14 Mar 2007, 03:44
Re: Preferred target category
A noTargetCategory would also be nice.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Preferred target category
+9001
Onlytargetcategory requires backwards logic. It's like only having access to a whitelist and not a blacklist.
I recently have been updating evo units so they shoot at unit types they do the most damage vs first, then anything else secondary, but the logic I've had to use is... strange to some extent.
Onlytargetcategory requires backwards logic. It's like only having access to a whitelist and not a blacklist.
I recently have been updating evo units so they shoot at unit types they do the most damage vs first, then anything else secondary, but the logic I've had to use is... strange to some extent.
-
- Posts: 843
- Joined: 13 Aug 2007, 13:19
Re: Preferred target category
Cool. Would be cool if it would be implemented in such a way that users could adjust this to their liking, via some widget.
Re: Preferred target category
iirc units already prefer targets against which they deal more damage, there is even a funny random factor.
Would noTargetCategory just be all categories not in Onlytargetcategory?
Then maybe turn whitelist into blacklist in unitdef_post:
I think better than more categories would be using AllowWeaponTarget callin. But it is shrouded in gloom.
Would noTargetCategory just be all categories not in Onlytargetcategory?
Then maybe turn whitelist into blacklist in unitdef_post:
Code: Select all
local cats = "TANK SUB ZEPPELIN HORSE AIR"
local noTargetCategory = "ZEPPELIN AIR"
local Onlytargetcategory = ""
for c in cats :gmatch("%w+") do
if string.find(noTargetCategory, c) == nil then
Onlytargetcategory = Onlytargetcategory .. c .. " "
end
end
io.write ("\nnoTargetCategory was:"..noTargetCategory .. "\n")
io.write ("and now Onlytargetcategory is:"..Onlytargetcategory )
---
noTargetCategory was:ZEPPELIN AIR
and now Onlytargetcategory is:TANK SUB HORSE
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Preferred target category
Only if you're using the engine kludgy armordefs.knorke wrote:iirc units already prefer targets against which they deal more damage, there is even a funny random factor.
Re: Preferred target category
What is the difference?
vs
Code: Select all
weapondef:
damage = {
ARMORED = 100,
LIGHT = 100,
BUILDING = 200,
}
Code: Select all
weapon def:
damage = 100
customParams = {
armortype = "raider",
post:
if (damagetypelower == "raider") then
wd.damage.ARMORED = weapondamage*1
wd.damage.LIGHT = weapondamage*1
wd.damage.BUILDING = weapondamage*2
Re: Preferred target category
odd question coming from you. it is an automatic application of damage classes. Such things ease maintenance and ensure consistency.knorke wrote:What is the difference?vsCode: Select all
weapondef: damage = { ARMORED = 100, LIGHT = 100, BUILDING = 200, }
Code: Select all
weapon def: damage = 100 customParams = { armortype = "raider", post: if (damagetypelower == "raider") then wd.damage.ARMORED = weapondamage*1 wd.damage.LIGHT = weapondamage*1 wd.damage.BUILDING = weapondamage*2
Re: Preferred target category
Not an odd question at all - he's pointing out that, as far as the engine sees it, there is no difference. Thus making Forb's point moot.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Preferred target category
Well then, if that's the case, it's broken.
Re: Preferred target category
how is the engine's internal handling of armor damage types kludgy forb?
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Preferred target category
Maybe you misunderstood me. I'm telling you, it doesn't work the way flozi and knorke say it should. This is why I'm setting up categories for it.Forboding Angel wrote:Well then, if that's the case, it's broken.
armordefs.lua is kludgy because it is extremely inefficient. It works, but it's very messy.smoth wrote:how is the engine's internal handling of armor damage types kludgy forb?
****************************************************
Stop derailing. This is about category tags that should be added.
Re: Preferred target category
If the armordefs have to do with unit targeting that would be good to know with regards to unit targeting.
I am not sure what you are asking for based on the discussion at hand.
You only can do a white list yes..
onlytargetcategory = notair
etc
However, preferred target category would that be a NEW tag?
so you would do
preferedtargetcategory: air
and the weapon would priortize air targets only?
There is still the same damn problem I have had for years.. units locking into the first target they see. It worked in gundam like..
fly air unit at gundam, gundam targets air unit, run char it to shoot gundam while it is swatting at flies.
I am not sure what you are asking for based on the discussion at hand.
You only can do a white list yes..
onlytargetcategory = notair
etc
However, preferred target category would that be a NEW tag?
so you would do
preferedtargetcategory: air
and the weapon would priortize air targets only?
There is still the same damn problem I have had for years.. units locking into the first target they see. It worked in gundam like..
fly air unit at gundam, gundam targets air unit, run char it to shoot gundam while it is swatting at flies.
Re: Preferred target category
The way I understand it: yes.If the armordefs have to do with unit targeting that would be good to know with regards to unit targeting.
from looking at function GenerateWeaponTargets in rts/Game/GameHelper.cpp
(interessting to look at)
already possible with badTargetCategoryand the weapon would priortize air targets only?
For example in XTA missile turret and laser turret can both shot ground & air. Laser prefers groundtargets, missile prefers airtargets.
I wanted to look at evos amorblubs but the first thing I saw was like this and I did not understand:
Code: Select all
-- add anything that can fly to the PLANES category
for name, ud in pairs(DEFS.unitDefs) do
if (ud.customparams and ud.customparams.armortype) then
unitArmorType = string.upper(ud.customparams.armortype)
table.insert(armorDefs[unitArmorType], name)
Spring.Echo("Unit: ", ud.unitname, " Armorclass: ", unitArmorType)
end
end
Re: Preferred target category
Hmm I was told that it made the unit inaccurate to the target? it de-priortizes the target?knorke wrote:already possible with badTargetCategoryand the weapon would priortize air targets only?
For example in XTA missile turret and laser turret can both shot ground & air. Laser prefers groundtargets, missile prefers airtargets.
Re: Preferred target category
It does not change accuracy of aim if you mean that.Hmm I was told that it made the unit inaccurate to the target?
yes.it de-priortizes the target?
potential targets get a targetPriority based on on various things like distance etc.
Since lower targetPriority means more likely target (this sounds kinda backwards but whatever?) and badTargetCategory applies a do-not-target-this-factor of 100:
Code: Select all
if (targetUnit->category & weapon->badTargetCategory) {
targetPriority *= 100.0f;
In sim\weapons\weapon.cpp it says
Code: Select all
if ((nextTargetUnit->category & badTargetCategory) != 0) {
// save the "best" bad target in case we have no other
// good targets (of higher priority) left in <targets>
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Preferred target category
That's the behaviour I saw when using badtargetcategory to make BA's T3 units & T2 def unlikely to target scouts.So I guess units in badTargetCategory will only be chosen if no other target is available.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Preferred target category
That's because you're looking in the completely wrong place:knorke wrote: I wanted to look at evos amorblubs but the first thing I saw was like this and I did not understand:
https://code.google.com/p/evolutionrts/ ... ost.lua#86