---
title: "Packet 22: CreateAmbientSound"
description: "Registers a map-owned ambient controller. Empty point lists create a global bed; authored points create local emitters."
canonical: "https://aosplay.net/protocol-168/packets/22"
markdown: "https://aosplay.net/docs/protocol-168/packets/22.md"
last_updated: "2026-07-16"
protocol: "Ace of Spades Battle Builder 168"
packet_id_decimal: "22"
packet_id_hex: "0x16"
direction: "S→C"
family: "Audio"
implementation_status: "Sent"
evidence: "Live-verified"
wire_size: "Variable: 3 + name + 6P bytes"
---

# Packet 22: CreateAmbientSound

> Registers a map-owned ambient controller. Empty point lists create a global bed; authored points create local emitters.

- **Decimal ID:** 22
- **Hex ID:** 0x16
- **Direction:** S→C
- **Family:** Audio
- **Status:** Sent
- **Evidence:** Live-verified
- **Wire size:** Variable: 3 + name + 6P bytes

## Implementation note

Must precede PlayAmbientSound (24) with the same loop ID.

## 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 22 (0x16). | — |
| 1 | `name` | NUL-terminated UTF-8 string | N + 1 | Validated retail sound asset name. | — |
| 2 | `loop_id` | u8 | 1 | loop id value. | — |
| 3 | `point_count` | u8 | 1 | P: emitter point count. | — |
| 4 | `points[]` | P × 3 × i16 LE | 6P | Raw signed-short X/Y/Z emitter coordinates. | — |

## 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/22)
- [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)
