Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beam weapon #69

Open
Tracked by #68
thombruce opened this issue Oct 28, 2023 · 0 comments
Open
Tracked by #68

Beam weapon #69

thombruce opened this issue Oct 28, 2023 · 0 comments
Labels
core New feature or request
Milestone

Comments

@thombruce
Copy link
Owner

thombruce commented Oct 28, 2023

A beam weapon. This should not spawn a tangible/consistent entity like the ballistic cannon, but should instead draw a beam in the pointing direction of "infinite" length. If the beam intersects with a ship or other collidable object, the length should be the distance between the emitter and the hit entity.

The beam should travel at the speed of light (though this is not worth considering at the scales we're playing at, I don't think), meaning that if relevant the length of the beam ought to grow the longer it is being fired... and when released, that length should persist as it fades into the distance. Again, not worth considering at the current scale - we'll skip this for now, I think.

I know roughly the logic that goes into producing a beam...

  1. If a ship is firing its beam weapon...
  2. Calculate a line of "infinite" distance from the ship in the direction it is facing
  3. If this line intersects with some other entity, restrain the length to this distance (closest intersection)
  4. Draw that in the scene and emit the consequences to the event system (probably)

It's the drawing part I'm unsure of. I'm sure I can draw a simple line in Bevy, I just haven't worked with Bevy's geometry components yet. I'm also not sure if it is the correct approach, or if a texture ought to be used instead. Any texture used would need to be repeating for the full length of the beam... And one thing I would like is for the beam to grow weaker over a greater distance (an imperfect laser), but again, this is unlikely to be relevant at the current scale.

What IS relevant at the current scale is this: The player should not be able to use this at infinite distances regardless of my talk of "infinite" length above. The player should not be able to sweep an arc around the scene and connect with enemy entities 10s of thousands of metres away.


Eventually beam weapons should maybe be affected by large gravitational objects like black holes (I've recently been playing with applying gravity to the ballistic weapons, but have not yet committed to implementing this).

This may inform the decision about whether or not to draw a geometric line or a texture-based one. A texture would be harder to bend, and you'd see the breaks in the texture as you attempted to do so, no? Hence I think drawing it as a textureless entity, based only on Bevy's geometry and drawing capabilities is the right way to go.

@thombruce thombruce mentioned this issue Oct 28, 2023
29 tasks
@thombruce thombruce added the core New feature or request label Oct 28, 2023
@thombruce thombruce added this to Verse Nov 6, 2023
@thombruce thombruce moved this to Todo in Verse Nov 6, 2023
@thombruce thombruce added this to the v0.1.0 milestone Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant