Author Topic: laser hitbox  (Read 2766 times)

0 Members and 1 Guest are viewing this topic.

Offline rubixcube

  • best username ever
  • 28
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
Stuff

 

Offline Alan Bolte

  • 28
  • Deneb III
    • @Compellor
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.
Anything worth doing is worth analyzing to death -Iranon

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
As far as ship<->weapon collisions are concerned, yes, I'm pretty sure lasers are treated as one-dimensional rays.

 

Offline rubixcube

  • best username ever
  • 28
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.
Stuff

 

Offline niffiwan

  • 211
  • Eluder Class
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!)
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
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.

 

Offline AndrewofDoom

  • In A.D. 2366 war was beginning
  • 29
  • Permanent yuri goggles.
    • Skype
    • Steam
    • Twitter
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.
My Efforts:
SF Knight

20:08:19   AndrewofDoom: Though I find it mildly disturbing that a loli is giggling to mass destruction.
20:10:01   Spoon: I find it mildly arrousing
20:10:07   AndrewofDoom: Woah
20:10:15   Spoon: sound like my kind of loli
20:10:21   Spoon: and im not even a lolicon

 

Offline Aardwolf

  • 211
  • Posts: 16,384
It's the head, not the tail.

  

Offline AndrewofDoom

  • In A.D. 2366 war was beginning
  • 29
  • Permanent yuri goggles.
    • Skype
    • Steam
    • Twitter
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.
My Efforts:
SF Knight

20:08:19   AndrewofDoom: Though I find it mildly disturbing that a loli is giggling to mass destruction.
20:10:01   Spoon: I find it mildly arrousing
20:10:07   AndrewofDoom: Woah
20:10:15   Spoon: sound like my kind of loli
20:10:21   Spoon: and im not even a lolicon