Difference between revisions of "Piñata Vision barcode/Encoded data"

From PinataIsland.info, the Viva Piñata wiki
Jump to: navigation, search
("Reusable" payload? Weather types 5-7 are invalid values.)
(Add data for type 10000/0000000100nnnnnn (plant growth, fertilization, water))
 
(15 intermediate revisions by the same user not shown)
Line 32: Line 32:
 
* Start date (optional)
 
* Start date (optional)
 
* End date (optional)
 
* End date (optional)
 +
* Reuse (optional)
 
* Name or cost (optional)
 
* Name or cost (optional)
 
* Wildcard (optional)
 
* Wildcard (optional)
Line 86: Line 87:
 
|-
 
|-
 
|00001||12||align="left" colspan="2"|ID data
 
|00001||12||align="left" colspan="2"|ID 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?||align="left" colspan="2"|Trick stick reskin
+
|00010||12||align="left" colspan="2"|Trick stick reskin ID data
 +
 
 +
(PlaceTag IDs for reskins are from 2207 to 2218.)
 
|-
 
|-
 
|00011||12||align="left" colspan="2"|(Starting) date data
 
|00011||12||align="left" colspan="2"|(Starting) date data
 
|-
 
|-
 
|00100||12||align="left" colspan="2"|(Ending) date data
 
|00100||12||align="left" colspan="2"|(Ending) date data
 +
|-
 +
|00101||5+?||align="left" colspan="2"|?  No apparent difference with pinatas or eggs, with or without this payload type.    (No existing cards use this payload type.)
 +
|-
 +
|00110||5+?||align="left" colspan="2"|?  No apparent difference with pinatas or eggs, with or without this payload type.    (No existing cards use this payload type.)
 
|-
 
|-
 
|00111||5+||align="left" colspan="2"|Name data, variable-length.
 
|00111||5+||align="left" colspan="2"|Name data, variable-length.
Line 97: Line 106:
 
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).
 
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).
 
|-
 
|-
|01000||24||align="left" colspan="2"|Gamertag data
+
|01000||30||align="left" colspan="2"|Gamertag data
 
|-
 
|-
 
|01001||2||align="left" colspan="2"|Wildcard data
 
|01001||2||align="left" colspan="2"|Wildcard data
Line 103: Line 112:
 
|01010||4||align="left" colspan="2"|Variant data
 
|01010||4||align="left" colspan="2"|Variant data
 
|-
 
|-
|01011||3||align="left" colspan="2"|? (3 cards)
+
|rowspan="2"|01011||rowspan="2"|3||nn0||align="left" |Normal size, will not cocoon
 +
|-
 +
|nn1||align="left" |Small size, will cocoon
 +
|-
 +
|01100||?||align="left" colspan="2"|? Flashes red.  (No existing cards use this payload type.)
 +
|-
 +
|01101||?||align="left" colspan="2"|? Flashes red.  (No existing cards use this payload type.)
 +
|-
 +
|01110||8||align="left" colspan="2"|? No apparent difference with pinatas or eggs, with or without this payload type.    (No existing cards use this payload type.)
 +
|-
 +
|01111||?||align="left" colspan="2"|?  No apparent difference with pinatas or eggs, with or without this payload type.    (No existing cards use this payload type.)
 +
|-
 +
|rowspan="18"|10000||rowspan="18"|16||0000000000100nnn||align="left"|Terrain
 +
 
 +
Dirt = 0, Grass, Long Grass, Snow, Sand
 +
|-
 +
|0000000001000nnn||align="left"|SparseCallback_Send_in_Ruffian
 +
 
 +
Ruffian1 = 1, Ruffian2, Ruffian3, Ruffian4, Pester, Yellow card (Ruffians), Red card (Pester and Ruffians)
 +
|-
 +
|0000000001010001||align="left"|UnlockArt_Animal, UnlockArt_Helper
 +
|-
 +
|0000000001010011||align="left"|ViewTagInJournal_Animal
 +
|-
 +
|0000000100nopqrs||align="left"|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)
 +
|-
 +
|0000001100001001||align="left"|SparseCallback_Set_player_credits_balance_to_1000000000 (10^9)
 +
|-
 +
|0000010100000001||align="left"|Learn_Primary_Trick
 +
|-
 +
|0000010100000010||align="left"|Learn_Secondary_Trick
 +
|-
 +
|0000010100000100||align="left"|Perform_Primary_Trick
 +
|-
 +
|0000010100001000||align="left"|Perform_Secondary_Trick
 +
|-
 +
|0000011110101010||align="left"|View_Mate_Cutscene_Forced
 +
|-
 +
|0000100100000100||align="left"|SparseCallback_Adjust_player_credits_balance_by_10000 (10^4)
 +
|-
 +
|0000100110000100||align="left"|SparseCallback_Adjust_player_credits_balance_by_-10000 (10^4)
 +
|-
 +
|0000101110101010||align="left"|View_Appear_Cutscene_Forced
 +
|-
 +
|0000110101010101||align="left"|View_House_Interior_If_Present
 
|-
 
|-
|10000||?||align="left" colspan="2"|? (4 cards - Pester, Pester2, Helpers, Winter)
+
|0000110110101010||align="left"|View_House_Interior_Forced
 +
|-
 +
|00010011000000nn||align="left"|SparseCallback_Change_dinosaur_to_colour
 +
 
 +
Blue = 0, Green, Red, Elite Neon
 +
|-
 +
||1111000000000000||align="left"|? (One card, labeled HelpersPV)
 
|-
 
|-
 
|10001||4||align="left" colspan="2"|Timewarp data
 
|10001||4||align="left" colspan="2"|Timewarp data
Line 113: Line 180:
 
|10011||8||align="left" colspan="2"|Weather duration data
 
|10011||8||align="left" colspan="2"|Weather duration data
 
|-
 
|-
|10100||?||align="left" colspan="2"|Sparse callback data? (Actions like learn/perform trick, unlock art, view tag in journal, view cutscenes)
+
|10100||12||align="left" colspan="2"|ID data (subject for actions like learn/perform trick, unlock art, view tag in journal, view cutscene)
 +
|-
 +
|10101||8+?||align="left" colspan="2"|?  No apparent difference with pinatas or eggs, with or without this payload type.    (No existing cards use this payload type.)
 +
|-
 +
|rowspan="2"|10110||rowspan="2"|5||00000||align="left"|Immediately reusable
 +
 
 +
Typically encoded on cards from Rare that have no use cost.
 
|-
 
|-
|rowspan="2"|10110||rowspan="2"|5||00000||align="left"|Immediately reusable? (plus no use cost payload)
+
|00001||align="left"|Not immediately reusable
 +
 
 +
Typically encoded on player-created cards (which have a use cost)
 
|-
 
|-
|00001||align="left"|Not immediately reusable? (plus use cost payload)
+
|10111||7+?||align="left" colspan="2"|? No apparent difference with pinatas or eggs, with or without this payload type.    (No existing cards use this payload type.)
 
|-
 
|-
 
|11000||10||align="left" colspan="2"|Use cost data
 
|11000||10||align="left" colspan="2"|Use cost data
Line 127: Line 202:
 
|11011||?||align="left" colspan="2"|? (1 card - Coupon)
 
|11011||?||align="left" colspan="2"|? (1 card - Coupon)
 
|-
 
|-
|11101||3+||align="left" colspan="2"|Accessory data, variable-length.
+
|11101||16+||align="left" colspan="2"|Accessory data, variable-length.
  
3-bit accessory count (followed by 8-bit accessory items), making the payload size 3 + 8 x accessory count.
+
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).
 
|-
 
|-
 
|}
 
|}
Line 155: Line 234:
 
|}
 
|}
  
== Card type ==
+
= 001 PlaceTag =
 +
== Accessory ==
  
 
{| 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;"
 
{| 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;"|'''Card type'''
+
!colspan="2" style="text-align:center; background:#cee0f2; padding:0.3em; font-size:1.1em;"|'''Accessory'''
 
|-
 
|-
|'''Optional:'''||No
+
|'''Optional:'''||Yes
 
|-
 
|-
|'''Parent:'''||None
+
|'''Parent:'''||PlaceTag
 
|-valign="top"
 
|-valign="top"
|'''Offset:'''||8?
+
|'''Offset:'''||0
 
|-valign="top"
 
|-valign="top"
|'''Size:'''||6 bits?
+
|'''Size:'''||Varies<br />4 + (12 x color count) + 4 + (8 x count)
 
|-
 
|-
|colspan="2" style="text-align:center;"|'''See also'''
+
|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;"|'''Color count'''
 +
|-
 +
|'''Optional:'''||No
 +
|-
 +
|'''Parent:'''||Accessory
 
|-
 
|-
|colspan="2"|[[#?|?]]
+
|'''Offset:'''||0
|}
 
 
 
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 ===
 
 
 
* ?
 
 
 
{| border="1" class="pii_species_variants" style="text-align:center"
 
 
|-
 
|-
!Card type!!General type||Specific types
+
|'''Size:'''||4 bits
 
|-
 
|-
|100001||PlaceTag||align="left"|Vision_Single_PlaceTag; Vision_Single_Blackariants; Vision_Single_GoodVariants; player-created cards
+
|colspan="2"|
 +
{| width=100% style="background:#f5faff; text-align:left; font-size:95%; line-height:1.5em;"
 
|-
 
|-
|100010||UnlockTag||align="left"|Vision_Single_UnlockTag_ZZTrickStick
+
!colspan="2" style="text-align:center; background:#cee0f2; padding:0.3em; font-size:1.1em;"|'''Accessory item 1, 2, 3, ...'''
 
|-
 
|-
|110000||?||align="left"|PesterPV, Pester2PV, HelpersPV, WINTER_CARD
+
|'''Optional:'''||Yes
 
|-
 
|-
|110100||Reference||align="left"|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
+
|'''Parent:'''||Color count
 
|-
 
|-
|110110||Callback||align="left"|Vision_Single_LockedDinoCard; Vision_Single_SparseCallback; Vision_Single_TimeWarp; Vision_Single_Weather; terrain; romance music
+
|'''Offset:'''||0, 12, 24, ...
 
|-
 
|-
|111011||?||align="left"|CouponPV
+
|'''Size:'''||8 bits
|}
 
 
 
= 001 PlaceTag =
 
== Accessory ==
 
 
 
{| 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;"|'''Accessory'''
+
!colspan="2" style="text-align:center; background:#cee0f2; padding:0.3em; font-size:1.1em;"|'''Color for item 1, 2, 3, ...'''
 
|-
 
|-
 
|'''Optional:'''||Yes
 
|'''Optional:'''||Yes
 
|-
 
|-
|'''Parent:'''||PlaceTag
+
|'''Parent:'''||Color count
|-valign="top"
+
|-
|'''Offset:'''||Varies<br />36 (?)<br />?? (?)
+
|'''Offset:'''||8, 20, 32, ...
|-valign="top"
+
|-
|'''Size:'''||Varies<br />3 + 8 x count
+
|'''Size:'''||4 bits
 +
|}
 +
|}
 
|-
 
|-
 
|colspan="2"|
 
|colspan="2"|
 
{| width=100% style="background:#f5faff; text-align:left; font-size:95%; line-height:1.5em;"
 
{| 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;"|'''Accessory count'''
+
!colspan="2" style="text-align:center; background:#cee0f2; padding:0.3em; font-size:1.1em;"|'''Count'''
 
|-
 
|-
 
|'''Optional:'''||No
 
|'''Optional:'''||No
Line 226: Line 296:
 
|'''Parent:'''||Accessory
 
|'''Parent:'''||Accessory
 
|-
 
|-
|'''Offset:'''||0
+
|'''Offset:'''||4 + (12 x color count)
 +
|-
 +
|'''Size:'''||4 bits
 
|-
 
|-
|'''Size:'''||3 bits
+
|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;"|'''Accessory item 1, 2, 3, ...'''
+
!colspan="2" style="text-align:center; background:#cee0f2; padding:0.3em; font-size:1.1em;"|'''Accessory item 4, 5, 6, ...'''
 
|-
 
|-
|'''Optional:'''||No
+
|'''Optional:'''||Yes
 
|-
 
|-
|'''Parent:'''||Accessory
+
|'''Parent:'''||Count
 
|-
 
|-
|'''Offset:'''||3
+
|'''Offset:'''||0, 8, 16, ...
 
|-
 
|-
 
|'''Size:'''||8 bits
 
|'''Size:'''||8 bits
 +
|}
 
|}
 
|}
 
|-
 
|-
 
|colspan="2" style="text-align:center;"|'''See also'''
 
|colspan="2" style="text-align:center;"|'''See also'''
 
|-
 
|-
|colspan="2"|[[#Accessory flag|Accessory flag]]
+
|colspan="2"|[[#?|?]]
 
|}
 
|}
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 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.)
 
 
The accessory items are 8-bit values, but do not match up with (normalized) PlaceTag accessory IDs.
 
  
 
=== Decoding ===
 
=== Decoding ===
  
* Read the accessory count, then read that number of 8-bit values that follow to determine what accessories a pinata is wearing.
+
* Read a count, then read that number of 12- or 8-bit values that follow to determine what (color) accessories a pinata is wearing.
  
 
=== Encoding ===
 
=== Encoding ===
Line 259: Line 330:
 
*?
 
*?
  
A sample of encodings for accessory items.  More cards need to be scanned (or generated) to identify all the possible accessory item values.
+
A sample of encodings for accessory items.  Other item values can be obtained (by subtracting 1904) from the accessory's [[Piñata_Vision_barcode/ID_table|PlaceTag ID]].
  
 
{| border="1" class="pii_species_variants" style="text-align:center"
 
{| border="1" class="pii_species_variants" style="text-align:center"
 
|-
 
|-
!Item!!Description
+
!Item!!Description||PlaceTag ID
 +
|-
 +
|1||Retro Disco Wig||1905
 +
|-
 +
|24||Yee-Haw Spurs||1928
 +
|-
 +
|91||Reading Glasses||1995
 
|-
 
|-
|24||Yee-Haw Spurs
+
|96||Non-Resident Scarf||2000
 
|-
 
|-
|91||Cook Hat
+
|122||Cook Hat||2026
 
|-
 
|-
|122||Reading Glasses
+
|123||Tail Bow||2027
 
|-
 
|-
|167||Tail Bow
+
|183||Jokduri||2087
 +
|-
 +
|184-255||colspan="2"|No such accessory
 
|-
 
|-
 
|}
 
|}
  
<div style="clear:right;"></div>
+
{| border="1" class="pii_species_variants" style="text-align:center"
== Accessory flag ==
+
|+'''Color values for accessories with color choices'''
 
+
!Value!!Color!!Value!!Color
{| 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;"
+
|-
 +
|0||Default<sup>''1''</sup>||8||Light Green
 +
|-
 +
|1||Red||9||Blue
 +
|-
 +
|2||Orange||10||Cyan
 +
|-
 +
|3||Yellow||11||Violet
 
|-
 
|-
!colspan="2" style="text-align:center; background:#cee0f2; padding:0.3em; font-size:1.1em;"|'''Accessory flag'''
+
|4||Brown||12||Black
 
|-
 
|-
|'''Optional:'''||No
+
|5||Pink||13||White
 
|-
 
|-
|'''Parent:'''||PlaceTag
+
|6||Purple||14||?
|-valign="top"
 
|'''Offset:'''||30
 
|-valign="top"
 
|'''Size:'''||1 bit
 
 
|-
 
|-
|colspan="2" style="text-align:center;"|'''See also'''
+
|7||Green||15||?
 
|-
 
|-
|colspan="2"|[[#Accessory|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.
+
<sup>''1''</sup>If 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.
  
=== Decoding ===
+
==== Sample encoded data ====
  
*If the accessory flag is clear, no optional accessory data is encoded on the card
+
Accessory data for a pinata wearing two items (Non-Resident Scarf, and Von Ghoul Helmet):
  
*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.
+
{| border="1" class="pii_species_variants" style="text-align:center"
 +
|-
 +
!style="background:#cee0f2;"|Color count!!style="background:#cee0f2;"|Count!!style="background:#cee0f2;"|Item 1!!style="background:#cee0f2;"|Item 2
 +
|-
 +
|style="background:#f5faff;"|0||style="background:#f5faff;"|2||style="background:#f5faff;"|96||style="background:#f5faff;"|135
 +
|-
 +
|}
  
=== Encoding ===
+
The same items, if the Non-Resident Scarf is red:
  
*If the pinata will be wearing accessories, set the accessory flag, and encode the accessory details.
+
{| border="1" class="pii_species_variants" style="text-align:center"
 
+
|-
*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.
+
!style="background:#cee0f2;"|Color count!!style="background:#cee0f2;"|Item 1!!style="background:#cee0f2;"|Item 1 color!!style="background:#cee0f2;"|Count!!style="background:#cee0f2;"|Item 2
 +
|-
 +
|style="background:#f5faff;"|1||style="background:#f5faff;"|96||style="background:#f5faff;"|1||style="background:#f5faff;"|1||style="background:#f5faff;"|135
 +
|-
 +
|}
  
 +
<div style="clear:right;"></div>
 
== Date ==
 
== Date ==
  
Line 377: Line 469:
 
|'''Parent:'''||PlaceTag
 
|'''Parent:'''||PlaceTag
 
|-valign="top"
 
|-valign="top"
|'''Offset:'''||Varies<br />41 (AF=0)<br />?? (?)
+
|'''Offset:'''||0
 
|-valign="top"
 
|-valign="top"
 
|'''Size:'''||Varies<br />5 x (length + 1)
 
|'''Size:'''||Varies<br />5 x (length + 1)
Line 417: Line 509:
 
|colspan="2" style="text-align:center;"|'''See also'''
 
|colspan="2" style="text-align:center;"|'''See also'''
 
|-
 
|-
|colspan="2"|[[#Name flag|Name flag]]
+
|colspan="2"|[[#?|?]]
 
|}
 
|}
This optional pinata name data is present if the name flag is set.
+
This data is present if the pinata has an encoded name.
 
 
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).
 
Unlike the accessory data, it does not contain a count (length) preceeding the name characters.  The name is null-terminated (NUL).
Line 460: Line 550:
  
 
<div style="clear:right;"></div>
 
<div style="clear:right;"></div>
== Name flag ==
 
 
{| 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;"|'''Name flag'''
 
|-
 
|'''Optional:'''||No
 
|-
 
|'''Parent:'''||PlaceTag
 
|-valign="top"
 
|'''Offset:'''||Varies<br />39 (AF=0)<br />?? (?)
 
|-valign="top"
 
|'''Size:'''||1 bit
 
|-
 
|colspan="2" style="text-align:center;"|'''See also'''
 
|-
 
|colspan="2"|[[#Name|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.
 
 
 
== Use cost ==
 
== Use cost ==
  
Line 505: Line 560:
 
|'''Parent:'''||PlaceTag
 
|'''Parent:'''||PlaceTag
 
|-valign="top"
 
|-valign="top"
|'''Offset:'''||Varies<br />
+
|'''Offset:'''||0
41 (AF=0)<br />
 
?? (AF=1)
 
 
|-valign="top"
 
|-valign="top"
 
|'''Size:'''||10 bits
 
|'''Size:'''||10 bits
Line 537: Line 590:
 
|colspan="2" style="text-align:center;"|'''See also'''
 
|colspan="2" style="text-align:center;"|'''See also'''
 
|-
 
|-
|colspan="2"|[[#Use cost flag|Use cost flag]], [[#Accessory flag|accessory flag]]
+
|colspan="2"|[[#?|?]]
 
|}
 
|}
  
 
The use cost holds the cost to scan the card (if the card is not flagged as free to scan).
 
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 ===
 
=== Decoding ===
  
*If the use cost flag is clear, the card is free to scan, and the (non-zero) use cost data should be ignored.
+
*Use the encoded use cost as the cost to scan the card.
 
 
*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 10<sup>2</sup> = 18 x 100 = 1800.
 
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 10<sup>2</sup> = 18 x 100 = 1800.
Line 554: Line 603:
 
=== Encoding ===
 
=== 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.
+
*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.
 
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.
+
<div style="clear:right;"></div>
 
 
{| border="1" class="pii_species_variants" style="text-align:center"
 
|-
 
!Bit(s)!!Value to encode
 
|-
 
|V6 to V3||0
 
|-
 
|V2||1
 
|-
 
|V1||!ID11
 
|-
 
|V0||!ID10
 
|-
 
|M2||ID9
 
|-
 
|M1||ID8
 
|-
 
|M0||ID7
 
|-
 
|}
 
 
 
== Use cost flag ==
 
 
 
{| 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;"|'''Use cost flag'''
 
|-
 
|'''Optional:'''||No
 
|-
 
|'''Parent:'''||PlaceTag
 
|-valign="top"
 
|'''Offset:'''||35
 
|-valign="top"
 
|'''Size:'''||1 bit
 
|-
 
|colspan="2" style="text-align:center;"|'''See also'''
 
|-
 
|colspan="2"|[[#Use cost|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 ==
  
Line 624: Line 617:
 
|'''Parent:'''||PlaceTag
 
|'''Parent:'''||PlaceTag
 
|-valign="top"
 
|-valign="top"
|'''Offset:'''||Varies<br />
+
|'''Offset:'''||0
?? (NF=1)<br />
 
?? (AF=1)<br />
 
56 (UF=1)
 
 
|-valign="top"
 
|-valign="top"
 
|'''Size:'''||4 bits
 
|'''Size:'''||4 bits
Line 633: Line 623:
 
|colspan="2" style="text-align:center;"|'''See also'''
 
|colspan="2" style="text-align:center;"|'''See also'''
 
|-
 
|-
|colspan="2"|[[#Use cost flag|Use cost flag]], [[#Accessory flag|accessory flag]], [[#Name flag|name flag]]
+
|colspan="2"|[[#?|?]]
 
|}
 
|}
  
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.
+
This optional variant data is present if the pinata is a variant.
  
 
The variant identifies the variant color of the pinata being scanned.
 
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 ===
 
=== Decoding ===
Line 656: Line 644:
 
|+'''Variant values for the Quackberry'''
 
|+'''Variant values for the Quackberry'''
 
!Description!!Color!!Encoded value
 
!Description!!Color!!Encoded value
 +
|-
 +
|Sick/ill-looking||Mint green||1
 
|-
 
|-
 
|GoodVariants||Orange||2
 
|GoodVariants||Orange||2
Line 689: Line 679:
 
|'''Parent:'''||PlaceTag
 
|'''Parent:'''||PlaceTag
 
|-valign="top"
 
|-valign="top"
|'''Offset:'''||Varies<br />
+
|'''Offset:'''||0
?? (NF=1)<br />
 
?? (AF=1)<br />
 
56 (UF=1)
 
 
|-valign="top"
 
|-valign="top"
 
|'''Size:'''||2 bits
 
|'''Size:'''||2 bits
Line 698: Line 685:
 
|colspan="2" style="text-align:center;"|'''See also'''
 
|colspan="2" style="text-align:center;"|'''See also'''
 
|-
 
|-
|colspan="2"|[[#Use cost flag|Use cost flag]], [[#Accessory flag|accessory flag]], [[#Name flag|name flag]]
+
|colspan="2"|[[#?|?]]
 
|}
 
|}
  
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.
+
This optional wildcard data is present if the pinata is a wildcard.
  
 
The wildcard identifies the trait of the pinata being scanned.
 
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 ===
 
=== Decoding ===
Line 818: Line 803:
 
|-
 
|-
 
|010||align="left"|Color 2 (red)
 
|010||align="left"|Color 2 (red)
 +
|-
 +
|011||align="left"|Color 3 (black/neon green)
 
|-
 
|-
 
|}
 
|}

Latest revision as of 23:36, 18 August 2011

Overview

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:

ID Cluckles Name Claudia Use cost 500

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
  • ID
  • Accessory (optional)
  • Start date (optional)
  • End date (optional)
  • Reuse (optional)
  • Name or cost (optional)
  • Wildcard (optional)
  • Variant (optional)
  • End of data

Encoded data

Payload type

Payload type
Optional: No
Parent: N/A
Offset: Varies
Size: 5 bits
See also
?

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).


Decoding

  • ?

Encoding

  • ?

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.)

00001 12 ID 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).

01000 30 Gamertag data
01001 2 Wildcard data
01010 4 Variant data
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.)
01111 ? ? No apparent difference with pinatas or eggs, with or without this payload type. (No existing cards use this payload type.)
10000 16 0000000000100nnn Terrain

Dirt = 0, Grass, Long Grass, Snow, Sand

0000000001000nnn SparseCallback_Send_in_Ruffian

Ruffian1 = 1, Ruffian2, Ruffian3, Ruffian4, Pester, Yellow card (Ruffians), Red card (Pester and Ruffians)

0000000001010001 UnlockArt_Animal, UnlockArt_Helper
0000000001010011 ViewTagInJournal_Animal
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)

0000001100001001 SparseCallback_Set_player_credits_balance_to_1000000000 (10^9)
0000010100000001 Learn_Primary_Trick
0000010100000010 Learn_Secondary_Trick
0000010100000100 Perform_Primary_Trick
0000010100001000 Perform_Secondary_Trick
0000011110101010 View_Mate_Cutscene_Forced
0000100100000100 SparseCallback_Adjust_player_credits_balance_by_10000 (10^4)
0000100110000100 SparseCallback_Adjust_player_credits_balance_by_-10000 (10^4)
0000101110101010 View_Appear_Cutscene_Forced
0000110101010101 View_House_Interior_If_Present
0000110110101010 View_House_Interior_Forced
00010011000000nn SparseCallback_Change_dinosaur_to_colour

Blue = 0, Green, Red, Elite Neon

1111000000000000 ? (One card, labeled HelpersPV)
10001 4 Timewarp data
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)
10101 8+? ? No apparent difference with pinatas or eggs, with or without this payload type. (No existing cards use this payload type.)
10110 5 00000 Immediately reusable

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)

10111 7+? ? No apparent difference with pinatas or eggs, with or without this payload type. (No existing cards use this payload type.)
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:

Payload type Payload
00000 0001 (Start of data)
00001 (ID) 108 (Goobaa)
11101 (Accessory) 3 (items) 43 103 80
00111 (Name) Bigsheep
01010 (Variant) 2
00000 0000 (End of data)

001 PlaceTag

Accessory

Accessory
Optional: Yes
Parent: PlaceTag
Offset: 0
Size: Varies
4 + (12 x color count) + 4 + (8 x count)
Color count
Optional: No
Parent: Accessory
Offset: 0
Size: 4 bits
Accessory item 1, 2, 3, ...
Optional: Yes
Parent: Color count
Offset: 0, 12, 24, ...
Size: 8 bits
Color for item 1, 2, 3, ...
Optional: Yes
Parent: Color count
Offset: 8, 20, 32, ...
Size: 4 bits
Count
Optional: No
Parent: Accessory
Offset: 4 + (12 x color count)
Size: 4 bits
Accessory item 4, 5, 6, ...
Optional: Yes
Parent: Count
Offset: 0, 8, 16, ...
Size: 8 bits
See also
?

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.)

Decoding

  • Read a count, then read that number of 12- or 8-bit values that follow to determine what (color) accessories a pinata is wearing.

Encoding

  • ?

A sample of encodings for accessory items. Other item values can be obtained (by subtracting 1904) from the accessory's PlaceTag ID.

Item Description PlaceTag ID
1 Retro Disco Wig 1905
24 Yee-Haw Spurs 1928
91 Reading Glasses 1995
96 Non-Resident Scarf 2000
122 Cook Hat 2026
123 Tail Bow 2027
183 Jokduri 2087
184-255 No such accessory
Color values for accessories with color choices
Value Color Value Color
0 Default1 8 Light Green
1 Red 9 Blue
2 Orange 10 Cyan
3 Yellow 11 Violet
4 Brown 12 Black
5 Pink 13 White
6 Purple 14 ?
7 Green 15 ?

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
0 2 96 135

The same items, if the Non-Resident Scarf is red:

Color count Item 1 Item 1 color Count Item 2
1 96 1 1 135

Date

Date
Optional: Yes
Parent: Payload type
Offset: 0
Size: 9
Day
Optional: No
Parent: Date
Offset: 0
Size: 5 bits
Month
Optional: No
Parent: Date
Offset: 5
Size: 4 bits
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: 0
Size: Varies
5 x (length + 1)
Name character 1
Optional: No
Parent: Name
Offset: 0
Size: 5 bits
Name character 2
Optional: No
Parent: Name
Offset: 5
Size: 5 bits
Name character 3, 4, 5, ...
Optional: Yes
Parent: Name
Offset: 10, 15, 20, ...
Size: 5 bits
See also
?

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).

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

Use cost

Use cost
Optional: No
Parent: PlaceTag
Offset: 0
Size: 10 bits
Use cost value
Optional: No
Parent: Use cost
Offset: 0
Size: 7 bits
Use cost magnitude
Optional: No
Parent: Use cost
Offset: 7
Size: 3 bits
See also
?

The use cost holds the cost to scan the card (if the card is not flagged as free to scan).

Decoding

  • 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 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.

Variant

Variant
Optional: Yes
Parent: PlaceTag
Offset: 0
Size: 4 bits
See also
?

This optional variant data is present if the pinata is a variant.

The variant identifies the variant color of the pinata being scanned.

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.
Variant values for the Quackberry
Description Color Encoded value
Sick/ill-looking Mint green 1
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: 0
Size: 2 bits
See also
?

This optional wildcard data is present if the pinata is a wildcard.

The wildcard identifies the trait of the pinata being scanned.

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)
011 Color 3 (black/neon green)

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
  • Weather types 5 through 7 are invalid values.