Difference between revisions of "Network Protocol/EVENT"

From Custom Mario Kart
Jump to navigation Jump to search
(Fixed link)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This pages is related to [[MKWii Network Protocol]] and describes the record type '''EVENT'''.
+
== Overview ==
 +
This article describes the record type '''EVENT''' of the [[Network Protocol]]. This records transmits item events. These are activating, losing and picking up an item. A new event is placed in the first free slot of '''EVENT'''. The data of all events are stored after the slot list. This announcement is active for around 3 seconds and the data is not modified during this time. This means that each console calculates the item routes and the interaction on its own.
  
{{MKWii Network Protocol RACE}}
+
{{Network Protocol RACE}}
  
The record '''EVENT''' transmits events. Events are:
+
=== Event Types ===
* Activating an item.
+
The byte describing an event type is split up into two parts: a 3 bit action type followed by a 5 bit [[List of Identifiers#Items|object number]] for the item involved.
* Lose an item.
 
* Pick up an item.
 
A new event is placed in the first free slot of '''EVENT'''. The data of all events are stored after the slot list. This announcement is active for 200/60 seconds and the data is not modified during this time. This means that each Wii calculates the item routes and the interaction by its own.
 
  
== Event Types ==
+
{| class="textbox grid sortable center alt"
 
+
|+ Types
The byte describing an event type is split up into two parts: a 3 bit action type followed by a 5 bit [[List_of_Identifiers#Items|object number]] for the item involved.
+
! ID
 
+
! Name
{| class="textbox grid sortable alt"
+
! Description
|+ Action Types
 
! Id!! Name !! Description
 
 
|-
 
|-
| align=center | 0
+
| 0
| align=center | NONE
+
| NONE
| The neutral value for unused slots. Always paired with object id 0x10
+
| The neutral value for unused slots (always paired with object ID 0x10).
 
|-
 
|-
| align=center | 1
+
| 1
| align=center | USED
+
| USED
| Using an item, such as Lightning or a Mushroom.
+
| Using an item, such as the Lightning or a Mushroom.
 
|-
 
|-
| align=center | 2
+
| 2
| align=center | SHOT
+
| SHOT
 
| Throwing an item, either forwards or backwards, such as a Green Shell or Banana.
 
| Throwing an item, either forwards or backwards, such as a Green Shell or Banana.
 
|-
 
|-
| align=center | 3
+
| 3
| align=center | HIT-DRAGGED
+
| HIT-DRAGGED
| Hitting the dragged item of a player (can be yourself), either with your vehicle or an item.
+
| Hitting the dragged item of any player, either with your vehicle or an item.
 
|-
 
|-
| align=center | 4
+
| 4
| align=center | HIT-FREE
+
| HIT-FREE
| Hitting any item that isn't being dragged, either with your vehicle or an item.
+
| Hitting any item that is not being dragged, either with your vehicle or an item.
 
|-
 
|-
| align=center | 5
+
| 5
| align=center | LOSE?
+
| LOSE
| Used when a Thunder Cloud is lost, either from its timer running out or from passing it to another player
+
| Used when a Thunder Cloud is lost, either from its timer running out or from passing it to another player.
 
|-
 
|-
| align=center | 6
+
| 6
| align=center | ?
+
| {{Unknown}}
| Unknown
+
| {{Unknown}}
 
|-
 
|-
| align=center | 7
+
| 7
| align=center | DROP
+
| DROP
| Dropping an item when hit (including ones that disappear on landing)
+
| Dropping an item when hit, including items that disappear when landing.
 
|}
 
|}
  
== Event Data Structure ==
+
=== Event Data Structure ===
 
+
The data structure depends on the data types defined by the slot list of EVENT. The data is not aligned. To find the DATA for a specific slot, the slots must be iterated to skip the previous data. The data size for a single event differs from 3 to 21 bytes, depending on the action type.
The data structure depends on the data types defined by the slot list of EVENT. The data is not aligned. To find the DATA for a specific slot, the slots must be iterated to skip the previous data. The data size for a single event differs from 3 to 21 bytes, depending on the action type:
 
  
{| class="textbox grid sortable alt"
+
{| class="textbox grid sortable center alt"
|+ Event Data Sizes by Action Type
+
|+ Data Sizes
! Id!! Size (bytes)
+
! ID
 +
! Size (bytes)
 
|-
 
|-
| align=center | 1
+
| 1
| align=center | 3
+
| 3
 
|-
 
|-
| align=center | 2
+
| 2
| align=center | Varies by item
+
| Varies per item
 
|-
 
|-
| align=center | 3
+
| 3
| align=center | 20
+
| 20
 
|-
 
|-
| align=center | 4
+
| 4
| align=center | 5
+
| 5
 
|-
 
|-
| align=center | 5
+
| 5
| align=center | 5
+
| 5
 
|-
 
|-
| align=center | 6
+
| 6
| align=center | 4
+
| 4
 
|-
 
|-
| align=center | 7
+
| 7
| align=center | 20
+
| 20
 
|}
 
|}
  
Every event data starts with a 2 byte time stamp, a copy of the timer of record [[MKWii Network Protocol/RACEHEADER_1|RACEHEADER_1]].
+
{{Network Protocol}}
 
+
[[Category:Network Protocol|E]]
{{MKWii Network Protocol}}
 
[[category: Network Protocol|R]]
 

Latest revision as of 20:35, 28 January 2024

Overview

This article describes the record type EVENT of the Network Protocol. This records transmits item events. These are activating, losing and picking up an item. A new event is placed in the first free slot of EVENT. The data of all events are stored after the slot list. This announcement is active for around 3 seconds and the data is not modified during this time. This means that each console calculates the item routes and the interaction on its own.

Race Packet Sections
Name Amount Size Description
SLOT 0-1 0x08 Only used for redirected data via a proxy. The record identifies the original client by its slot number.
HEADER 1 0x10 A header for a race packet.
RACEHEADER_1 1 0x28 A record with basic race data.
RACEHEADER_2 0-1 0x28 A record with game-mode specific race data (not present in live view).
ROOM 0-1 0x04 A record containing a friend room message (not present outside friend room lobbies).
SELECT 0-1 0x38 A record containing data to set up a match (not present during races).
RACEDATA 1-2 0x40 A record containing race data for each player, such as positions or inputs.
USER 0-1 0xC0 A record containing user data such as Miis and friend codes.
ITEM 1-2 0x08 A record containing information about players' items.
EVENT 1 ≥ 0x18 A record transmitting item events.


Event Types

The byte describing an event type is split up into two parts: a 3 bit action type followed by a 5 bit object number for the item involved.

Types
ID Name Description
0 NONE The neutral value for unused slots (always paired with object ID 0x10).
1 USED Using an item, such as the Lightning or a Mushroom.
2 SHOT Throwing an item, either forwards or backwards, such as a Green Shell or Banana.
3 HIT-DRAGGED Hitting the dragged item of any player, either with your vehicle or an item.
4 HIT-FREE Hitting any item that is not being dragged, either with your vehicle or an item.
5 LOSE Used when a Thunder Cloud is lost, either from its timer running out or from passing it to another player.
6 Unknown Unknown
7 DROP Dropping an item when hit, including items that disappear when landing.

Event Data Structure

The data structure depends on the data types defined by the slot list of EVENT. The data is not aligned. To find the DATA for a specific slot, the slots must be iterated to skip the previous data. The data size for a single event differs from 3 to 21 bytes, depending on the action type.

Data Sizes
ID Size (bytes)
1 3
2 Varies per item
3 20
4 5
5 5
6 4
7 20