Jump to content

projectile & packUpdate/unpackUpdate


Ivan
 Share

Recommended Posts

Why is packUpdate/unpackUpdate only called 2 times for a projectile object (at the beginning and at the end)?
How can I make packUpdate/unpackUpdate be called at every step?

Link to comment
Share on other sites

Well, it's important to keep in mind that packupdate/unpackupdate is the server telling the client that 'something has changed' and the client needs to update it's simulation of what's been going on. So with that in mind, assuming that the projectile is alive long enough for server->client ping time to even register a tertiary packet, then that brings us to the masking system:
https://github.com/TorqueGameEngines/Torque3D/blob/Preview4_0/Engine/source/T3D/projectile.cpp#L1177
+
https://github.com/TorqueGameEngines/Torque3D/blob/Preview4_0/Engine/source/T3D/projectile.cpp#L1389
+
https://github.com/TorqueGameEngines/Torque3D/blob/Preview4_0/Engine/source/T3D/projectile.cpp#L1436
represents the 'something has changed' outside of the client sim it needs to take into account. hence the new packet. 
So for each changing event you'll want to either add a new mask (not advised as a general rule, since that's a 32 bit array of booleans, though looking at projectile in particular it's only using 9, so doable) or injecting code into one of the already exposed filters along the inheritance chain. Either way you'll use setMaskBits(ThatEnumFilter) whenever such an event kicks off to notify the networking that it needs to send along a correction.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...