• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Collision Detection Concept

Status
Not open for further replies.
Level 8
Joined
Jun 28, 2008
Messages
356
Usually in physics engines in war3 collision detection is done with enumerating units in range, right? And this tends to cause lots of lag. Would it be more efficient if you use invisible immolation and damage detection method to determine collision? Would that even be possible? Does immolation have limited radius?

I was just wondering. Usually I would open the worldeditor myself and try it, but I don't have it on this computer.
 
Level 8
Joined
Jun 28, 2008
Messages
356
Yes but we all know compiled code is hundreds of times faster than interpreted code.

EDIT: On the first point - imagine you have 200 objects that you have to calculate physics for every ... lets say 0.03 sec and some of them have a radius of 80-120.
 
Enumerating units that are affected by Immolation doesn't automatically calculate their collision. When the affected units are dependant on the immolation's radius, which is set by the user in the Object Editor, this becomes a risky and inaccurate way.

What is more, units that stand within let's say 200 range are also affected with the units that stand within 300 range, if, let's say, the Area of Effect for the immolation-bearer is set to 400.

So, checking distances between units to bypass the problem I previously mentioned is also anorthodox, because distance doesn't automatically equal to collision size.

Check out this system: http://www.wc3c.net/showthread.php?t=101309
 
Level 8
Joined
Jun 28, 2008
Messages
356
I think you didn't understand me, I'm not trying to find the collision size of a unit, I'm trying to find a more efficient way to detect actual collisions happening, provided that I know the collision size of every object.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
I don't think enumerating units withing a small radius will cause any lag.

If you use Immolation, don't you think there's some kind of internal code running, possibly one that enumerates units within radius? Or how do you think Immolation is coded?

You think an object editor skill and a same skill which coded with trigger editor has same efficiency?
 
Level 8
Joined
Jun 28, 2008
Messages
356
Actually I tested it. Here is the results:

Enuming Collision (Radius: 150)
25 objects... lag free
50 objects... lag free
100 objects... extreme lag (less than 1 fps)

Immolating Collision (Radius: 150)
25 objects... lag free
50 objects... lag free
100 objects... moderate lag (about 15-16 fps)
200 objects... extreme lag (less than 1 fps)

I expected the immolating collision to score much better
 
Level 20
Joined
Apr 22, 2007
Messages
1,960
elfian said:
Usually in physics engines in war3 collision detection is done with enumerating units in range, right? And this tends to cause lots of lag. Would it be more efficient if you use invisible immolation and damage detection method to determine collision? Would that even be possible? Does immolation have limited radius?

I was just wondering. Usually I would open the worldeditor myself and try it, but I don't have it on this computer.
Interesting idea. But enuming units in range isn't that big of a deal, so long as you use proper filters. I'd have to think about it more, but I can't think of a major disadvantage to using this implementation... well, with groups you can easily make sure you don't check a collision twice, and I think that would be a bit trickier with this implementation.

If I were still Jassing, I'd probably try it out on my physics engine.
 
Level 8
Joined
Jun 28, 2008
Messages
356
Interesting idea. But enuming units in range isn't that big of a deal, so long as you use proper filters. I'd have to think about it more, but I can't think of a major disadvantage to using this implementation... well, with groups you can easily make sure you don't check a collision twice, and I think that would be a bit trickier with this implementation.

If I were still Jassing, I'd probably try it out on my physics engine.

Haha, HINDYhat himself, I'm honoured, infact it's your post in your SEE resource about collision being the major problem that made me think of another way :]
 
Status
Not open for further replies.
Top