Page 1 of 2

hit cylinder

Posted: 31 Jul 2006, 12:15
by bamb
instead of a sphere. It would be useful for tall structures like laser towers. And computationally actually more efficient. Rotations in z-axis wouldn't change it at all, and structures can't be tilted in spring, can they? So it would be rotation-stable, just like a sphere.
For buildings only of course.

Posted: 31 Jul 2006, 12:18
by Das Bruce
Non rotating hit boxes are currently in use arn't they?

Posted: 31 Jul 2006, 12:26
by jcnossen
This is an implementation detail. If hit cylinders were such a good idea, SJ, or whoever wrote that, would have chosen cylinders.

Posted: 31 Jul 2006, 12:28
by TradeMark
Yeah good idea, i hate the spheres on small units, they take too much space :/

Posted: 31 Jul 2006, 12:28
by Das Bruce
jcnossen wrote:This is an implementation detail. If hit cylinders were such a good idea, SJ, or whoever wrote that, would have chosen cylinders.
Not exactly, it might've been easier to do one than the other. Our footprints still don't rotate btw. :-)

Posted: 31 Jul 2006, 13:15
by bamb
jcnossen wrote:This is an implementation detail. If hit cylinders were such a good idea, SJ, or whoever wrote that, would have chosen cylinders.
Of course I meant as a choice, in addition to spheres. Tall skinny structures don't really like those speres much, but a cylinder would fit there quite nicely. Just a niche solution really.
Maybe for really wide and low buildings too. (Air repair pad?) I don't know if it could be a tag somehow and automatically adjusted or if it's a part of the model file etc..

Posted: 31 Jul 2006, 13:55
by Caydr
Would be useful as an option for modders.

Posted: 31 Jul 2006, 14:37
by Warlord Zsinj
We've been campaigning for better collision detection for a long time, as it is the cause of many issues in our mod, and the #1 prevention of the Star Wars in Space mod from getting off the ground.

We've come to the conclusion that it's unlikely to happen any time soon.

Posted: 31 Jul 2006, 17:47
by Pxtl
Most games use cylinders anyways. Almost every FPS and many other kinds of games use cylinders because it matches well to a humanoid form, square-based tanks, and the like. The few games I've seen that use spheres generally use 1 sphere per part (like the earlier Mechwarrior games) so that you can assemble a complex hitbox out of many simple hitspheres.

Posted: 31 Jul 2006, 20:05
by Caydr
One sphere per object would kick colossal ass.

Posted: 31 Jul 2006, 20:18
by Acidd_UK
Edit: Somehow posted reply in the wrong thread. Ignore this..

Posted: 31 Jul 2006, 21:00
by FizWizz
What about for units that have a long, narrow geometry? Take something like the F-104 Starfighter for example. Hit cylinders would suck unless they could be oriented differently (although they would be an improvement on spheres). I would like to see collision boxes or meshes (ftw) implemented instead, but I guess cylinders are better than spheres for now.

Posted: 31 Jul 2006, 21:17
by Drone_Fragger
or, howabout model defined hitboxes so you can easily make it whatever you want with minimal fuss?

Posted: 31 Jul 2006, 21:25
by FizWizz
that's what I meant to say when I said 'meshes.'
+1

Posted: 01 Aug 2006, 00:17
by FireCrack
^meshes can be quite slow, but a simple primative (sphere, cylender, cube...) or collection of simple primatives would work nicely for all but the biggest objects, the main problem with non spherical/cylindrical hit boxes is deciding what to do if the unit needs to turn and somthing is blocking it form doing so...

Posted: 01 Aug 2006, 04:14
by Pxtl
FireCrack wrote:^meshes can be quite slow, but a simple primative (sphere, cylender, cube...) or collection of simple primatives would work nicely for all but the biggest objects, the main problem with non spherical/cylindrical hit boxes is deciding what to do if the unit needs to turn and somthing is blocking it form doing so...
Hitspheres aren't used for unit-unit collisions anyways, afaik - only projectile ones, so we're good there.

Posted: 01 Aug 2006, 08:54
by FireCrack
That's excelent...

But what is used for unit-unit colossion then?

Posted: 01 Aug 2006, 16:19
by Warlord Zsinj
In terms of implementation, I think multiple spheres per model to mimick complex hit detection would probably be an easier option...

Posted: 01 Aug 2006, 16:43
by SinbadEV
I believe for buildings it is a groudplate/footprint check, but I'm pretty sure everything else still used collision spheres.

Posted: 01 Aug 2006, 16:43
by bamb
nononono, why vertical cylinders are good that they don't care about rotation in the z axis! So you never have to transform (=rotate) them at all! I don't propose anything else.

They're as good as spheres. You never have to rotate speres since, well, they look the same anyway. That's why it's computationally efficient to have your peewee or llt in a sphere. If you had some box or so, it'd suck since you'd have to check the orientation of the unit and then rotate the box accordingly before checking hits. => expensive (you'd calculate some trigonometry)!. But vertical cylinder and sphere are the only forms that are z-axis-rotation independent.

A vertical cylinder has all the benefits of the sphere in a non-tilting unit (=building) and gives some extra accuracy.

You of course could have a box for a building too.

With units, you're still stuck to spheres since units rotate in all axes. You'd need trigonometry if you used boxes or cylinders. Ilmtitan proposed ellipses or oblong spheres, which is only slightly more expensive than spheres, but I dunno. You'd need the unit rotations too besides position to calculate hits, so amount of data would grow too.