Piñata Vision barcode/Encoded data
- 1 Overview
- 2 Encoded data
- 3 001 PlaceTag
- 4 100 Reference
- 5 110 Callback
Encoded data are packed bits of information, such as a piñata's name, its variant color, or the cost to use (scan) the card.
Some of this data is optional. For example, cards that are freely reusable do not have a use cost encoded on the card. Likewise, piñatas that aren't named do not have an encoded name on the card.
Other data only exists on certain types of cards. For example, a date-locked card would have date data. Likewise, a card which wasn't date-locked would not have an encoded date at all.
Organization of encoded data
If a card can contain all different kinds of data (some optional, some not), how does the game recognize what specific type of information is encoded on a particular card?
It does this by encoding the type of data (referred to as the payload type), in addition to the data itself. For example, this illustration shows a card with three types of information -- ID, name, and use cost -- each followed by a value for that particular payload type:
Each card, regardless of how little (or how much) is encoded on that card, uses that same payload type:data payload type:data format. The game can easily identify each piece of information on the card, first by examining the payload type (to learn what type of data follows), then processing the payload (the actual encoded data).
Precedence of payload types
Beyond the Start of data and End of data information, it's unknown if the remaining order matters or not.
The general order (for PlaceTag) cards seem to be:
- Start of data
- Accessory (optional)
- Start date (optional)
- End date (optional)
- Reuse (optional)
- Name or cost (optional)
- Wildcard (optional)
- Variant (optional)
- End of data
The payload type indicates the type of data that immediately follows.
A card can contain several payload types (such as for a pinata that's both a variant and a wildcard).
The payload type is a 5-bit value.
|Payload type||Payload size||Payload||Description|
|00000||4||0000||End of data. No further encoded data follows.
Remaining bits pad the data to a barcode row boundary. Padding is filled with specific bits copied from the encoded data, to help obscure what little data may be encoded within the last row.
|0001||Start of data. This payload marks the start of the encoded data.
It's also found later in certain cards, such as date-locked cards. (They drop a special pinata on that date, or a normal pinata if scanned on any other day. E.g., Start of data, Date, Special pinata, Start of data, Normal pinata, End of data.)
It can also be found later in accessorized (themed) cards, with each successive ID specifying an accessory. Using the 11101 (Accessory) payload type is preferred to this method, as its data takes less space (and also supports encoding accessory colors).
|00010||12||Trick stick reskin ID data
(PlaceTag IDs for reskins are from 2207 to 2218.)
|00011||12||(Starting) date data|
|00100||12||(Ending) date data|
|00101||5+?||? No apparent difference with pinatas or eggs, with or without this payload type. (No existing cards use this payload type.)|
|00110||5+?||? No apparent difference with pinatas or eggs, with or without this payload type. (No existing cards use this payload type.)|
|00111||5+||Name data, variable-length.
Each character in the name takes 5 bits, plus 5 trailing 00000 bits that (NUL) terminate the name, making the payload size 5 x (name length + 1).
|01011||3||nn0||Normal size, will not cocoon|
|nn1||Small size, will cocoon|
|01100||?||? Flashes red. (No existing cards use this payload type.)|
|01101||?||? Flashes red. (No existing cards use this payload type.)|
|01110||8||? No apparent difference with pinatas or eggs, with or without this payload type. (No existing cards use this payload type.)|
Dirt = 0, Grass, Long Grass, Snow, Sand
Ruffian1 = 1, Ruffian2, Ruffian3, Ruffian4, Pester, Yellow card (Ruffians), Red card (Pester and Ruffians)
|0000000100nopqrs||Player-created plant card
n = size (0 = sprout, 1 = fully grown)
o = ? (set to 0)
pqr = fertilization (apple tree: 000 = 0 extra branches, 100/101 = 1 extra branch, 001/010/011/110/111 = 2 extra branches)
s = water (0 = will need water, 1 = watered)
Blue = 0, Green, Red, Elite Neon
|1111000000000000||? (One card, labeled HelpersPV)|
|10010||3||Weather type data|
|10011||8||Weather duration data|
|10100||12||ID data (subject for actions like learn/perform trick, unlock art, view tag in journal, view cutscene)|
Typically encoded on cards from Rare that have no use cost.
|00001||Not immediately reusable
Typically encoded on player-created cards (which have a use cost)
|11000||10||Use cost data|
|11001||4?||Related to romance music track?|
|11010||38?||Romance music (jukebox) track|
|11011||?||? (1 card - Coupon)|
|11101||16+||Accessory data, variable-length.
Color accessory count, color accessory items, accessory count, accessory items.
Each count is 4 bits. Each color accessory item takes 12 bits (an 8-bit item value followed by a 4-bit color value). Other accessory items take 8 (item) bits.
This makes the total payload size 4 + (12 x color count) + 4 + (8 x count).
Sample encoded data
The encoded data for the 02-GoobaaPV card looks like this:
|00000||0001 (Start of data)|
|00001 (ID)||108 (Goobaa)|
|11101 (Accessory)||3 (items) 43 103 80|
|00000||0000 (End of data)|
4 + (12 x color count) + 4 + (8 x count)
The accessory items are normalized 8-bit values which correspond to PlaceTag accessory IDs. (E.g., item 1 is PlaceTag ID 1905, item 2 is 1906, and so on.)
- Read a count, then read that number of 12- or 8-bit values that follow to determine what (color) accessories a pinata is wearing.
A sample of encodings for accessory items. Other item values can be obtained (by subtracting 1904) from the accessory's PlaceTag ID.
|1||Retro Disco Wig||1905|
|184-255||No such accessory|
1If an accessory was its default color (or had no color choices), it would be encoded in the second half of the accessory payload, since no 4-bit color value would need to be encoded.
Sample encoded data
Accessory data for a pinata wearing two items (Non-Resident Scarf, and Von Ghoul Helmet):
|Color count||Count||Item 1||Item 2|
The same items, if the Non-Resident Scarf is red:
|Color count||Item 1||Item 1 color||Count||Item 2|
This optional date data is present if the card is date-locked.
Two sets of dates are encoded -- a start date and an end date -- to provide a date-locked interval when the card will scan as a special pinata. Both sets of dates appear to be required, even if the start date and end date are for the same date.
The card appears to scan with options (e.g., name, accessories, wildcard trait, variant color) if the game date is within the date-locked interval, and without options (i.e., a normal pinata) if the game date is outside the date-locked interval.
- Day is encoded as a 5-bit value from 1 to 31.
- Month is encoded as a 4-bit value from 1 to 12.
5 x (length + 1)
This data is present if the pinata has an encoded name.
Unlike the accessory data, it does not contain a count (length) preceeding the name characters. The name is null-terminated (NUL).
The game likely auto-capitalizes the name, by capitalizing the first letter of the name and any letter that follows a space (SP) character.
The name character set is 5-bit, with no shift bit to distinguish between upper and lower case.
The use cost holds the cost to scan the card (if the card is not flagged as free to scan).
- Use the encoded use cost as the cost to scan the card.
To obtain the use cost, multiply the value by the order of magnitude (power of 10). For example, a use cost value of 18 and a use cost magnitude of 2 would be a use cost of 18 x 102 = 18 x 100 = 1800.
- If the card will have a chocolate coin cost per scan, encode the use cost value and magnitude.
There does seem to be some variance on how a use cost of 1000 is encoded. Some cards have it stored as 100 x 10, while others have it encoded as 10 x 100. It's uncertain whether the representations are interchangeable or not, although a particular representation may affect other fields such as a checksum.
This optional variant data is present if the pinata is a variant.
The variant identifies the variant color of the pinata being scanned.
- Outside of value 15, which is always black, it's not possible to determine whether a value is a specific in-game variant color, or even distinguish between in-game and other variant colors. (E.g., 2 may be a GoodVariants color for one species, but in-game variant color 1 for another species.)
- Lookup the value for the color to be encoded onto the card.
- Known GoodVariants have a variant value between 2 and 10 (but values vary between species).
- In-game variants have a (non-conflicting) variant value between 2 and 9 (and values also vary between species).
- Known Blackariants have a variant value of 15.
|In-game variant 1||Blue||6|
|In-game variant 2||Pink||7|
|In-game variant 3||Orange||8|
- Note that GoodVariants colors and in-game variant colors differ (slightly) so Quackberry variant color 2 is not the same orange as Quackberry variant color 8.
This optional wildcard data is present if the pinata is a wildcard.
The wildcard identifies the trait of the pinata being scanned.
- Known wildcards have a trait value between 1 and 3.
Appear Mate subtype
|Appear Mate subtype|
The Appear Mate subtype differentiates between View Appear Cutscene and View Mate Cutscene cards (which both share the same card type).
- If the Appear Mate subtype is 0(?), the card is a View Appear Cutscene card.
- If the Appear Mate subtype is 1(?), the card is a View Mate Cutscene card.
Journal UnlockArt subtype
|Journal UnlockArt subtype|
The Journal UnlockArt subtype differentiates between ViewTagInJournal and UnlockArt cards (which both share the same card type).
- If the Journal UnlockArt subtype is 0(?), the card is an UnlockArt card.
- If the Journal UnlockArt subtype is 1(?), the card is a ViewTagInJournal card.
The dinosaur color identifies what reskin color will be applied to the Choclodocus.
|000||Color 0 (blue)|
|001||Color 1 (green)|
|010||Color 2 (red)|
|011||Color 3 (black/neon green)|
The terrain type identifies what type of terrain will be applied to the entire garden surface.
The weather type identifies what type of weather will go into effect.
- Weather types 5 through 7 are invalid values.