Difference between revisions of "Piñata Vision barcode/Encoded data"
FeralKitty (talk | contribs) (Add wildcard data. Variant and wildcard data are optional fields.) |
FeralKitty (talk | contribs) (Date (date-locked cards) and payload type values identified) |
||
Line 155: | Line 155: | ||
*If the pinata won't be wearing accessories, clear the accessory flag. No further encoding needs to be done, as the optional accessory data will not be present. | *If the pinata won't be wearing accessories, clear the accessory flag. No further encoding needs to be done, as the optional accessory data will not be present. | ||
+ | == Date == | ||
+ | |||
+ | {| style="width:200px; padding:0.3em; float:right; margin-left:15px; margin-bottom:8px; border:1px solid #A3B1BF; background:#f5faff; text-align:left; font-size:95%; line-height:1.5em;" | ||
+ | |- | ||
+ | !colspan="2" style="text-align:center; background:#cee0f2; padding:0.3em; font-size:1.1em;"|'''Date''' | ||
+ | |- | ||
+ | |'''Optional:'''||Yes | ||
+ | |- | ||
+ | |'''Parent:'''||Payload type | ||
+ | |-valign="top" | ||
+ | |'''Offset:'''||0 | ||
+ | |-valign="top" | ||
+ | |'''Size:'''||9 | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | {| width=100% style="background:#f5faff; text-align:left; font-size:95%; line-height:1.5em;" | ||
+ | |- | ||
+ | !colspan="2" style="text-align:center; background:#cee0f2; padding:0.3em; font-size:1.1em;"|'''Day''' | ||
+ | |- | ||
+ | |'''Optional:'''||No | ||
+ | |- | ||
+ | |'''Parent:'''||Date | ||
+ | |- | ||
+ | |'''Offset:'''||0 | ||
+ | |- | ||
+ | |'''Size:'''||5 bits | ||
+ | |- | ||
+ | !colspan="2" style="text-align:center; background:#cee0f2; padding:0.3em; font-size:1.1em;"|'''Month''' | ||
+ | |- | ||
+ | |'''Optional:'''||No | ||
+ | |- | ||
+ | |'''Parent:'''||Date | ||
+ | |- | ||
+ | |'''Offset:'''||5 | ||
+ | |- | ||
+ | |'''Size:'''||4 bits | ||
+ | |} | ||
+ | |- | ||
+ | |colspan="2" style="text-align:center;"|'''See also''' | ||
+ | |- | ||
+ | |colspan="2"|[[#Payload type|Payload type]] | ||
+ | |} | ||
+ | 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. | ||
+ | |||
+ | === Decoding === | ||
+ | |||
+ | * ? | ||
+ | |||
+ | === Encoding === | ||
+ | |||
+ | * Day is encoded as a 5-bit value from 1 to 31. | ||
+ | * Month is encoded as a 4-bit value from 1 to 12. | ||
+ | |||
+ | <div style="clear:right;"></div> | ||
== Name == | == Name == | ||
Line 247: | Line 305: | ||
|} | |} | ||
− | |||
<div style="clear:right;"></div> | <div style="clear:right;"></div> | ||
== Name flag == | == Name flag == | ||
Line 283: | Line 340: | ||
*If the pinata won't have a name, clear the name flag. No further encoding needs to be done, as the optional name data will not be present. | *If the pinata won't have a name, clear the name flag. No further encoding needs to be done, as the optional name data will not be present. | ||
+ | |||
+ | == Payload type == | ||
+ | |||
+ | {| style="width:200px; padding:0.3em; float:right; margin-left:15px; margin-bottom:8px; border:1px solid #A3B1BF; background:#f5faff; text-align:left; font-size:95%; line-height:1.5em;" | ||
+ | |- | ||
+ | !colspan="2" style="text-align:center; background:#cee0f2; padding:0.3em; font-size:1.1em;"|'''Payload type''' | ||
+ | |- | ||
+ | |'''Optional:'''||Yes | ||
+ | |- | ||
+ | |'''Parent:'''||PlaceTag | ||
+ | |-valign="top" | ||
+ | |'''Offset:'''||Varies | ||
+ | |-valign="top" | ||
+ | |'''Size:'''||5 bits | ||
+ | |- | ||
+ | |colspan="2" style="text-align:center;"|'''See also''' | ||
+ | |- | ||
+ | |colspan="2"|[[#?|?]] | ||
+ | |} | ||
+ | |||
+ | The payload type indicates what type of optional data follows. | ||
+ | |||
+ | A card can contain multiple payload type fields (such as for a pinata that's both a variant and a wildcard). | ||
+ | |||
+ | === Decoding === | ||
+ | |||
+ | *? | ||
+ | |||
+ | === Encoding === | ||
+ | |||
+ | *? | ||
+ | |||
+ | The payload type is a 5-bit value. | ||
+ | |||
+ | {| border="1" class="pii_species_variants" style="text-align:center" | ||
+ | |- | ||
+ | !Payload type!!Payload size!!align="left"|Payload/description | ||
+ | |- | ||
+ | |00000||4||align="left"|0000 appears to indicate that no further optional card data follows. Bits that follow 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. | ||
+ | |- | ||
+ | |00000||3+||align="left"|Non-zero accessory count (followed by accessory items) | ||
+ | |- | ||
+ | |00010||3+||align="left"|Non-zero accessory count (followed by accessory items) | ||
+ | |- | ||
+ | |00011||9||align="left"|(Starting) date data | ||
+ | |- | ||
+ | |00100||9||align="left"|(Ending) date data | ||
+ | |- | ||
+ | |01001||2||align="left"|Wildcard data | ||
+ | |- | ||
+ | |01010||4||align="left"|Variant data | ||
+ | |- | ||
+ | |} | ||
== Use cost == | == Use cost == |
Revision as of 00:01, 9 April 2011
Contents
Common data
Card type
Card type | |
---|---|
Optional: | No |
Parent: | None |
Offset: | 8? |
Size: | 6 bits? |
See also | |
? |
The card type data identifies what general type of card follows.
It's not certain if the leading bits are a part of this field.
Decoding
- ?
Encoding
- ?
Card type | General type | Specific types |
---|---|---|
100001 | PlaceTag | Vision_Single_PlaceTag; Vision_Single_Blackariants; Vision_Single_GoodVariants; player-created cards |
100010 | UnlockTag | Vision_Single_UnlockTag_ZZTrickStick |
110000 | ? | PesterPV, Pester2PV, HelpersPV, WINTER_CARD |
110100 | Reference | Vision_Single_View_Appear_Cutscene_Forced; Vision_Single_View_Mate_Cutscene_Forced; Vision_Single_ViewTagInJournal_Animal; Vision_Single_UnlockArt_Animal; Vision_Single_UnlockArt_Helper; Vision_Single_UnlockArt_All; Vision_Single_Learn_Primary_Trick; Vision_Single_Learn_Secondary_Trick; Vision_Single_Perform_Primary_Trick; Vision_Single_Perform_Secondary_Trick; Vision_Single_View_House_Interior_If_Present; Vision_Single_View_House_Interior_Forced |
110110 | Callback | Vision_Single_LockedDinoCard; Vision_Single_SparseCallback; Vision_Single_TimeWarp; Vision_Single_Weather; terrain; romance music |
111011 | ? | CouponPV |
001 PlaceTag
Accessory
Accessory | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Optional: | Yes | ||||||||||||||||||||
Parent: | PlaceTag | ||||||||||||||||||||
Offset: | Varies 36 (?) ?? (?) | ||||||||||||||||||||
Size: | Varies 3 + 8 x count | ||||||||||||||||||||
| |||||||||||||||||||||
See also | |||||||||||||||||||||
Accessory flag |
This optional accessory data is present if the accessory flag is set.
Its offset appears to vary, based on other optional data such as pinata name.
The accessory items are 8-bit values, but do not match up with (normalized) PlaceTag accessory IDs.
Decoding
- Read the accessory count, then read that number of 8-bit values that follow to determine what accessories a pinata is wearing.
Encoding
- ?
A sample of encodings for accessory items. More cards need to be scanned (or generated) to identify all the possible accessory item values.
Item | Description |
---|---|
24 | Yee-Haw Spurs |
91 | Cook Hat |
122 | Reading Glasses |
167 | Tail Bow |
Accessory flag
Accessory flag | |
---|---|
Optional: | No |
Parent: | PlaceTag |
Offset: | 30 |
Size: | 1 bit |
See also | |
Accessory |
The accessory flag indicates whether or not optional accessory data is encoded on the card. The accessory flag is present for all PlaceTag cards, even if the item being placed is not a pinata.
Decoding
- If the accessory flag is clear, no optional accessory data is encoded on the card
- If the accessory flag is set, accessory data is encoded on the card. The inclusion of this optional data appears to shift offsets for fields that follow.
Encoding
- If the pinata will be wearing accessories, set the accessory flag, and encode the accessory details.
- If the pinata won't be wearing accessories, clear the accessory flag. No further encoding needs to be done, as the optional accessory data will not be present.
Date
Date | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Optional: | Yes | ||||||||||||||||||||
Parent: | Payload type | ||||||||||||||||||||
Offset: | 0 | ||||||||||||||||||||
Size: | 9 | ||||||||||||||||||||
| |||||||||||||||||||||
See also | |||||||||||||||||||||
Payload type |
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.
Decoding
- ?
Encoding
- Day is encoded as a 5-bit value from 1 to 31.
- Month is encoded as a 4-bit value from 1 to 12.
Name
Name | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Optional: | Yes | ||||||||||||||||||||||||||||||
Parent: | PlaceTag | ||||||||||||||||||||||||||||||
Offset: | Varies 41 (AF=0) ?? (?) | ||||||||||||||||||||||||||||||
Size: | Varies 5 x (length + 1) | ||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
See also | |||||||||||||||||||||||||||||||
Name flag |
This optional pinata name data is present if the name flag is set.
Its offset appears to vary, based on other optional data such as accessories.
Unlike the accessory data, it does not contain a count (length) preceeding the name characters. The name is null-terminated (NUL).
Decoding
- ?
The game likely auto-capitalizes the name, by capitalizing the first letter of the name and any letter that follows a space (SP) character.
Encoding
- ?
The name character set is 5-bit, with no shift bit to distinguish between upper and lower case.
Char | Bits | Char | Bits | Char | Bits | Char | Bits |
---|---|---|---|---|---|---|---|
NUL | 00000 | G/g | 01000 | O/o | 10000 | W/w | 11000 |
SP | 00001 | H/h | 01001 | P/p | 10001 | X/x | 11001 |
A/a | 00010 | I/i | 01010 | Q/q | 10010 | Y/y | 11010 |
B/b | 00011 | J/j | 01011 | R/r | 10011 | Z/z | 11011 |
C/c | 00100 | K/k | 01100 | S/s | 10100 | ? | 11100 |
D/d | 00101 | L/l | 01101 | T/t | 10101 | ? | 11101 |
E/e | 00110 | M/m | 01110 | U/u | 10110 | ? | 11110 |
F/f | 00111 | N/n | 01111 | V/v | 10111 | ? | 11111 |
Name flag
Name flag | |
---|---|
Optional: | No |
Parent: | PlaceTag |
Offset: | Varies 39 (AF=0) ?? (?) |
Size: | 1 bit |
See also | |
Name |
The name flag indicates whether or not a pinata name is present.
Its offset appears to vary, based on other optional data such as accessories.
Decoding
- If the name flag is clear, no optional name data is encoded on the card.
- If the name flag is set, name data is encoded on the card. The inclusion of this optional data appears to shift offsets for fields that follow.
Encoding
- If the pinata will have a name, set the name flag, and encode the name data.
- If the pinata won't have a name, clear the name flag. No further encoding needs to be done, as the optional name data will not be present.
Payload type
Payload type | |
---|---|
Optional: | Yes |
Parent: | PlaceTag |
Offset: | Varies |
Size: | 5 bits |
See also | |
? |
The payload type indicates what type of optional data follows.
A card can contain multiple payload type fields (such as for a pinata that's both a variant and a wildcard).
Decoding
- ?
Encoding
- ?
The payload type is a 5-bit value.
Payload type | Payload size | Payload/description |
---|---|---|
00000 | 4 | 0000 appears to indicate that no further optional card data follows. Bits that follow 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. |
00000 | 3+ | Non-zero accessory count (followed by accessory items) |
00010 | 3+ | Non-zero accessory count (followed by accessory items) |
00011 | 9 | (Starting) date data |
00100 | 9 | (Ending) date data |
01001 | 2 | Wildcard data |
01010 | 4 | Variant data |
Use cost
Use cost | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Optional: | No | ||||||||||||||||||||
Parent: | PlaceTag | ||||||||||||||||||||
Offset: | Varies 41 (AF=0) | ||||||||||||||||||||
Size: | 10 bits | ||||||||||||||||||||
| |||||||||||||||||||||
See also | |||||||||||||||||||||
Use cost flag, accessory flag |
The use cost holds the cost to scan the card (if the card is not flagged as free to scan).
Its offset appears to vary, based on other optional data such as accessory information.
Decoding
- If the use cost flag is clear, the card is free to scan, and the (non-zero) use cost data should be ignored.
- If the use cost flag is set, 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.
Encoding
- If the card has a cost to scan, ensure that the use cost flag is set, and 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.
- If the card is free to scan, ensure that the use cost flag is clear, and store an ID-derived non-zero value in the use cost to possibly help mask a noticable barcode pattern due to a run of 0s occurring within the encoded data.
Bit(s) | Value to encode |
---|---|
V6 to V3 | 0 |
V2 | 1 |
V1 | !ID11 |
V0 | !ID10 |
M2 | ID9 |
M1 | ID8 |
M0 | ID7 |
Use cost flag
Use cost flag | |
---|---|
Optional: | No |
Parent: | PlaceTag |
Offset: | 35 |
Size: | 1 bit |
See also | |
Use cost |
The use cost flag indicates whether or not there is a cost to scan the card.
Decoding
- If the use cost flag is clear, the card is free to scan (and the non-zero encoded use cost should be ignored).
- If the use cost flag is set, the cost to scan the card is encoded in the use cost.
Encoding
- If the card will have a cost to scan, set the use cost flag, and encode the use cost.
- If the card will be free to scan, clear the use cost flag, and store an ID-derived non-zero value in the use cost.
It's uncertain whether the game ignores the use cost data for free cards, or checks it to see if it was encoded properly.
Variant
Variant | |
---|---|
Optional: | Yes |
Parent: | PlaceTag |
Offset: | Varies ?? (NF=1) |
Size: | 4 bits |
See also | |
Use cost flag, accessory flag, name flag |
This optional variant data is present if the pinata is a variant. Its presence appears to be indicated by a 5-bit value of '01010' (10) preceeding the variant data.
The variant identifies the variant color of the pinata being scanned.
Its offset appears to vary, based on other optional data such as pinata name, accessories, or use cost. It appears to start 5 bits after the name, accessory, or use cost data.
Decoding
- 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.)
Encoding
- 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.
Description | Color | Encoded value |
---|---|---|
GoodVariants | Orange | 2 |
GoodVariants | Red | 3 |
GoodVariants | Purple | 4 |
GoodVariants | Light blue | 5 |
In-game variant 1 | Blue | 6 |
In-game variant 2 | Pink | 7 |
In-game variant 3 | Orange | 8 |
GoodVariants | Light pink | 9 |
Blackariants | Black | 15 |
- 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.
Wildcard
Wildcard | |
---|---|
Optional: | Yes |
Parent: | PlaceTag |
Offset: | Varies ?? (NF=1) |
Size: | 2 bits |
See also | |
Use cost flag, accessory flag, name flag |
This optional wildcard data is present if the pinata is a wildcard. Its presence appears to be indicated by a 5-bit value of '01001' (9) preceeding the wildcard data.
The wildcard identifies the trait of the pinata being scanned.
Its offset appears to vary, based on other optional data such as pinata name, accessories, or use cost. It appears to start 5 bits after the name, accessory, or use cost data.
Decoding
- ?
Encoding
- Known wildcards have a trait value between 1 and 3.
100 Reference
Appear Mate subtype
Appear Mate subtype | |
---|---|
Optional: | No |
Parent: | Reference (AM) |
Offset: | 36 |
Size: | 1 bit |
See also | |
? |
The Appear Mate subtype differentiates between View Appear Cutscene and View Mate Cutscene cards (which both share the same card type).
Decoding
- 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.
Encoding
- ?
Journal UnlockArt subtype
Journal UnlockArt subtype | |
---|---|
Optional: | No |
Parent: | Reference (JU) |
Offset: | 45 |
Size: | 1 bit |
See also | |
? |
The Journal UnlockArt subtype differentiates between ViewTagInJournal and UnlockArt cards (which both share the same card type).
Decoding
- 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.
Encoding
- ?
110 Callback
Dinosaur color
Dinosaur color | |
---|---|
Optional: | No |
Parent: | Change dinosaur |
Offset: | 37? |
Size: | 3 bits? |
See also | |
? |
The dinosaur color identifies what reskin color will be applied to the Choclodocus.
Decoding
- ?
Encoding
- ?
Type | Description |
---|---|
000 | Color 0 (blue) |
001 | Color 1 (green) |
010 | Color 2 (red) |
Terrain type
Terrain type | |
---|---|
Optional: | No |
Parent: | Terrain |
Offset: | 37 |
Size: | 3 bits |
See also | |
? |
The terrain type identifies what type of terrain will be applied to the entire garden surface.
Decoding
- ?
Encoding
- ?
Type | Description |
---|---|
000 | Dirt |
001 | Grass |
010 | Long grass |
011 | Snow |
100 | Sand |
Weather type
Weather type | |
---|---|
Optional: | No |
Parent: | Weather |
Offset: | 37 |
Size: | 3 bits |
See also | |
? |
The weather type identifies what type of weather will go into effect.
Decoding
- ?
Encoding
- ?
Type | Description |
---|---|
000 | Clear sky |
001 | Stormy |
010 | Misty |
011 | Rainbow |
100 | Cloudy |