Wikia

Dan-Ball Wiki

Powder Game code

Talk7
1,109pages on
this wiki

Powder Game codes are used in Powder Game and Powder Game 2 to save what's on-screen as a code. These codes can be then saved in a file or otherwise stored for later use. To get a code, press the "Get" button. To load a code, paste a code into the box and press "Set."

The following is an example code, which displays some text written with steam:

Powder Game code
0030000000100*02102*01*03*06*05*01w00q00004000v00u01u0B*0200Du0F00Cv0E10E00Ku0J*0Hv0Lu0G*0Bv0Q00N10M*0Pu0Jr00C00t0BC0Bs0Y000y0co0AC0Bz0Yo0bo0cy0eC0Bx00n0k00EC0Bp0mC0Bq0q000r0Yr0Bt0so0qp0Bn00p0cp00o0Ju0cq0cs0tC0By0cr0zC0Bo0cx0sx0.n11n15C0rC0bn0cn0sp0cm1600zo10C1D00h01Ip0Yp0bC0pC0z00ZC1Rp0cC0*01Sp17C1Q00*C1TC0ao1Xo1YC1Vp0.C1Rr1O01Zp1d00f01NC1Rq1hs0nC1Vr1hC1b00fp0vC1a00Yq0a016o1Yp1ht1hp1Uo1Dp1yC0ap1Lq1fp1X01l01Zo1wp1.C1wq1C016p1do1c01s01So2000fo28C1mC1Rs0m10Mu11C1Vo0no1f01301Z01Ir2Ro1Mo2Bp1o02Tp0ko2Eo2a02To0np2Bo2VC1pC1Yo2g02UC2bC0Br2co2eC2mC2iC2PC25o2QC25p2XC2l02ZC2uC25r2O02x02Rp1U02702*o1Mr0cu2go2wo2Rr2t01Io2nC2q02Un1K01kp39v0nz2o02Sp2Ys3Ip3Io3Ir3MC1P03AC3Pp2fC1Yr3O01Iv3Uo3S03VC2y033C3Cr0u026o31C1wo2jp0ns24000s3LC3Zr2v03a03Q00Dn3Eq3gC2LC1Qp1tq3lC0t01Iq1v02*p3WC3wr3Us30C1ar2p02*r3Or1Pq3Zo0nr0kr4603np3Ur0ct2jC1wC47C3wo12C43p3yo4101Zr43r3r04M02C03jn3qC3Cs2Bs3mo38C1Po2103zC4G02Tv40C1Ys0nv3NC4av4Oo48C25v4hC3Cp4i01S03oC4F03ns4I02So4Op4eC4JC4aw15n4S03oo4W044C2wp4VC3fC50C2qo2sC3v04qC5304*059o4Or3B04zC5505AC2ro5Ep2to2zC1t026p3603nt4Lo2WC4Yo4.o3.o4ap4x12NC1Lp2op3RC1Rt1MC3Zs1ho5MC3Zp1oo21p5Yp1Yt5a04Qq1nC3vo2J04Qt5jo1fo2Jo5g02G05f02Fq5pC1Vq35C2K03xC1VC3t01Iu1hr5w05LC5ZC5xC2Ko2Jp2Hp0en0Jz2S*0Hx0*10Mz6C*0lo0O*0Su6I00I10V*6J16M06Lu0R06P00Uu6Qv0T*0W16Ov6U*6Nu6Tu6Kv6X06R*6Vu6Z16Wu6au6g16f16iu6eu6k06S06m*6d06n*6Y06p06c*6q*6o*6u*6t*6w06s06yv6bv6.u6hu6l*6v06zu7006rv6*16j075u74*72v76u71*6xv7B078177*7Au79*7Du7I07317G*7J17M07Lu7C07P07Fu7Qv7E*7H17Ov7U*7Nu7Tu7Kv7X07R*7Vu7Z17Wu7au7g17f17iu7eu7k07S07m*7d07n*7Y07p07c*7q*7o*7u*7t*7w07s07yv7bv7.u7hu7l*7v07zu8007rv7*17j085u84*82v86u81*7xv8B088187*8Au89*8Du8I08318G*8J18M08Lu8C08P08Fu8Qv8E*8H18Ov8U*8Nu8Tu8Kv8X08R*8Vu8Z18Wu8au8g18f18iu8eu7e*0710418n*8mw0A0lI6

Here is the same example, but in the modern Powder Game code format:

Powder Game code
10300000a100000000100*02102*01*03*06*05*01w00q00004000v00u01u0B*0200Du0F00Cv0E10E00Ku0J*0Hv0Lu0G*0Bv0Q00N10M*0Pu0Jr00C00t0BC0Bs0Y000y0co0AC0Bz0Yo0bo0cy0eC0Bx00n0k00EC0Bp0mC0Bq0q000r0Yr0Bt0so0qp0Bn00p0cp00o0Ju0cq0cs0tC0By0cr0zC0Bo0cx0sx0.n11n15C0rC0bn0cn0sp0cm1600zo10C1D00h01Ip0Yp0bC0pC0z00ZC1Rp0cC0*01Sp17C1Q00*C1TC0ao1Xo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du7I07317G*7J17M07Lu7C07P07Fu7Qv7E*7H17Ov7U*7Nu7Tu7Kv7X07R*7Vu7Z17Wu7au7g17f17iu7eu7k07S07m*7d07n*7Y07p07c*7q*7o*7u*7t*7w07s07yv7bv7.u7hu7l*7v07zu8007rv7*17j085u84*82v86u81*7xv8B088187*8Au89*8Du8I08318G*8J18M08Lu8C08P08Fu8Qv8E*8H18Ov8U*8Nu8Tu8Kv8X08R*8Vu8Z18Wu8au8g18f18iu8eu7e*0710418n*8mw0A0pM4

Details for the modern Powder Game code is found below.

Data Structure (Powder Game)

A Powder Game Get-Set code is comprised of an 8-character header optionally followed by an 8-character extension, followed by a sequence of compressed element and object data, and a 3-character checksum at the end.

All data in both games' codes, except where otherwise noted, is encoded in a base 64 numeral system, where each character is a digit representing a value from 0 to 63. The digits, in order, are 0-9, A-Z, a-z, ., and *. Any other characters will be read as zeroes.

Header

The code's header contains global values such as the BG and Speed settings. Unlike most other parts of the code, these values are not stored as base 64, but instead follow ASCII order starting at '0'. This is only noticeable with the BG value however, as the order of digits after '9' starts with ':' and ';' before progressing into capital letters.

Attempting to load a code with any values for header digits other than the ones listed will crash the game.

The structure is as follows:

Offset Name Notes
0 Code type If this is anything other than zero, this code contains the 8-character header extension. Used for backwards compatibility with codes from earlier versions that did not use the extension.
1 Unused Always 0
2 BG The BG setting (see below)
3 Dot The dot limit setting (0 is DOT S, 1 is DOT M, 2 is DOT L)
4 Grid The grid setting (0 to 7)
5 Speed The speed setting (0 is x1, 2 is x2, 3 is x4, 4 is x8)
6 Side The side setting (0 is SIDE-OFF, 1 is SIDE-LOOP)
7 Unused Always 0

The BG values are as follows:

Digit Value Name
1 1 BG-non
2 2 BG-air
3 3 BG-line
4 4 BG-blur
5 5 BG-shade
6 6 BG-aura
7 7 BG-light
8 8 BG-toon
9 9 BG-mesh
 : 10 BG-gray
 ; 11 BG-track
A 12 BG-dark
B 13 BG-TG
C 14 BG-siluet

Header extension

Offset Name Notes
8 Mouseclicks The amount of times the player has clicked on the game canvas, in reverse digit order. Used for quality control of uploads; if this number is less than 50, the game will reject upload attempts and display the message "Please carefully created." Defaults to 50 when loading a code without the extension.
9
10 Unused Always 0
11
12
13
14
15

Element and object data

This compressed data comprises the majority of a Get-Set code, and it contains every element and object on the screen.

It uses a simple dictionary-based compression algorithm with repetition compression as well, and consists of a sequence of 3-character-long units. Each unit consists of a 2-digit dictionary reference followed by one digit of literal data. A dictionary reference points to the location of another unit in the sequence, and is recursive, as that unit can in turn can point to another unit with its own dictionary reference, and so on. Dictionary references start at 01; a dictionary reference of 00 is null and is ignored.

To decompress screen data, each unit must be evaluated in sequence. For each unit, its dictionary reference must be evaluated recursively until a null reference is found which ends the reference chain, and then the literal values of every unit in the chain are added to the end of the decompressed output in reverse order. If a literal value x greater than 47 (l) is encountered, it signifies that the literal value directly before it should be repeated x - 48 times. However, if another literal value y also greater than 47 is encountered directly after x, it signifies that x and y together are a reverse-order two-digit number with the value of ((y - 47) * 16) + (x - 47) - 1 and that the value immediately before x should be repeated that many times instead.

The result is a sequence of at least 120000 digits (at least one for each pixel in the game field), each of which specifies an element, an object, an attribute, or empty space. Elements or objects such as Fireworks or Players are followed by a second digit specifying their attribute. Some elements such as Clone might seem to have an attribute while the game is running but do not actually save it; these do not show up in the code.

Attempting to load a code with any non-base-64 element digits will simply result in those values being read as empty space. However, the two remaining empty spaces for elements, k and l, will crash the game when loaded. Additionally, attempting to load a code with more than 2 Players hacked in will also crash the game.

The values corresponding to each element and object are as follows:

Digit Value Name Attribute?
0 0 Air No
1 1 Block No
2 2 Powder No
3 3 Water No
4 4 Fire No
5 5 Seed No
6 6 Wood No
7 7 Gunpowder No
8 8 Fan Yes (wind direction)
9 9 Wheel No
A 10 Ice No
B 11 Snow No
C 12 Steam No
D 13 Superball No
E 14 Clone No
F 15 Fireworks Yes (element)
G 16 Oil No
H 17 C-4 No
I 18 Fighter No
J 19 Stone No
K 20 Magma No
L 21 Virus No
M 22 Box / Create Yes (size; becomes Create if size value is 10)
N 23 Nitro No
O 24 Ant No
P 25 Torch No
Q 26 Gas No
R 27 Soapy No
S 28 Thunder No
T 29 Metal No
U 30 Player (no element) No
V 31 Bomb No
W 32 Player Yes (element)
X 33 Laser No
Y 34 Acid No
Z 35 Vine No
a 36 Salt No
b 37 Seawater No
c 38 Glass No
d 39 Bird No
e 40 Ball Yes (element)
f 41 Mercury No
g 42 Spark No
h 43 Fuse No
i 44 Cloud No
j 45 Pump No

Checksum

The checksum is an encoded 3-digit number at the end of the code that is intended to prevent any corruption or tampering to the code. It is stored as a hexadecimal number in reverse digit order and does not use base 64 encoding. The first digit is a lowercase letter (a-p), the second is an uppercase letter (A-P), and the third is a numeric digit (0-7). Encoded this way, for instance, the checksum 0x507 would become hA5. The maximum value for the checksum is 0x7FF.

The checksum can be computed by first adding together the ASCII value of each character in the code multiplied by its position in the code modulo 255. (The position is 1-based, so the first character would be multiplied by 1, the second by 2, etc.) The checksum is then obtained by computing that value modulo 0x7FF.

The Get-Set mechanism will reject any code where the computed checksum does not match the checksum value stored in the code.


See also

  • Get-Set, the article about the Get-Set mechanism in general.

Around Wikia's network

Random Wiki