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

Figure out BeamFiredPacket #174

Closed
JordanLongstaff opened this issue Oct 11, 2018 · 3 comments
Closed

Figure out BeamFiredPacket #174

JordanLongstaff opened this issue Oct 11, 2018 · 3 comments

Comments

@JordanLongstaff
Copy link
Contributor

The current description of BeamFiredPacket leaves me confused. Apparently it has some convention of structs and unknown fields and apparently this affects which fields are included in the packet structure. Are we sure this is what is really going on, and if so, can we fill in the missing details?

@NoseyNick
Copy link
Collaborator

Yeah, it's messy 😦
The first integer is an object ID. Yes, beams have their own IDs.
The next integer is what I have called "type"
If type==0 (enemy beam), 1 (player beam), or 4 (yeah not sure) (all are protocol version <= 2.2.0)...

  • Integer damage ("nice" base10 ints like 100, 400, 1200, 100, 2800, 520)
  • Integer port (vesselData.xml <beam_port> entry, 0-indexed)
  • Integer shooter type (1,5,6,15)
  • integer target type (1, 5,6,7, 11, 15,16)
  • integer shooter ID
  • integer target ID
  • floats X,Y,Z (if manually targeted, these are the X/Y/Z on the target ship, in ship coords not galaxy coords)
  • integer boolean manually_taretted (0 auto-beams, 1 manual target)

if type==8 (protocol version <= 2.2.0) there's a lot of unknowns that MIGHT correspond to undefined values in the corresponding fields above?

  • integer unknown (2,3,4, 6) MIGHT be very small damage?
  • 6x unknown shorts (MIGHT be invalid/undefined integer port, shooter type, target type but they LOOK a lot like shorts 🙁 )
  • 2x unknown ints (always 0, MIGHT be undefined shooter type / target type???)
  • floats X,Y,Z (except these ones look a lot more like galactic coords, not ship coords)
  • integer, possibly boolean, always 0 (never manually targeted?)

If type==9 (protocol version 2.3.0+)...

  • Integer subtype (0, 1, 2, 5, 8, 9)
  • integer port, probably. (low-ish for subtype==0 or 1, always 0 for other subtypes)
  • integer shooter type, probably. (for subtpye==0, I've seen 5 or 6. for subtype==1 or 2, this is always 1. for subtype==5 or 8, I've only seen 15. for subtype==9, only 0)
  • integer target type, probably. I've seen 0, 1, 5, 6, 7, 11, 15, 16
  • integer unknown, I've only ever seen 0 - EXCEPT when subtype==9 I've seen 2,3,4,6
  • integer shooter ID, except 0 if subtype==9
  • integer target ID, except 0 if subtype==9
  • 3x floats X,Y,Z (ship coords if manual==1 and subtype<9. galaxy coords if subtype==9)
  • 1x integer boolean (0 for auto-beams, 1 for manually targeted, always 0 if subtype==9)

I wish I was joking about how complicated it is, or how confusing the whole type/subtype/protocol_version thing is, and if type==8 is the same structure as type==0,1,4, then I wish I knew why those values LOOK so much like shorts (possibly UTF16s - they look SOMEWHAT printable, but also somewhat nonsense) 😖

@NoseyNick
Copy link
Collaborator

Actually... See also #83 - I'll mark this issue as a dupe.

@NoseyNick
Copy link
Collaborator

If you're OK taking this to #83 , I'll close this. Feel free to re-open if you think it's a different question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants