hit cylinder

hit cylinder

Requests for features in the spring code.

Moderator: Moderators

bamb
Posts: 350
Joined: 04 Apr 2006, 14:20

hit cylinder

Post 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.
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Post by Das Bruce »

Non rotating hit boxes are currently in use arn't they?
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

This is an implementation detail. If hit cylinders were such a good idea, SJ, or whoever wrote that, would have chosen cylinders.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Post by TradeMark »

Yeah good idea, i hate the spheres on small units, they take too much space :/
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Post 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. :-)
bamb
Posts: 350
Joined: 04 Apr 2006, 14:20

Post 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..
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

Would be useful as an option for modders.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post 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.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Post 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.
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

One sphere per object would kick colossal ass.
User avatar
Acidd_UK
Posts: 963
Joined: 23 Apr 2006, 02:15

Post by Acidd_UK »

Edit: Somehow posted reply in the wrong thread. Ignore this..
User avatar
FizWizz
Posts: 1998
Joined: 17 Aug 2005, 11:42

Post 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.
User avatar
Drone_Fragger
Posts: 1341
Joined: 04 Dec 2005, 15:49

Post by Drone_Fragger »

or, howabout model defined hitboxes so you can easily make it whatever you want with minimal fuss?
User avatar
FizWizz
Posts: 1998
Joined: 17 Aug 2005, 11:42

Post by FizWizz »

that's what I meant to say when I said 'meshes.'
+1
User avatar
FireCrack
Posts: 676
Joined: 19 Jul 2005, 09:33

Post 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...
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Post 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.
User avatar
FireCrack
Posts: 676
Joined: 19 Jul 2005, 09:33

Post by FireCrack »

That's excelent...

But what is used for unit-unit colossion then?
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

In terms of implementation, I think multiple spheres per model to mimick complex hit detection would probably be an easier option...
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

I believe for buildings it is a groudplate/footprint check, but I'm pretty sure everything else still used collision spheres.
bamb
Posts: 350
Joined: 04 Apr 2006, 14:20

Post 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.
Post Reply

Return to “Feature Requests”