• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ HD Level Design Contest #1 POLL is now OPEN! Check out the stunning visuals of the final entries. 🔗Click here to cast your vote!

Increasing Hit Box for Giant Sized Units?

Status
Not open for further replies.
Level 10
Joined
Apr 4, 2010
Messages
509
In this picture, this Giant Grunt only gets hit by 4 bullets, when he should get hit by much more, the bullets fly through his feet.

zaQC3kc.jpg


These bullets are triggered: via
Pick 1 Random Unit In 50 Range of Bullet, Add Picked Unit to BulletTargets
Matching, Matching Unit is Alive, etc.
Set 1 Random in Bullet Targets = BulletMainTarget
Cause OwnerOfBullet to Damage BulletMainTarget

Is there a way to increase the grunt's 'hitbox' so it can be detected by a bullet much easier?
 
Level 10
Joined
Apr 4, 2010
Messages
509
Yeah, it's Collision size is at 200, But it's selection circle is at negative to hide the HP Bar, do you think that has something to do with it? EDIT: just did a quick test, selection circle doesn't matter if it's at -1 or 4, he has the same hit box. I've even went into Game Play Constants and changed the Collision - Maximun Radius to the Max.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,170
Based on this one must assume the area search only applies to the unit origin. Hence it will only see the unit if the origin is inside the searched area. This means it is possible for the unit collision to fill the entire search area but still not be returned as a search result because its origin is not in the search area.

My only suggestion would be to expand the search area. You could store unit collision radius inside a hashtable and use that to adjust search distance. Another approach would be to give large units special collision handling where they search for the missiles in a collision corrected area rather than the missiles search for them since the missiles are much smaller than they are.

Mechanically this is probably down to how the search is performed. I would imagine a data structure like quad-tree is used to map units for spatial queries. Each unit is represented as his origin point in this structure so all searches will only return a unit if his origin point is in the query area. The structure has no idea about the area the unit takes up, only where its origin is and will only return it if the origin is in the query space.
 

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
If you use "pick every unit within x radius" to apply your collision, you need to add the collision size of your unit into the calculation, as picking units only considers the origin of said unit.

So basicly, check 50+collisionsize[unit]. Unfortunately, you can not get a unit's collision size by trigger... you need to basicly define them manually for each unit type. DSG's hashtable approach is the clever solution here.
 
Status
Not open for further replies.
Top