• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Custom Tags w/o Lag

Status
Not open for further replies.
Level 22
Joined
Jul 25, 2009
Messages
3,091
So I was thinking, warcraft 3 has so few tags that can be detected, i.e., mechanical, ancient, suicidal, undead, organic, etc.

I was wondering if through a DDS we could expand on this by using dummy abilites, like an invisible ability called "Light" which would classify a unit as light, and be detectable upon the damage, whether or not add bonus damage based on this.

I figure with roughly 50 units fielded per player, with 6 players this would cause lag, any thoughts?

And are there other ways to expand upon the tags, that I'm not aware of?

(I was aiming for more of an SC2 style system of counters, with customizable tags.)
 
Level 22
Joined
Jul 25, 2009
Messages
3,091
You can attach all possible data to a unit and you usually do this via a struct type plus indexing methods. Abilities may be used but are somewhat less flexible and a tad less performant if you already have the unit data framework (and use it).

I have already set up indexing for various reasons in this particular map so I'd be interested in this method. What is a struct type? Explain in further detail or link a tutorial.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
struct is a feature in vJass or in wurst the equivalent is class. The idea is to have custom object types with desired attributes and methods. You would assign an instance of this type to your unit, which is basically the same as indexing and then store all the information within the struct type. While loading the struct from the unit is usually a hashtable read, reading/writing the attributes is the same as an array read/write, thus very fast if you do not constantly reload the struct. Read http://www.wc3c.net/vexorian/jasshelpermanual.html#stru. It's just a convenient and more flexible way of using arrays plus structs offer an index allocator and many more features for object oriented programming.
 
Level 15
Joined
Aug 7, 2013
Messages
1,338
If you don't want to use vJASS or auxiliary data structures in the map script, you can use unit point value (upoi) for units. It's just an arbitrary integer value, and can be detected by two natives:


native GetUnitPointValue takes unit whichUnit returns integer //for unit handles

native GetUnitPointValueByType takes integer unitType returns integer //for unit types, e.g. 'hfoo'

I would think it would give at least very minor improvement to performance to avoid using a vJASS struct or other JASS data structure if the standard unit classifications aren't enough.

If you do enough clever math you can make any arbitrary classification or system based on upoi.
 
Status
Not open for further replies.
Top