1988 · Electronic Arts

Wasteland

This minisite was contributed by air. It’s currently claimed by air who is editing it to reach a Gold tier standard.

Every check and every shot comes down to two dice that are thrown again on a double, and Wasteland’s dice come up doubles one throw in five.

01 · Checks and shots

Two dice that keep rolling

Every skill check, attribute check, and party member's shot comes down to one throw: two six-sided dice, added up, and thrown again whenever they match. The repeats add on, so a pair of sixes followed by a 3 and a 4 makes 19 ($0845). Each repeat is a one-in-six chance, so high totals are rare but possible.

A check has a target of 15 + 5 × its difficulty ($0867). For a skill check, the throw plus the attribute that goes with the skill plus 4 for each level of the skill must reach it ($0C6A). The table at $0DD8 pairs each skill with its attribute, such as Climb with AGL, Picklock with DEX, and Medic with IQ. An attribute check adds the attribute alone ($0D0A). A throw under 5 fails whatever the bonus, which is one throw in nine.

Every throw of 5 or more is added to the character's experience, pass or fail ($0C41). A pass can also raise the skill a level, but only while the level is below the character's rank and below the difficulty. Then a d10 no higher than half of (difficulty − level), rounded down, plus 1 raises it ($0CA2). A new character has rank 1 ($7FDD), so no skill improves by use before the first promotion.

Players levelled whole parties on this rule. On the Wasteland Ranger HQ-Grid's Underground, D. Sinner (4 May 1998) played the Desert Nomads' slot machine and then three card monty in Las Vegas, reckoned on about ten levels from a session, and guessed that you get one xp for every $ you make. The money plays no part. A pull of the slot machine tests the player's Gamble and LK by turns, up to ten times and hardest first, until one passes ($3B9C), and a hand of monty tests LK and Gamble ($3BC9). The experience is the dice of each of those throws that came to 5 or more, won or lost.

– chance to pass

The chance is exact for fair dice: every way the throw can reach each total is counted, doubles and all. The chart is the throw alone; red totals fail at once. Roll runs the game's own check, ported from the engine ($0C29, $0D0A) and tested against the original code on a 6502 simulator: 27,324 skill checks over every skill, levels 0 to 10 and difficulties 0 to 31, and 3,072 attribute checks, with the same random bytes, gave the same results and used the same bytes.

A shot uses the same throw ($A584). To it are added DEX, 4 for each level of the weapon's skill, and the fire mode: 4 for a burst, the rounds left in the gun for automatic fire, and 10 for an explosive ($A5D6). A full Uzi on automatic adds 40. The total must reach a target that grows with the distance, rounded up to 5 feet, at one of three rates ($A793, $BD48). Pistols, thrown weapons, and explosives start at 0 and add 5 for every 5 feet. SMGs, carbines, the Flamethrower, the Ion beamer, the Mangler, and the Sabot rocket start at 10 and add 2. Every other gun, from the rifles to the Meson cannon, the LAW, and the RPG-7, starts at 20 and adds 1, so beyond 25 feet a rifle is an easier shot than a pistol, and beyond 50 feet than an SMG.

Nothing in that total can turn against the shooter. It is kept in 16 bits and stops at 65,535 ($079D), each level of skill adds 4 however high the level goes, and the skill never enters a hit's damage. So every level of Energy weapon makes a shot likelier to hit. J. Webb wrote on the HQ-Grid's Underground, in an undated note, that an Energy Weapon skill level above 8 seems detrimental. The C64's code has no such turn.

The target is 7 higher when the monster the code looks at has no gun ($A76E). The line it looks at is the one numbered like the target's group, which is not always the line being shot at ($A74B, $A766).

A throw of 3 is not a miss by itself. One more die is thrown, and a 1 spoils the shot however easy it was: rockets and explosives fail to detonate, and any other gun jams and loses its rounds ($A58D). That is one shot in 108.

A burst that hits lands 1 to 3 hits ($A0B3), and automatic fire one d4 of hits for every 4 rounds ($A98C). A burst spends 3 rounds and automatic fire all of them, hit or miss ($A02B, $A220).

Each hit rolls the weapon's dice, adds the attacker's luck bonus, and takes off the monster's armour roll, stopping at 0 ($A7DE, $A9AD). Anti-tank weapons roll 2 × their dice − the armour when the armour is no more than their dice, and the armour roll is not taken off ($A818, $A677). An explosive rolls its damage once, without luck, and every monster in the group takes it less its own armour roll ($A054, $AA90). The luck bonus has no floor: a hit it takes below 0 kills, as the throwing knife's section below shows.

Fire
– chance to hit

A party member's shot at a monster group, with the guns, rockets and explosives of the item table ($3108). The chart is the damage of one hit after armour; 0 is in red. Fists and hand weapons fight in melee, which works differently and is not shown. Fire runs the game's routines, ported and tested on the simulator against the original code with the same random bytes: the hit roll with every item in the table (15,360 cases), the damage with every item against armour 0 to 15 and beyond (10,368), the hits of bursts and automatic fire (5,436), and the range targets for every distance (606). Which monster each hit lands on is drawn at random too; that draw is left out.

The chances above are given twice. The first is exact for fair dice. The second comes from the pairs the engine's own code threw on the simulator ($24E3), taking each repeat to fall the way a first pair does. They differ because the game's dice are not fair, as the next section shows.

02 · Random numbers

Bug: the dice come up doubles one throw in five

Two fair dice match one throw in six. Wasteland's match one throw in five, and a pair of ones comes up twice as often as it should. A double means the dice are thrown again, so the bias reaches every check and every shot in the game.

– doubles

fewer than fairmore than fair

The first pair of the open throw, first die down and second across. In the emulator, a stub in play threw 4,096 pairs with the game's own routines and the same instructions between the two dice as the throw itself ($084A-$0850), each pair after the seed had been stirred 1 to 256 times, as waiting for a key stirs it. On the simulator, the engine's code threw 2,000,000 pairs on the kit's 6502 simulator from random moments: a random raster line, cycle, timer value, and seed for each.

The game has no table of random numbers. Each random byte is the sum of three numbers ($24E3): the raster line the video chip is drawing, the low byte of a timer that counts down once a cycle, and the last random byte plus one. A die ($24D6) keeps the byte's lowest three bits, 0 to 7, throws again at once on a 6 or a 7, and adds 1. The raster line and the timer move with the clock, so a byte made a few cycles after another depends on it. After a draw of 7, the die thrown again at once comes out 2 or 3 two times in five, where a fair die would give 2 or 3 one time in three.

Every skill or attribute check fails at once on a throw below 5 ($0C73, $0D29). That takes a first pair of 1 and 2 or 1 and 3, one throw in nine with fair dice. The game's dice do it 13.1% of the time on the simulator and 12.9% in the emulator. The checks and shots above give the chances both ways.

A single die is uneven too. In 5,000 dice from the Ranger Center's attribute rolls, watched in the emulator, ones came up 1,043 times, fours 727, and sixes 826, where fair dice give 833 of each.

03 · Experience

A kill in melee earns double experience

A monster killed with fists or a hand weapon (a knife, a club, an ax, a chainsaw, or a proton ax) gives its killer twice the experience a shot gives for the same kill. The melee round adds the kill's worth twice, one call after the other. Guns, rockets, and explosives add it once.

The manual never spells this out. Its section on hand-to-hand combat (page 16) says the Rangers have an advantage over the citizens in hand-to-hand combat, and nothing about experience. Its section on promotion (page 11) says You're awarded experience points each time you accomplish a difficult task or win a difficult battle, and nothing about how a kill is made.

A kill in melee

  1. $815DAD D6 80LDA melee_line_index_op
  2. $816020 E8 A9JSR kill_experience
  3. $816320 DD 03JSR api_add_experience
  4. $816620 DD 03JSR api_add_experience

Experience 0

A kill by a shot

  1. $A713AD 5D A6LDA damage_line_op
  2. $A71620 E8 A9JSR kill_experience
  3. $A71920 DD 03JSR api_add_experience
  4. $A71CA9 00LDA #$00

Experience 0

The two places the game pays for a kill, from the Source tab: the end of a melee attack and the end of a shot. Step runs one line of each. The kill is worth 40 here, as each Shambler Ghoul was in the emulator. There, three kills in melee each took their killer's experience from 0 to 80, 40 at each of the two calls.

The kill's worth comes from $A9E8: the base value in the monster's record, added once for each of its armour dice and once more. $03DD adds that number to the experience of the character whose turn it is, and leaves the number in place. The melee code calls it at $8163 and again at $8166, with nothing between that could change the number or the character. A shot calls it once ($A719), and so does an explosion for each monster it kills ($A08A).

Map 1's graveyard: KIT hammers the Shambler Ghoul for 6 points of damage killing it.

The game prints the kill and not the experience, so nothing on the screen shows the second payment. Experience brings promotion, the first at 1,024 for a new Ranger ($7F1B). Each promotion gives two points to spend on attributes and a higher rank, and a skill improves with use only while its level is below the rank. Every kill made in melee counts twice toward the next promotion.

Players knew of the double payment. The Wasteland Ranger HQ-Grid's Underground says the Night Terror in Finster's mind maze gives the most experience in the game, and of course twice that if you beat it with melee weapons, and K. Ballou wrote there (14 May 1998) that killing it with a proton axe paid 64,000. On the C64 its record has a base of 32,000 and no armour dice ($42C1), so the kill is worth 32,000, more than seven times the next monster's, and a proton ax pays it twice. For a new Ranger, 64,000 is ten promotions at the next radio call; the ranks show why each later kill brings fewer.

04 · Learning

No fight can teach a weapon skill past level 7

A fight teaches as it goes: after an attack, the attacker may learn a level of the weapon's skill. How far a fight can teach depends on the target's armour, and no monster in the 42 maps has the armour to teach beyond level 7.

The lesson needs no check to pass ($AA35). It is the roll a passed check makes, at a difficulty of half the target's armour dice, rounded down, plus 1 ($9ED7, $0CA2). The level must be at least 1, below the attacker's rank, and below that difficulty, and then a d10 decides, as it does after a check. A blow in melee that misses teaches nothing ($8103-$810C), and neither does an empty gun.

Armour diceHighest level a fight teachesMonster records
0 or 1none140
2 or 3253
4 or 5340
6 or 7444
8 or 9544
10 or 11651
12 or 13726

Every monster record of the 42 maps, read from the maps' listings: 398 records in 39 maps, none with more than 13 armour dice. The 26 that teach to level 7 are in the Guardian Citadel (21) and Base Cochise (5). Armour of 0 or 1 makes the difficulty 1, which teaches nothing, since the level must be at least 1 and below it.

Players found the ceiling by grinding against it. L. Stegner told the HQ-Grid's Underground (7 November 1999) that Brother Goliath, in the Guardian Citadel, can raise your guys up to level 7 in most fighting skills. His record has 13 armour dice, the most any monster has, so his lessons stop at 7 ($428E). Zoster (1 July 1999) took weapon skills up to 7 by firing on the Scorpitron in Las Vegas. On the C64 the Scorpitron has 10 armour dice, so its lessons stop at 6 ($531E).

05 · Damage

Bug: an unlucky Ranger's throwing knife can kill anything

A shot's damage is the weapon's dice plus the attacker's luck bonus, and below an LK of 9 the bonus is negative. When it takes the sum below 0, the number wraps round to 65,535, and whatever was hit dies. One weapon can get there: a Throwing knife, thrown by a Ranger with an LK of 3 or 4, when both of its dice show 1.

The fight in map 1's graveyard: Hell Razor attacks and hits 1 Shambler Ghoul for 65532 points of damage spinning it into a dance of death. Thrasher misses.
In the emulator, Hell Razor with an LK of 3 and a Throwing knife, against the Shambler Ghouls in map 1's graveyard. The knife's roll, 10, was changed to 2, a 1 and a 1, as the dice handed it back (at $A7E7). The sum came out as 65,535, and the ghoul's armour took 3 off it.
  1. $A7DE20 F4 A7JSR weapon_damage_roll
  2. $A7E18D EC A7STA damage_roll_lo_op
  3. $A7E48E F0 A7STX damage_roll_hi_op
  4. $A7E720 B8 A7JSR luck_bonus
  5. $A7EA18CLC
  6. $A7EB69 00ADC #$00
  7. $A7ED48PHA
  8. $A7EE8ATXA
  9. $A7EF69 00ADC #$00
  10. $A7F1AATAX
  11. $A7F268PLA
  12. $A7F360RTS

The routine that works out a shot's damage. The two stores write the roll into the operands of the two ADC instructions, and the luck bonus comes back from $A7B8 in X and A. Nothing after the second ADC looks at the carry.

LKLuck bonusA sum below 0 needs a roll of
3 or 4−32 or less: the Throwing knife's two dice both showing 1
5 or 6−21: no thrown or fired weapon rolls fewer than two dice
7 or 8−10: never
9 and up0 or morenever

The bonus is (LK − 9) / 2 rounded down below 9, 0 from 9 to 12, and (LK − 12) / 2 from 13 ($A7C3). The lowest attribute a Ranger can be rolled is 3.

A shot's damage is worked out by one routine ($A7DE). It rolls the weapon's dice ($A7F4), then adds the attacker's luck bonus with two plain additions, the low byte and then the high byte. A negative bonus is held as a 16-bit number whose high byte is $FF, so a roll smaller than the penalty comes out as a number near 65,535. The monster's armour roll takes a few points off that. The rest is more than any monster has: the most is about 40,000, for the Night Terror in Finster's mind maze (map 23), and the subtraction from the monster's hit points leaves it dead ($A6CC-$A6DF). A blow in melee adds the same bonus through the engine's own addition ($07C6), which stops at 0, so a punch can do no damage but never wraps.

Only one weapon has dice few enough. An LK of 3 or 4 takes 3 off, so the roll has to be 2: two dice showing 1. Every gun and rocket rolls three dice or more, and explosives leave the luck out, which leaves the Throwing knife's 2d6. With fair dice the knife shows a 1 and a 1 once in 36 throws, and a Throwing knife is used up when it is thrown ($A53A). No loot square in the 42 maps holds one. Christina, who can join the party in downtown Needles, carries one ($40AE).

A new Ranger’s attribute roll makes the low LK easier to come by. Of the 7,776 ways its five dice can fall, 261 give an LK of 3 or 4, where the best three of five would give 6.

06 · The Red Ryder

Secret: the Red Ryder rifle rolls 200 dice, and the game never hands it out

Item 20 in the item table is the Red Ryder, a rifle that takes 7.62mm clips and rolls 200 dice for every hit. The Meson cannon, the gun with the next most, rolls 19. No shop, loot bag, or character in the C64 version holds a Red Ryder, so nobody can fire one without editing the game.

The record is in every copy of the item table ($31A8): a price of 12,345, the Rifle skill, the 7.62mm clip, and a clip of 63 rounds, the most a slot's count can hold. With fair dice, 200 of them come to between 600 and 800 in all but one hit in 30,000. The shot widget above lists it, so it can be fired there.

The way in is closed at every door. Its stock is 0 in all four item tables on the disks, so no shop offers it ($CC5D-$CC95). No loot bag in the 42 maps names it, and none names its class, 4, from which a bag would draw a random rifle ($919C-$921A). No character a party can meet carries one, and no map's own code calls the routines that put an item in a member's slots.

On the PC, players found one. M. Zier's notes on the HQ-Grid's Underground describe a bug in the IBM version's loot bags that hands out items freely, and The best two others are Red Ryders, which are 7.62 rifles with 63 shots, and a range from 600-800 damage, numbers the C64's record matches exactly. Black Raven answered there (16 January 1997) that the bug was the IBM version's alone: it looks like us 64/Apple II users are out of luck. I really wanted those Red Ryders too!

The name is Highpool's too. Two of its messages tell of a child who lies dead near his Red Ryder hat, and of Red Ryder himself, who raises his Red Ryder Range Model Air Rifle (with compass in the stock) and fires! (map 10, messages 27 and 31). His is an air rifle; the item table's takes 7.62mm clips.

07 · Radiation

Bug: armour stops radiation only where the message number is even

A radiation square burns every member of the party who is not wearing a rad suit. The code means armour to be no help against it, and on most squares armour is a help after all: the square's message number decides.

MapSquaresDamageMessageArmour
Map 0, The world map223d6The ground seems to glow here. (23)no help
Map 0, The world map145d6The ground seems to glow here. (23)no help
Map 19, Base Cochise, robot assembly184d6A wave of heat washes over you and the ground shimmers. (28)counts
Map 19, Base Cochise, robot assembly206d6Your eyes tear and a ringing fills your ears. (29)no help
Map 19, Base Cochise, robot assembly2210d6Your whole body feels ready to combust, and your skin itches mightily. (30)counts
Map 20, Base Cochise, the reactor222d6On the floor is an open container of U235. (69)no help
Map 20, Base Cochise, the reactor163d6The floor is covered with Plutonium dust. (70)counts
Map 20, Base Cochise, the reactor64d6A pile of Wastelandium glows brightly here. (71)no help
Map 26, Needles422d6none (0)counts
Map 26, Needles124d6none (0)counts
Map 31, Needles, waste pit and ammo bunker16d6A broken radioactive waste container is lying here buried in the trash. (12)counts
Map 38, Las Vegas, the Mushroom Cloud temple164d6none (0)counts

Every record of a radiation square in the 42 maps, read from the maps' listings: its message (byte 0), its dice (byte 1), and the squares that use it. The messages are decoded by the port in Five bits a letter. A message of 0 shows nothing. Each map opens on the Maps tab.

The world map at night, the party on a radiation square: The ground seems to glow here.

The handler for radiation squares ($82E0) shows the square's message, then rolls the square's dice of damage for each member in turn. A member wearing the rad suit, item 41, is passed over. Before the first member the handler sets the flag at $A0 that tells the damage routine to skip the armour roll ($82E7).

The damage is taken off through a routine shared with the squares that test the party ($9082). For CON, that routine sets the same flag again, from bit 0 of byte 0 of the square's record ($90AF-$90B4). On a square that tests the party, byte 0 holds flags, and bit 0 set means armour is no help. On a radiation square, byte 0 is the number of the message it shows. So the armour roll, one die for each point of the member's armour class ($A8BB-$A8C5), is skipped where the message number is odd, as the handler meant, and made where it is even.

Seven of the twelve records have an even number, among them the 10d6 squares of the robot assembly at Base Cochise. The world map's two records both show message 23, so armour is no help there.

In the emulator, the party stepped onto the world map's 5d6 square with every member's armour class set to 30. With message 23 the four members lost 22, 23, 16, and 14 CON. With the record's byte changed to 22, the armour roll was made four times and nobody lost any.