Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

Editing Fitzquake Protocol

From Quake Wiki

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
{{Infobox Network Protocol
+
The Fitzquake protocol is derived from the [[Netquake Protocol]] and was introduced in Fitzquake 0.85.  Currently no other clients or servers support it.
|name=Fitzquake Protocol
 
|version=666
 
|base=[[Netquake Protocol]]
 
|clients=[[Fitzquake]] 0.85+
 
[[DirectQ]] 1.7.666+
 
|servers=[[Fitzquake]] 0.85+
 
[[DirectQ]] 1.7.666+
 
}}
 
The '''Fitzquake Protocol''' is derived from the [[Netquake Protocol]] and was introduced in [[Fitzquake]] version 0.85.  Currently only Fitzquake and [[DirectQ]] support it.
 
  
 
==Overview of Features==
 
==Overview of Features==
The Fitzquake protocol adds support for increased limits such as model and sound precaches, model frames, edicts, and player armor and ammo stats.  It also supports entity and weaponmodel alpha, and adds timing hints for model interpolation.
+
The Fitzquake protocol adds support for increased limits such as model and sound precaches (normal limit 255), model frames (normal limit 255), edicts (), player armor and ammo stats (normally 255).  It also supports entity and weaponmodel alpha, and adds timing hints for model interpolation.
  
 
===Model index > 255===
 
===Model index > 255===
Quake normally sends model indexes as a single byte.  Fitzquake can send a second byte when the index exceeds 255.  This works for both entity models and player's weapon models.
+
Quake normally sends model indexes as a single byte.  Fitzquake can send a second byte when the index exceeds 255.
  
 
===Entity frame index > 255===
 
===Entity frame index > 255===
Line 41: Line 32:
 
Player weapon model alpha is transmitted seperately from the client entity alpha, but for now the Fitzquake server uses the client entity's .alpha field for both.  There is currently no way for QuakeC to set the weapon alpha specifically.
 
Player weapon model alpha is transmitted seperately from the client entity alpha, but for now the Fitzquake server uses the client entity's .alpha field for both.  There is currently no way for QuakeC to set the weapon alpha specifically.
  
===Interpolation timing hints===
+
===Interpolation Timing Hints===
 
For entities that don't animate at exactly 10Hz, such as crucified zombies, this hint tells the client what interval to use when lerping to the new frame.  This interval is taken from the entity's [[.nextthink]] value, subtracted from the current server time.  It is only sent to clients when it does not equal 0.1.
 
For entities that don't animate at exactly 10Hz, such as crucified zombies, this hint tells the client what interval to use when lerping to the new frame.  This interval is taken from the entity's [[.nextthink]] value, subtracted from the current server time.  It is only sent to clients when it does not equal 0.1.
  
==Client Messages==
+
==Client/Server Messages==
The following client messages have changed:
+
The following client/server messages have been added, or their behavior has changed:
 
 
===clc_move===
 
Client angles are always sent to the server as shorts instead of bytes.  The angles are encoded and decoded as follows:
 
 
 
<pre>
 
void MSG_WriteAngle16 (sizebuf_t *sb, float f)
 
{
 
    MSG_WriteShort (sb, Q_rint(f * 65536.0 / 360.0) & 65535);
 
}
 
 
 
float MSG_ReadAngle16 (void)
 
{
 
    return MSG_ReadShort() * (360.0 / 65536);
 
}
 
</pre>
 
 
 
You may need to define Q_rint in your mathlib.h; the definition is:
 
 
 
<pre>
 
#define Q_rint(x) ((x) > 0 ? (int)((x) + 0.5) : (int)((x) - 0.5))
 
</pre>
 
 
 
==Server Messages==
 
The following server messages have been added, or their behavior has changed:
 
  
 
===entity update===
 
===entity update===
 
The existing update flags field can have 5 new flags.
 
The existing update flags field can have 5 new flags.
  
* U_EXTEND1 - another byte of flags will follow the first two.
+
* U_EXTEND1 - another byte of flags will follow the first two.  This is sent whenever any of the next four flags are used.
 
* U_ALPHA - entity has alpha different than its baseline. Alpha is encoded as a single byte, with a 0 representing "default" alpha, and values 1-255 representing the range 0.0-1.0.  Use the ENTALPHA_ macros (below) to convert correctly between floats and bytes. This byte is sent immediately after the U_ANGLE3 angle, if present.
 
* U_ALPHA - entity has alpha different than its baseline. Alpha is encoded as a single byte, with a 0 representing "default" alpha, and values 1-255 representing the range 0.0-1.0.  Use the ENTALPHA_ macros (below) to convert correctly between floats and bytes. This byte is sent immediately after the U_ANGLE3 angle, if present.
 
* U_FRAME2 - entity frame is >255, so a second byte will be sent. It is sent immediately after the U_ALPHA byte, if present.
 
* U_FRAME2 - entity frame is >255, so a second byte will be sent. It is sent immediately after the U_ALPHA byte, if present.
* U_MODEL2 - entity modelindex is >255, so a second byte will be sent.  It is sent immediately after the U_FRAME2 byte, if present.
+
* U_MODEL2 - entity modelindex is >255, so a second byte will be sent.  It is sent immediately after the U_ALPHA byte, if present.
* U_LERPFINISH - nextthink interval (ent->v.nextthink - sv.time) is not exactly 0.1 seconds, so the actual interval will be sent as a byte.  Intervals of 0.0-1.0 seconds map to values 0-255.  Anything >1 is clamped.  It is sent immediately after the U_MODEL2 byte, if present.
+
* U_LERPFINISH - nextthink interval (ent->v.nextthink - sv.time) is not exactly 0.1 seconds, so the actual interval will be sent as a byte.  Intervals of 0.0-1.0 seconds map to values 0-255.  Anything >1 is clamped.
  
 
===svc_clientdata===
 
===svc_clientdata===
Line 98: Line 65:
 
The existing flags field can have 2 new flags.  
 
The existing flags field can have 2 new flags.  
  
* SND_LARGEENTITY - the edict is 2 full bytes followed by a third byte for the channel, rather than packing them into a single short (13 bits for edict, 3 bit for channel.)  This is used whenever the edict number is > 8191.
+
* SND_LARGEENTITY - the edict is 2 full bytes and the following byte is the channel, rather than packing them into a single short (13 bits for edict, 3 bit for channel.)  This is used whenever the edict number is > 8191.
 
* SND_LARGESOUND - the sound index is 2 bytes instead of 1.  This is sent when the sound index is > 255.
 
* SND_LARGESOUND - the sound index is 2 bytes instead of 1.  This is sent when the sound index is > 255.
  
Line 113: Line 80:
 
===svc_spawnstaticsound2 (new)===
 
===svc_spawnstaticsound2 (new)===
 
This message is sent instead of [[svc_spawnstaticsound]] if sound index is > 255.  It is the same as svc_spawnstaticsound except the sound index is 2 bytes.
 
This message is sent instead of [[svc_spawnstaticsound]] if sound index is > 255.  It is the same as svc_spawnstaticsound except the sound index is 2 bytes.
 +
 +
===clc_move===
 +
Client angles are always sent to the server as shorts instead of bytes.  The angles are encoded and decoded as follows:
 +
 +
<pre>
 +
void MSG_WriteAngle16 (sizebuf_t *sb, float f)
 +
{
 +
    MSG_WriteShort (sb, Q_rint(f * 65536.0 / 360.0) & 65535);
 +
}
 +
 +
float MSG_ReadAngle16 (void)
 +
{
 +
    return MSG_ReadShort() * (360.0 / 65536);
 +
}
 +
</pre>
  
 
==Definitions==
 
==Definitions==

Please note that all contributions to Quake Wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see Quake Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)

Template used on this page: