Ivan Posted April 25, 2022 Share Posted April 25, 2022 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? Quote Link to comment Share on other sites More sharing options...
Azaezel Posted April 25, 2022 Share Posted April 25, 2022 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. Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted April 25, 2022 Share Posted April 25, 2022 its voodoo magic that only Azaezel can understand how it works lol Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.