Any thoughts on not ghosting physical zones ?
by Orion Elenzil · in Torque Game Engine · 07/15/2007 (11:35 am) · 5 replies
I was a little surprised recently to see that Physical Zones are in fact ghosted to clients.
i'd assumed they were server-side only, similar to triggers.
after some thought, it makes sense that the client would have them as well,
so that it can do interpolation physics accurately.
however,
i'm thinking of frequently changing the position of physical zones,
and the packupdate price is a little high,
so i'm thinking of just keeping them on the server.
i tried some simple tests by just adding an early-out if "shape->isClientObject()" in physicalZoneFind(),
and things seemed pretty much fine.
thoughts ?
coming soon:
exact break-down of the expense of PhysicalZone's packUpdate.
i'd assumed they were server-side only, similar to triggers.
after some thought, it makes sense that the client would have them as well,
so that it can do interpolation physics accurately.
however,
i'm thinking of frequently changing the position of physical zones,
and the packupdate price is a little high,
so i'm thinking of just keeping them on the server.
i tried some simple tests by just adding an early-out if "shape->isClientObject()" in physicalZoneFind(),
and things seemed pretty much fine.
thoughts ?
coming soon:
exact break-down of the expense of PhysicalZone's packUpdate.
About the author
#2
thank you, bitstream instrumenting!
so probably i can reduce that dramatically, or only ghost the bulk of it when in world-editor mode.
07/15/2007 (11:49 am)
Ah, jeezus - it's 517 bytes directly from PhysicalZone::packUpdate() !thank you, bitstream instrumenting!
[7/15/07 11:44:25][Dbg][Comm ] bitCount 2/2 ( 0.3/0.3 ) | SceneObject::packUpdate 4124-GameConnection-LocalClientConnection-doris lessing 5232-PhysicalZone--s [7/15/07 11:44:25][Dbg][Comm ] bitCount 4138/4140 ( 517.3/517.5 ) | PhysicalZone::packUpdate 4124-GameConnection-LocalClientConnection-doris lessing 5232-PhysicalZone--s
so probably i can reduce that dramatically, or only ghost the bulk of it when in world-editor mode.
#3
roger that, Stephen.
i was worried that the large number of bytes was coming from further up the class heirarchy,
but since it's right there in physicalZone, it should be easy to trim down.
07/15/2007 (11:50 am)
Oops, posts crossing in the night.roger that, Stephen.
i was worried that the large number of bytes was coming from further up the class heirarchy,
but since it's right there in physicalZone, it should be easy to trim down.
#4
it turns out that the motion of other players looked fine with server-only PZ's,
but when it was your own turn to get pushed around, things were choppy as one might expect.
07/15/2007 (12:30 pm)
More on this -it turns out that the motion of other players looked fine with server-only PZ's,
but when it was your own turn to get pushed around, things were choppy as one might expect.
#5
but i've changed physicalZone in the following ways to make it more reasonable to move them around:
1. don't ghost the polyhedron, ever. just set it to a nice box in onAdd().
2. give physical zone two new network masks: MoveMask and ParamsMask, and use them.
3. w/r/t moveMask, send the transform over via stream->writeAffineTransform() instead of the whole matrix.
still to go:
i need a way for certain players to be exempt from certain physicalZones.
(the application here is a personal forcefield which pushes other peeps around)
not 100% decided on this yet, but plan on making a small mask (8 bits or so) which gets ghosted as part of player and part of PhysicalZone, and if a player & a physical zone have any bits in common, the player is exempt.
07/15/2007 (2:03 pm)
If anyone is interested in this stuff as a resource or just a more detailed write up, let me know,but i've changed physicalZone in the following ways to make it more reasonable to move them around:
1. don't ghost the polyhedron, ever. just set it to a nice box in onAdd().
2. give physical zone two new network masks: MoveMask and ParamsMask, and use them.
3. w/r/t moveMask, send the transform over via stream->writeAffineTransform() instead of the whole matrix.
still to go:
i need a way for certain players to be exempt from certain physicalZones.
(the application here is a personal forcefield which pushes other peeps around)
not 100% decided on this yet, but plan on making a small mask (8 bits or so) which gets ghosted as part of player and part of PhysicalZone, and if a player & a physical zone have any bits in common, the player is exempt.
Torque 3D Owner Stephen Zepp