← Back

Data Formats

Binary-to-Text

Varint

Defined the same way as it is defined in Protocol Buffers, that is:

Match Code

(Crockford Base32 encoded)

15 random bytes

The first 20 bits are overridden based on the client type:

Some custom game modes have their own prefixes.

The prefix followed by all zeroes is used for the quick join match code.

Deck Code

(Crockford Base32 encoded)

Short Form

Byte 0:

Byte 1:

Bytes 2, 5, 8, ...:

Bytes 3, 6, 9, ...:

Bytes 4, 7, 10, ...:

Long Form (v1)

Byte 0:

Remaining bytes:

Long Form (v2)

Byte 0:

Remaining bytes:

Match Recording

CosmeticData

CustomCardDef

EncodedDeck

TurnData

Game Mode Data

Since game modes and custom cards are shared using the same mechanism, game mode format versions are disjoint with custom card versions.

(base64-encoded)

GameModeField

0: Metadata

1: BannedCards

If BannedCards is present and BannedCardCount is 0, all vanilla cards are banned.

2: GameRules

Repeated:

If Rule is None, there is no value and this field ends.

Rules that have their default value are not encoded.

Rules and their default values are as follows:

3: SummonCard

Custom Card (v2+)

(base64-encoded)

SpecialField

SpecialField is defined as a 4 bit prefix followed by a payload of a defined length.

The prefix 0000 is invalid as it represents the TP field, which is after the last SpecialField.

Currently defined SpecialField types:

0001: ExtraTribe

Allows a card to have more than 2 tribes.

All tribes on a card must be unique, and if ExtraTribe is present, no tribe can be none (15).

EffectDef

Effect 0: Flavor Text

Defined flags:

Data:

Effect 1: Stat

Defined flags:

Data:

Effect 2: Empower

Defined flags:

Data:

Effect 3: Summon

Defined flags:

Data:

Effect 4: Heal

Defined flags:

Data:

Effect 5: TP

Defined flags:

Data:

Effect 6: Numb

Defined flags:

Data:

When decoding version 2, act as if the effect has the generic and opponent flags set and is targeting Rank: Attacker, Tribe: None.

Effect 128: Card (Condition)

Defined flags:

Data:

Effect 129: Limit (Condition)

Defined flags:

Data:

Effect 130: Winner (Condition)

Defined flags:

Data:

Effect 131: Apply (Condition)

Defined flags:

Data:

Effect 132: Coin (Condition)

Defined flags:

Data:

Effect 133: HP (Condition)

Defined flags:

Data:

Effect 134: Stat (Condition)

Defined flags:

Data:

PackedRankTribe

CustomTribeData

Custom Card (v1, deprecated)

(base64-encoded)

Effect Definition

For all effects:

0: ATK (static)

1: DEF (static)

2: ATK (static, once per turn)

3: ATK+n

4: DEF+n

5: Empower (card)

6: Empower (Tribe)

7: Heal

8: Lifesteal

9: Numb

10: Pierce

11: Summon

12: Summon Rank

13: Summon Tribe

14: Unity

(if Tribe is (none), replace this effect with ATK when decoding)

15: TP

16: Summon as Opponent

17: Multiply Healing

18: Flavor Text

128: Coin

129: If Card

130: Per Card

131: If Tribe

132: VS Tribe

133: If Stat

134: Setup

135: Limit

136: VS Card

137: If Rank

138: VS Rank

139: If Win

140: If Tie

141: If Stat (after modifiers)

142: VS Stat

143: VS Stat (after modifiers)

144: If HP

145: Per Tribe

146: Per Rank

147: VS HP

Condition Flags

Termacade Recording

Game Rule Overrides

Repeated:

TODO: Document rules for each game

Game Data: Shared (v1)

Repeated:

The recording starts on tick 0. Game logic starts on tick 1. This means that the first tick of input is dropped. The reference implementation records tick 0's input as all buttons released.

Game Data: Mite Knight (v0)

Repeated:

Game Data: Flower Journey (v0)

Repeated:

Appendix A: Card Indices

This section contains spoilers.

Global

Boss

Mini-Boss

Enemy

Tribe