---
title: "Packet 13: SetClassLoadout"
description: "Submits a class, equipment list, prefab selection, and optional UGC tools as one life-boundary loadout transaction."
canonical: "https://aosplay.net/protocol-168/packets/13"
markdown: "https://aosplay.net/docs/protocol-168/packets/13.md"
last_updated: "2026-07-16"
protocol: "Ace of Spades Battle Builder 168"
packet_id_decimal: "13"
packet_id_hex: "0x0D"
direction: "C→S"
family: "Players"
implementation_status: "Handled"
evidence: "Live-verified"
wire_size: "Variable: 6 + L + ΣS + optional (1 + U)"
---

# Packet 13: SetClassLoadout

> Submits a class, equipment list, prefab selection, and optional UGC tools as one life-boundary loadout transaction.

- **Decimal ID:** 13
- **Hex ID:** 0x0D
- **Direction:** C→S
- **Family:** Players
- **Status:** Handled
- **Evidence:** Live-verified
- **Wire size:** Variable: 6 + L + ΣS + optional (1 + U)

## Implementation note

The bounded runtime decoder accepts exactly one observed variation: a missing zero UGC-count tail. It rejects malformed counts and unterminated strings.

## Exact wire layout

The application packet ID is the first byte. The remaining rows are in decode order. Byte sizes exclude ENet headers, wrapper prefixes, LZF chunk framing, and compression effects.

| # | Field | Encoding | Bytes | Purpose | Condition |
| ---: | --- | --- | ---: | --- | --- |
| 0 | `packet_id` | u8 | 1 | Always 13 (0x0D). | — |
| 1 | `player_id` | u8 | 1 | Compact player-slot identifier. | — |
| 2 | `class_id` | u8 | 1 | Selected character class identifier. | — |
| 3 | `instant` | boolean u8 | 1 | Boolean-like byte requesting immediate application. | — |
| 4 | `loadout_count` | u8 | 1 | L: number of one-byte tool IDs. | — |
| 5 | `loadout[]` | L × u8 | L | Ordered equipment/tool IDs. | — |
| 6 | `prefab_count` | u8 | 1 | Number of NUL-terminated prefab names. | — |
| 7 | `prefabs[]` | repeated NUL strings | ΣS | Selected prefab names; each consumes its UTF-8 length plus one terminator byte. | — |
| 8 | `ugc_tool_count` | u8 | 1 | U: optional trailing count; retail may omit it when zero. | Present only when bytes remain. |
| 9 | `ugc_tools[]` | U × u8 | U | UGC tool IDs. | Only after ugc_tool_count. |

## Encoding conventions

- `LE` means least-significant byte first.
- `fixed16` is two-byte sign-magnitude at 1/64 precision.
- `orientation16` uses the measured 1/8192 orientation mapping.
- NUL strings consume their encoded byte length plus one `00` terminator.
- Counted arrays repeat immediately in the documented order.

## Related resources

- [HTML packet page](https://aosplay.net/protocol-168/packets/13)
- [Complete packet catalog](https://aosplay.net/protocol-168/packets)
- [Packet catalog in Markdown](https://aosplay.net/docs/protocol-168/packets.md)
- [Protocol 168 guide](https://aosplay.net/protocol-168)
