Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: rubixcube on January 24, 2014, 11:19:39 pm
-
how are laser hitboxes determined in FS? I always assumed it was laser head radius but sometimes gameplay doesn't seem to correlate with that
-
Seeing as no one more knowledgeable replied - I'm fairly certain the lasers are just a point in space, and don't have an actual hit radius.
-
As far as ship<->weapon collisions are concerned, yes, I'm pretty sure lasers are treated as one-dimensional rays.
-
Interesting, that's certainly not what I expected, and it's difficult to wrap my head around; the game engine can somehow detect collisions with something with no physical dimensions.
-
It's kinda got physical dimensions, just really small ones. i.e. a single position in space represented by 32bit floats. The ray bit would just be relevant in collisions to check the difference in position between 2 frames.
(although I'll admit that I haven't really looked at this section of the code, this is mostly how I *think* it works!)
-
Interesting, that's certainly not what I expected, and it's difficult to wrap my head around; the game engine can somehow detect collisions with something with no physical dimensions.
Well, collision detection is all math, and it's actually a whole lot easier and especially a lot faster to check if and where a line intersects a bunch of triangles than it is to check if and where two different bunches of triangles intersect each other.
When the game checks for laser collisions, it basically looks where the laser was last frame and where it is now, draws an imaginary line between those two points and then checks whether and where that line intersects any other objects in the game.
That said, if someone had a need to make really wide lasers which should have a more wide "hitbox", then such a feature would be very much possible.
-
Thinking about the giant Akrotiri main gun thingy from Ancient-Shivan War, that would certainly be something to think about.
-
ShmupSpace would benefit a lot from laser not having just collision at the very tail end of it. It really confused me at first as to why I wasn't getting hit until I realized that.
-
It's the head, not the tail.
-
It's the head, not the tail.
No, it's definitely the tail. Or, more accurately, the center of the laser. Just the tail is dead center on that point. models don't have to obey that since the origin can be wherever relative to the rest of the model.