Difference between revisions of "Network Protocol/EVENT"
m (Typos) |
(Updated based on some code analysis and in-game testing) |
||
Line 11: | Line 11: | ||
== Event Types == | == Event Types == | ||
− | + | The byte describing an event type is split up into two parts: a 3 bit action type followed by a 5 bit [http://wiki.tockdom.com/wiki/List_of_Identifiers#Items object number] for the item involved. | |
− | |||
− | |||
− | |||
− | |||
{| class="textbox grid sortable alt" | {| class="textbox grid sortable alt" | ||
− | |+ | + | |+ Action Types |
− | ! | + | ! Id!! Name !! Description |
|- | |- | ||
− | | align=center | | + | | align=center | 0 |
− | + | | align=center | NONE | |
− | | align=center | | + | | The neutral value for unused slots. Always paired with object id 0x10 |
− | | The neutral value for unused slots. | ||
|- | |- | ||
− | | align=center | | + | | align=center | 1 |
− | |||
| align=center | USED | | align=center | USED | ||
− | | Mushroom | + | | Using an item, such as Lightning or a Mushroom. |
|- | |- | ||
− | | align=center | | + | | align=center | 2 |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| align=center | SHOT | | align=center | SHOT | ||
− | | | + | | Throwing an item, either forwards or backwards, such as a Green Shell or Banana. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | align=center | | + | | align=center | 3 |
− | | align=center | | + | | align=center | HIT-DRAGGED |
− | + | | Hitting the dragged item of a player (can be yourself), either with your vehicle or an item. | |
− | | | ||
|- | |- | ||
− | | align=center | | + | | align=center | 4 |
− | | align=center | | + | | align=center | HIT-FREE |
− | | | + | | Hitting any item that isn't being dragged, either with your vehicle or an item. |
− | |||
|- | |- | ||
− | | align=center | | + | | align=center | 5 |
− | | align=center | | + | | align=center | LOSE? |
− | + | | Used when a Thunder Cloud is lost, either from its timer running out or from passing it to another player | |
− | | | ||
|- | |- | ||
− | | align=center | | + | | align=center | 6 |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| align=center | ? | | align=center | ? | ||
− | | | + | | Unknown |
|- | |- | ||
− | | align=center | | + | | align=center | 7 |
− | |||
| align=center | DROP | | align=center | DROP | ||
− | | | + | | Dropping an item when hit (including ones that disappear on 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: | |
− | + | ||
− | + | {| class="textbox grid sortable alt" | |
− | + | |+ Event Data Sizes by Action Type | |
− | + | ! Id!! Size (bytes) | |
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | align=center | | + | | align=center | 1 |
− | | align=center | | + | | align=center | 3 |
− | |||
− | |||
|- | |- | ||
− | | align=center | | + | | align=center | 2 |
− | | align=center | | + | | align=center | Varies by item |
− | |||
− | |||
|- | |- | ||
− | | align=center | | + | | align=center | 3 |
− | | align=center | | + | | align=center | 20 |
− | |||
− | |||
|- | |- | ||
− | | align=center | | + | | align=center | 4 |
− | | align=center | | + | | align=center | 5 |
− | |||
− | |||
|- | |- | ||
− | | align=center | | + | | align=center | 5 |
− | | align=center | | + | | align=center | 5 |
− | |||
− | |||
|- | |- | ||
− | | align=center | | + | | align=center | 6 |
− | | align=center | | + | | align=center | 4 |
− | |||
− | |||
|- | |- | ||
− | | align=center | | + | | align=center | 7 |
− | | align=center | | + | | align=center | 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]]. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{{MKWii Network Protocol}} | {{MKWii Network Protocol}} | ||
[[category: Network Protocol|R]] | [[category: Network Protocol|R]] |
Revision as of 20:52, 9 July 2020
This pages is related to MKWii Network Protocol and describes the record type EVENT.
Template:MKWii Network Protocol RACE
The record EVENT transmits events. Events are:
- Activating an item.
- 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
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.
Id | Name | Description |
---|---|---|
0 | NONE | The neutral value for unused slots. Always paired with object id 0x10 |
1 | USED | Using an item, such as 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 a player (can be yourself), either with your vehicle or an item. |
4 | HIT-FREE | Hitting any item that isn't 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 |
7 | DROP | Dropping an item when hit (including ones that disappear on 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:
Id | Size (bytes) |
---|---|
1 | 3 |
2 | Varies by item |
3 | 20 |
4 | 5 |
5 | 5 |
6 | 4 |
7 | 20 |
Every event data starts with a 2 byte time stamp, a copy of the timer of record RACEHEADER_1.