erysdren's WWW site

software, gameware, strangeware

RSS Feed

Rise of the Triad network protocol
2024-08-07

Here is some basic documentation for the protocol that ROTT uses to communicate between the client and server for COMM-BAT. This information is sourced from the GPLv2 source code provided by Apogee Software on December 20th 2002. All values shown are assumed to be in little-endian byte order.

Simple Types

Complex Types

DESC

Data TypeDescription
U8Character
U8Uniform Color
STRCodename (9 bytes)

SPECIALS

Data TypeDescription
I32God Mode Time
I32Dog Mode Time
I32Shrooms Mode Time
I32Elasto Mode Time
I32Asbestos Vest Time
I32Bullet Proof Vest Time
I32Gas Mask Time
I32Mercury Mode Time
I32God Mode Respawn Time
I32Dog Mode Respawn Time
I32Shrooms Mode Respawn Time
I32Elasto Mode Respawn Time
I32Asbestos Vest Respawn Time
I32Bullet Proof Vest Respawn Time
I32Gas Mask Respawn Time
I32Mercury Mode Respawn Time

BATTLETYPE

Data TypeDescription
U32Gravity
U32Speed
U32Ammo
U32Hit Points
U32Spawn Dangers
U32Spawn Health
U32Spawn Weapons
U32Spawn Mines
U32Respawn Items
U32Weapon Persistence
U32Random Weapons
U32Friendly Fire
U32Light Level
I32Kills
I32Danger Damage
U32Time Limit
U32Respawn Time

Packet Structure

Packets always start with a U8 value defining its type. This allows for 256 possible packet types. Packets have a maximum size of 2048 bytes.

Packet types

0x01 | Movement Queue

Data TypeDescription
U8Packet Type
I32Packet Time
I16X Velocity
I16Y Velocity
U16Z Height (absolute?)
U16Player Button State

0x02 | Request Packets

Data TypeDescription
U8Packet Type
I32Packet Time
U8Number of Packets

0x03 | Fixup Packets

Data TypeDescription
U8Packet Type
I32Packet Time
U8Number of Packets
*Packet Data

0x04 | Text

Data TypeDescription
U8Packet Type
I32Packet Time
U8Destination Player
STRText (33 bytes)

0x05 | Pause Game

Data TypeDescription
U8Packet Type
I32Packet Time

0x06 | Quit Game

Data TypeDescription
U8Packet Type
I32Packet Time

0x07 | Sync Time

Data TypeDescription
U8Packet Type
I32Sync Time

0x08 | Remote Ridicule

Data TypeDescription
U8Packet Type
I32Packet Time
U8Source Player
U8Unknown
U8Destination Player

0x0A | Respawn

Data TypeDescription
U8Packet Type
I32Packet Time

0x0B | Unpause Game

Data TypeDescription
U8Packet Type
I32Packet Time

0x0C | Server Data

Data TypeDescription
U8Packet Type
I32Packet Time
U8Number of Packets
*Packet Data

0x0F | Game Description

Data TypeDescription
U8Packet Type
U8Player ID
U8Violence Level
U8Product ID
U32Game Version
DESCPlayer Description

0x10 | Game Play

Data TypeDescription
U8Packet Type
*Dummy Data (20 bytes)

0x11 | Game Master

Data TypeDescription
U8Packet Type
U8Level Number
U16Map CRC
U8Violence Level
U8Product ID
U8Mode
U32Game Version
U8Teamplay
SPECIALSSpecials Times
BATTLETYPEBattle Mode Options
STRLevel Filename (20 bytes)
I32Random Seed
U8Ludicrous Gibs
DESC[]Array of Player Descriptions (11 if registered, 5 if shareware).

0x12 | Game Acknowledgement

Data TypeDescription
U8Packet Type
U8Player ID

0x13 | Game End

Data TypeDescription
U8Packet Type
I32Packet Time

0x13 | Sync Time

Data TypeDescription
U8Packet Type
I32Sync Time

0x16 | Movement Queue and Sound

Data TypeDescription
U8Packet Type
I32Packet Time
I16X Velocity
I16Y Velocity
U16Z Height (absolute?)
U16Player Button State
U8Sound Packet Type
*Sound Data (256 bytes)

0x17 | Exit Game

Data TypeDescription
U8Packet Type
I32Packet Time

0x18 | Game End

Data TypeDescription
U8Packet Type
I32Packet Time

0x19 | Null Movement Queue

Data TypeDescription
U8Packet Type
I32Packet Time