Difference between revisions of "Piñata Vision barcode/Variant bits"

From PinataIsland.info, the Viva Piñata wiki
Jump to: navigation, search
(Replace clearly incorrect decoding with fixed-offset (non-named, non-accessorized pinata) variant data. Discard all working notes, since variant data has been identified/located.)
(Sample encoded data illustrating variant and/or wildcard data. Optional wildcard data can change the variant data offset.)
 
Line 33: Line 33:
 
</pre>
 
</pre>
  
The offset for the variant data varies, depending on what other optional data (e.g., pinata name, accessories) is encoded on the card.  The 4-bit (Black/Good) variant data appears 5 bits after the end of the name data.  The 4-bit (in-game) variant data appears 5 bits after the use cost for player-created pinata cards.
+
The offset for the variant data varies, depending on what other optional data (e.g., pinata name, accessories) is encoded on the card.  The 4-bit (Black/Good) variant data appears 5 bits after the end of the name data.  The 4-bit (in-game) variant data appears 5 (or 12) bits after the use cost for player-created pinata cards (depending on whether the pinata is also a wildcard or not).
  
Variant data for player-created cards with no accessories can be found at offset 56 (since there is no optional data to shift the use cost and variant data into row 2).
+
Variant data for player-created cards with no accessories can be found at offset 56 or 63, depending on the presence of optional wildcard data.
 +
 
 +
===== Sample encoded data =====
 +
 
 +
{| border="1" class="pii_species_variants"
 +
|-
 +
!Pinata description!!...!!Use cost<br />(10 bits)!!style="background:#cee0f2;"|?<sup>''1''</sup><br />(5 bits)!!style="background:#cee0f2;"|Wildcard<sup>''2''</sup><br />(2 bits)||style="background:#cee0f2;"|?<sup>''3''</sup><br />(5 bits)!!style="background:#cee0f2;"|Variant<sup>''4''</sup><br />(4 bits)||style="background:#cee0f2;"|?<sup>''5''</sup><br />(5 bits)!!style="background:#cee0f2;"|?<sup>''6''</sup><br />(4 bits)!!...
 +
|-
 +
|Pretztail Wildcard1 Variant2||...||0111110010||style="background:#f5faff;"|01001||style="background:#f5faff;"|01||style="background:#f5faff;"|01010||style="background:#f5faff;"|0010||style="background:#f5faff;"|00000||style="background:#f5faff;"|0000||...
 +
|-
 +
|Peckanmix Wildcard3 Black<sup>''7''</sup>||...||0011101011||style="background:#f5faff;"|01001||style="background:#f5faff;"|10||style="background:#f5faff;"|01010||style="background:#f5faff;"|1000||style="background:#f5faff;"|00000||style="background:#f5faff;"|0000||...
 +
|-
 +
|Sparrowmint Wildcard1 Variant1||...||0111011010||style="background:#f5faff;"|01001||style="background:#f5faff;"|01||style="background:#f5faff;"|01010||style="background:#f5faff;"|0011||style="background:#f5faff;"|00000||style="background:#f5faff;"|0000||...
 +
|-
 +
!Pinata description!!...!!Use cost<br />(10 bits)!!style="background:#cee0f2;"|?<sup>''1''</sup><br />(5 bits)!!style="background:#cee0f2;"|Wildcard<sup>''2''</sup><br />(2 bits)||style="background:#cee0f2;"|?<sup>''5''</sup><br />(5 bits)!!style="background:#cee0f2;"|?<sup>''6''</sup><br />(4 bits)!!colspan="3"|...
 +
|-
 +
|Rashberry Wildcard3||...||0010001011||style="background:#f5faff;"|01001||style="background:#f5faff;"|11||style="background:#f5faff;"|00000||style="background:#f5faff;"|0000||colspan="3"|...
 +
|-
 +
!Pinata description!!...!!Use cost<br />(10 bits)!!style="background:#cee0f2;"|?<sup>''3''</sup><br />(5 bits)!!style="background:#cee0f2;"|Variant<sup>''4''</sup><br />(4 bits)||style="background:#cee0f2;"|?<sup>''5''</sup><br />(5 bits)!!style="background:#cee0f2;"|?<sup>''6''</sup><br />(4 bits)!!colspan="3"|...
 +
|-
 +
|Tigermisu Variant2||...||1010110010||style="background:#f5faff;"|01010||style="background:#f5faff;"|0010||style="background:#f5faff;"|00000||style="background:#f5faff;"|0000||colspan="3"|...
 +
|}
 +
<sup>''1''</sup>This optional payload type field identifies the type of data that immediately follows.  In this case, '01001' indicates that 2-bit wildcard data follows.
 +
 
 +
<sup>''2''</sup>The wildcard data.
 +
 
 +
<sup>''3''</sup>This optional payload type field identifies the type of data that immediately follows.  In this case, '01010' indicates that 4-bit variant data follows.
 +
 
 +
<sup>''4''</sup>The variant data.
 +
 
 +
<sup>''5''</sup>This optional payload type field identifies the type of data that immediately follows.  In this case, '00000' indicates that 4 '0000' bits follow, apparently ending a variable number of payloads.
 +
 
 +
<sup>''6''</sup>This 4-bit '0000' value is probably padding, to make the payload type + payload data be a maximum of 9 bits.
 +
 
 +
<sup>''7''</sup>This particular pinata is actually a GoodVariants (mostly black) color.  A Blackariants Peckanmix would have an encoded variant value of '1111.'
  
 
== Decoding variant bits ==
 
== Decoding variant bits ==

Latest revision as of 11:11, 2 April 2011

Types of variant data

The game supports two types of variants. The first are the Journal variants (often labeled as Variant 1, 2, and 3). These variants are obtainable in-game by feeding a pinata a certain item.

The second type of variants are the PV-exclusive variants. These extra colors aren't normally available in-game, but can be obtained by scanning other variant cards and black variant cards.

In terms of the barcode (and card description), these two types of variant data are identical, and the variant data is stored in the same 4-bit field, regardless of whether it's an in-game variant, or PV-exclusive color.

The encoded values are distinctly numbered. For example, Image:Kittyfloss-TroubleInParadise-Orange-Harrison-PV.jpg, labeled as Variant: 2, Variant description: Orange, is distinct from in-game variant 2 for the Kittyfloss, which is actually encoded as 4.

Variant data

The variant data is a 4-bit field. It's not certain yet if this field is optional, or also exists for normal pinatas.

This field is likely specific to the PlaceTag species card type.

Based on descriptions from Vision_Single cards, GoodVariants values range from 2 to 10, while Blackariants are always 15. In-game variants share similar (non-conflicting) numbering, using 3 of the possible values in the GoodVariants range.

PlaceTag species variant cards are two (or more) rows, unlike normal (non-variant, non-wildcard) pinata cards which are typically a single barcode row.

Like the PlaceTag species variant cards, GoodVariants and Blackariants cards also use two barcode rows.

GoodVariants and Blackariants data

Location of variant bits

Variant data may be encoded in row 1, or row 2, depending on the presence of other optional data. For named pinatas, such as the GoodVariants, the variant data follows the (variable-length) name data, certainly meaning it's in row 2 for those cards. Notice in the following example that the row 1 barcode is identical, although the cards are for two different variant colors (5 and 6).

D37248104F172B35 9A9C55CDE356E216	Vision_Single_GoodVariants_goose_41.jpg (5, James)
D37248104F172B35 9B636492E839E419	Vision_Single_GoodVariants_goose_42.jpg (6, James)

The offset for the variant data varies, depending on what other optional data (e.g., pinata name, accessories) is encoded on the card. The 4-bit (Black/Good) variant data appears 5 bits after the end of the name data. The 4-bit (in-game) variant data appears 5 (or 12) bits after the use cost for player-created pinata cards (depending on whether the pinata is also a wildcard or not).

Variant data for player-created cards with no accessories can be found at offset 56 or 63, depending on the presence of optional wildcard data.

Sample encoded data
Pinata description ... Use cost
(10 bits)
?1
(5 bits)
Wildcard2
(2 bits)
?3
(5 bits)
Variant4
(4 bits)
?5
(5 bits)
?6
(4 bits)
...
Pretztail Wildcard1 Variant2 ... 0111110010 01001 01 01010 0010 00000 0000 ...
Peckanmix Wildcard3 Black7 ... 0011101011 01001 10 01010 1000 00000 0000 ...
Sparrowmint Wildcard1 Variant1 ... 0111011010 01001 01 01010 0011 00000 0000 ...
Pinata description ... Use cost
(10 bits)
?1
(5 bits)
Wildcard2
(2 bits)
?5
(5 bits)
?6
(4 bits)
...
Rashberry Wildcard3 ... 0010001011 01001 11 00000 0000 ...
Pinata description ... Use cost
(10 bits)
?3
(5 bits)
Variant4
(4 bits)
?5
(5 bits)
?6
(4 bits)
...
Tigermisu Variant2 ... 1010110010 01010 0010 00000 0000 ...

1This optional payload type field identifies the type of data that immediately follows. In this case, '01001' indicates that 2-bit wildcard data follows.

2The wildcard data.

3This optional payload type field identifies the type of data that immediately follows. In this case, '01010' indicates that 4-bit variant data follows.

4The variant data.

5This optional payload type field identifies the type of data that immediately follows. In this case, '00000' indicates that 4 '0000' bits follow, apparently ending a variable number of payloads.

6This 4-bit '0000' value is probably padding, to make the payload type + payload data be a maximum of 9 bits.

7This particular pinata is actually a GoodVariants (mostly black) color. A Blackariants Peckanmix would have an encoded variant value of '1111.'

Decoding variant bits

PlaceTag species and GoodVariants/Blackariants variant data use a common variant data field, and the barcode does not distingush between in-game and other variants.

GoodVariants IDs

It's unknown what the GoodVariants _nnn filename values refer to, although they are unrelated to the species IDs, as seen in the Blackariants _nnn filename values.