hit cylinder
Moderator: Moderators
hit cylinder
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.
For buildings only of course.
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.jcnossen wrote:This is an implementation detail. If hit cylinders were such a good idea, SJ, or whoever wrote that, would have chosen cylinders.
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..
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
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.
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.
- Drone_Fragger
- Posts: 1341
- Joined: 04 Dec 2005, 15:49
^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.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...
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
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.
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.