Difference between revisions of "UpdateTransformMessage"

From SWGANH Wiki
Jump to: navigation, search
(Variable Descriptions)
Line 108: Line 108:
  
 
----
 
----
 
==Sample Code==
 
 
<pre>
 
Insert Code Snippet Here...
 
</pre>
 
  
 
==Sample Packet==
 
==Sample Packet==

Revision as of 18:04, 23 September 2007


Struct


SHORT Operand_Count
INT Opcode
LONG ObjectID
SHORT PositionX
SHORT PositionY
SHORT PositionZ
INT UpdateCounter
BYTE Posture
BYTE Direction

Variable Descriptions


Opperand_Count = 8

Opcode = 1B24F808


  • ObjectID:
ObjectID that you are listing attributes for.
  • Position X / Y / Z:
New Position of Object. The value is transformed the following way.
n = X / 4;
if n > 8192 n = n - 16384; 
effective map range is -8192..8192

to convert the a float to position
n = uint16(x * 4.0f + 0.5f);
  • UpdateCounter:
Number of movement updates the object has done.
Used to distinguish new updates from potential repeats.
Incremented by 1 each packet.
  • Posture:

The byte before direction corresponds to:

value State
0 Upright
1 Crouched
2 Prone
3 Sneaking
4 Blocking
5 Climbing
6 Flying
etc etc...

Haven't seen it out side the range of 0..5 yet

  • Direction:
This is the direction for the object to face after moving.
It is calculated by (Angle / 0.0625) where angle is in radians.
    • Additional Notes:
This packet needs to be sent frequently to prevent start/stop in a movement stream.
Also, shorter distances at slower frequency will create slower speed.
It appears the unknown byte is some sort of server-side interpolation variable.
It doesnt have any affect on the client, as far as we can tell.
This byte seems to be related to the 2 variances of ObjController Transform Packets
used (23 vs 21). See them for further detail. The 23 seems to be sent
in a Data channel signifying it being important. This byte is related to a
count of 21's the occur between a group of 23. The 23 is assumed to be start/end
of a chain of movement while the 21 is an update.

Tags


S→C This packet originates on the server.

100% This packet has been completely reversed.


Sample Packet

Insert Sample Packet Here...