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.

Fourteen people in the maps can join the party, and every one of them is as obedient as the next. A new Ranger’s attributes are meant to be the best three of five dice, and a slip in the sort loses the best dice instead.

01 · Characters

The NPCs, record by record

Fourteen people in the 42 maps can join the party. Each is a 256-byte character record kept in the map that holds them, laid out like a Ranger's and copied whole when they join ($A42C). Most of it shows on the character screen once they have joined. Two things never do: a skill outside the 35 that the maps test to know who is in the party, and the rule that decides whether they join at all.

CharacterFound inJoinsHidden skillWhat asks for it
Felicia $43B8Map 4, Quartz, Ugly's hideoutwithout dice39nothing in the 42 maps
Ace $44B8Map 4, Quartz, Ugly's hideoutwithout dice38The broken-down jeep on the world map: Ace fixes the jeep and you're on your way. Also a jeep in Needles (map 34) and a square in Ugly's hideout.
Mayor Pedros $43A0Map 6, Quartz, the courthousewithout dice36Seven squares in Quartz (maps 2, 3, 4, and 6), among them a guard in the courthouse: I see you've rescued Mayor Pedros, I will help you get him out of here if you wish.
Dan Citrine $44A0Map 6, Quartz, the courthousewithout dice37Four squares in the courthouse, his father's cell among them, and 83 more in 27 other maps (below).
Jackie $3E58Map 10, Highpoolwithout dice41nothing in the 42 maps
Vax $3FC2Map 19, Base Cochise, robot assemblywithout dicenone
Mad Dog Fargo $3EAAMap 21, Darwin Villageon a thrownone
Metal Maniac $3FAAMap 21, Darwin Villageon a thrownone
Ralf $3FF2Map 27, Temple of Bloodon a throw42nothing in the 42 maps
Christina $40AEMap 32, Needles downtown, Leroy'swithout dice43nothing in the 42 maps
Mort $4048Map 34, Needles, police station, gas station, churchon a thrownone
Redhawk $3F98Map 36, Guardian Citadel, the Outer Sanctumwithout dice48The Junk Master in Savage Village (map 49), who listens only to a party with Redhawk or a Grazer bat fetish in it: For some reason the Junk Master won't listen to you.
Dr. Mike Scot $4544Map 38, Las Vegas, the Mushroom Cloud templeon a thrownone
Covenant $40F5Map 40, Las Vegas, jail and Fat Freddy'swithout dice40The concrete block that seals a room of the jail: Covenant presses certain sections on the wall beside it, and it slowly sinks into the floor.

Every record in the 42 maps' lists of characters who can join, read from the maps' listings, with the address of each in its map. Joins is record byte +$31: 0 joins without dice, and 2 or 3 throws for it (below). Hidden skill is the record's last skill pair, +$BA and +$BB, at level 255. Each map opens on the Maps tab.

The hidden skills are numbers 36 to 48, one to a character. The skills page lists a skill only when its number is below 36 ($11A7), and so does a Use, so nobody playing sees them. A check square that asks for one finds it all the same: the search for a skill reads all 30 pairs ($1392), and at difficulty 0 knowing a skill is enough, with no dice ($8EAE). Felicia, Jackie, Ralf, and Christina carry hidden skills that no square asks for.

Dan Citrine's skill, 37, turns up far beyond the courthouse. Four squares there ask for it, among them the cell where his father waits: He sees Danny and says, "Thanks for rescuing me, son. Here's the money. I must run now." Another 83 check squares in 27 other maps test skill 37 and nothing else, and 60 of them take CON when they fail. No Ranger can have it: the Ranger Center sells skills 1 to 35 ($8502), and no library in the 42 maps teaches one above 35. So for anyone else those checks always fail. Dan has the skill at level 255, so he passes them, at once at difficulty 0 and on any throw of 5 or more above it. Per Jorner's guide lists this among its cheats as a recurring error in the game's "scripting": with Dan in the first party slot he'll mess up or nullify many hazards in the game, ranging from humble cactuses to lethal traps (page 81). The first slot matters where the first conscious member is tested for the whole party. On map 1's cactus every member is tested, and on the kit's 6502 simulator the game's check code ($8E14) ran it 1,000 times for a party of a Ranger and Dan. The Ranger was hurt every time: You've walked into a cactus. The spines poke you and hurt a lot. Dan was hurt 107 times, each time on a throw under 5.

Nine of the fourteen join as soon as they are asked while the party has room. The other five, Mad Dog Fargo, Metal Maniac, Ralf, Mort, and Dr. Mike Scot, throw the open 2d6 first ($A435). Their side is (CHR + IQ) / 2, plus their rank, plus record byte +$31. The hirer's side is (CHR + IQ) / 2 plus CHR plus rank, plus the throw, and a throw under 5 fails whatever the sums. The manual says only that charisma affects how an NPC will react to you when you want to hire him or trade equipment (page 4). Per Jorner writes in his guide that he has never seen an NPC resist more than one recruiting attempt (page 49). On joining, +$31 becomes the hirer's CHR ($A492), and nothing else writes it. The next section is about what that number is for.

In a fight an NPC takes no orders ($B500). It picks a group in reach at random, and its own fire mode. With a gun that fires bursts, it fires a single shot when fewer than 3 rounds are left and a burst at exactly 3. With more, a number from 1 to 10 against a table decides between a burst and automatic fire ($B4F8), and the table is read by how many characters are not conscious: never automatic while all are, then 2 in 10 with one down, 4 with two, 6 with three, 8 with four, and always with five, six, or seven. The manual says only that NPCs don't always do as told in combat (page 12). Per Jorner's guide passes on a report that Christina likes to fire full auto a lot (page 50). The code gives her no choice of her own: the gun and the characters who are down decide, the same for every NPC.

02 · Refusals

Bug: every NPC is as obedient as the next

Each record has four bytes meant to make that character more or less willing: one for using a skill, one for an item, one for an attribute, and one for giving an item away. The check that reads them loses the byte before it is used, so the target is 15 for every NPC. Only Redhawk is different. His trade byte is 255, which is tested first, so he never gives an item away.

The NPC's check

  1. $0D67B1 66LDA (character_ptr),Y: the byte
  2. $0D69C9 FFCMP #$FF
  3. $0D6BF0 3BBEQ refuse
  4. $0D6DAATAX: X = the byte
  5. $0D6E20 95 07JSR num2_clear: LDA #$00, TAX, so X = 0
  6. $0D7120 67 08JSR target_15_plus_5x: 15 + 5 × X

A skill check

  1. $0C2F20 95 07JSR num2_clear
  2. $0C32A2 00LDX #difficulty, written at $0C2C
  3. $0C3420 67 08JSR target_15_plus_5x: 15 + 5 × X

Two places in the engine that make a target, from the Source tab. The skill check loads X after the clear; the NPC's check loads it before, and the clear empties it. The attribute check does it the skill check's way ($0D1B-$0D20). In the emulator, booted from the original side 1, the engine's own check ran 256 times with a byte of 10 and a CHR of 20: the target it computed was 15 on every call, where 15 + 5 × 10 is 65.

The check is $0D61. It reads the byte, refuses at once on 255, and moves the byte into X for $0867, which returns 15 + 5 × X. In between it calls $0795 to clear the target, and that routine leaves 0 in X as well as in A. So a request is refused on a throw under 5, and otherwise when the throw plus one number falls short of 15. For a Use, that number is the NPC's own byte +$31, the hirer's CHR at the moment of the hire ($8D8E). For a trade, it is the CHR of the character taking the item ($0F70). With a CHR of 10 or more only the throw under 5 is left, one request in nine with fair dice and 13.1% with the game's, and that is the same for every NPC, Redhawk's trades aside.

The bytes still move. A refusal on a throw under 5 raises the byte by one, up to 10 ($0DA2), and a request carried out lowers it one time in 20 ($0D92). A hire lowers the three Use bytes by one for every 4 points the hirer's side beat the NPC's ($A496). Nothing reads them except the test for 255.

The manual promises more. NPCs don't always trade something when you ask them to, it says (page 12), and they have a mind of their own and may not always want to give their items away (page 6). Per Jorner's guide says that they sometimes refuse to trade away equipment or perform an action, and that over time they become less prone to rebellion (page 49). On the C64 the bytes that would do that go up and down, and the check never reads them. The guide is right about Redhawk, who will never trade anything away while conscious (page 52): an NPC who is not conscious is not asked ($0F63).

– chance to obey

The chance is exact for fair dice, as in the checks, and the second line gives it for the game's dice. Ask runs the NPC's check, ported from the engine ($0D61, $0F63) and the game ($8D83, $A435), with the dice of the checks. On the kit's 6502 simulator the port and the original code were given the same random bytes for 38,528 checks, trades, and hires, and gave the same answers, left the same bytes in the record, and used the same random bytes. The slider sets the byte, which moves only the target the code meant. The table is the NPC's four bytes as its map holds them, and as the requests change them.

03 · Creating a character

Bug: the attribute roll that loses its best dice

A new Ranger's attributes are meant to be the best three of five dice. A slip in the sort loses the best dice instead, and the roll averages barely more than three dice would.

Creating a character at the Ranger Center rolls ST, IQ, LK, SP, AGL, DEX, and CHR, then MAXCON as one more roll + 18 ($7FDD). Each roll throws five dice into five slots, the first in slot 4 and the last in slot 0 ($8382). Then an exchange loop moves larger dice up into the higher slots, and the roll adds slots 2, 3, and 4 ($83B0). Sorted properly, those would be the best three of five.

The sort goes down from slot 4 to slot 1. Each pass loads the die in its slot once ($8397) and compares it with every slot below. When a slot holds a larger die, the two change places. The pass should now go on with the larger die it has just taken in. Instead, the branch at $83AB goes back to the compare, so the pass keeps comparing the small die it loaded. A second exchange in the same pass then writes over the larger die that moved up, and the small die ends up in two slots. Thrown in the order 1, 2, 3, 4, 5, the slots end as 1, 1, 1, 1, 5, and the roll is 7 where the best three make 12.

Thrown, in order
In hand

The game's roll
The best three
What a working sort leaves
the game's rollthe best three of fivethree dice, for comparison

The ranger program's routine, ported step by step: in hand is the die the pass loaded, slot X is outlined in blue and the slot it is compared with in amber. The port was run against the original code on a 6502 simulator for every one of the 7,776 ways five dice can fall, comparison by comparison, and again for 3,000 throws with the game's own dice routine; every slot and every sum matched.

Over all 7,776 throws the roll averages 10.62, barely more than three plain dice at 10.5, where the best three of five would average 13.43. The roll comes out lower than the best three in 72% of throws and is never higher, so a new Ranger's seven attributes lose about 20 points between them on average. Watched in the emulator, 32 rolls at the Ranger Center ended slot for slot as the loop predicts, and 21 of them came out below the best three of their dice.

04 · Promotion

Nobody is promoted past rank 181, Supreme Jerk

A Ranger is promoted at the radio once the experience reaches 512 × k × (k − 1) for rank k. Experience is a 24-bit number, and from rank 182 on that threshold needs 25 bits, so the climb stops at 181, whose name is Supreme Jerk.

The radio tests each conscious Ranger in turn ($7F1B). Each rank costs 1,024 more experience than the one before: 1,024 to reach rank 2, 3,072 for rank 3, and 6,144 for rank 4. After a promotion the test runs again ($7FFF), so one call can promote a Ranger several times, with two points to spend each time. The threshold is worked out in three bytes, and one too big for them means no promotion ($7F46, $7F56). Rank 181 needs 16,680,960. Rank 182 would need 16,866,304, past the 16,777,215 that three bytes hold, where experience itself stops growing ($0825).

RankNameExperience to reach it
1Private0
2Private 1st class1,024
3Specialist3,072
4Senior Specialist6,144
5Corporal10,240
6Lance Corporal15,360
7Command Corporal21,504
8Grenadier28,672
9Fire Grenadier36,864
10Grenadier Major46,080
11Master Grenadier56,320
12–13Sergeant67,584
14–15Technical Sergeant93,184
16–17Sergeant Major122,880
18–19Master Sergeant156,672
20–21Sergeant Argent194,560
22–23Cadet236,544
24–25Cadet Specialist282,624
26–27Combat Cadet332,800
28–29Command Cadet387,072
30–322nd Lieutenant445,440
33–351st Lieutenant540,672
36–38Lieutenant645,120
39–41Fireteam Lieutenant758,784
42–44Lieutenant Argent881,664
45–47Captain1,013,760
48–50Combat Captain1,155,072
51–53Tech Captain1,305,600
54–56Command Captain1,465,344
57–59Captain Argent1,634,304
60–62Major1,812,480
63–65Fireteam Major1,999,872
66–68Specialist Major2,196,480
69–71Technical Major2,402,304
72–74Major Argent2,617,344
75–78Lance Colonel2,841,600
79–82Lieutenant Colonel3,154,944
83–86Fireteam Colonel3,484,672
87–90Division Colonel3,830,784
91–94Colonel Argent4,193,280
95–98Lance Commander4,572,160
99–102Lieutenant Commander4,967,424
103–106Commander5,379,072
107–110Technical Commander5,807,104
111–114Force Commander6,251,520
115–118Brigadier General6,712,320
119–122Lieutenant General7,189,504
123–126Major General7,683,072
127–130Technical General8,193,024
131–140General Argent8,719,360
141Imperial Scarscalp10,106,880
142–150General Argent10,251,264
1511st Class Fargo11,596,800
152–160General Argent11,751,424
161Photon Stud13,189,120
162–170General Argent13,353,984
171Revenant Argent14,883,840
172–180General Argent15,058,944
181Supreme Jerk16,680,960
182–255never reached16,866,304 for 182, past 16,777,215

Every rank a Ranger can reach, with the name the radio's table gives it ($81D8) and the experience at which the radio promotes into it. A new Ranger starts at rank 1. The five names that break the run of General Argents are marked.

The table of names has an entry for every rank from 0 to 255. Ranks 2 to 11 have a name each, the names after that last two ranks, then three, then four, and from 131 every rank is General Argent but five: Imperial Scarscalp at 141, 1st Class Fargo at 151, Photon Stud at 161, Revenant Argent at 171, and Supreme Jerk at 181. Past 181 the five come round again every ten ranks to 231, and once more at 251 to 255, out of reach. When a promotion keeps the old name, the radio says the Ranger is still a Sergeant or a Captain ($7FBB).

The fans counted the same ladder. Rangers had told the HQ-Grid's Underground for years that there were 183 ranks, until K. Reimer showed (11 September 2010) that there are 181, as the C64's code has it. The site's list matches the C64 rank for rank, but for ranks 30 to 41: the C64 runs 2nd Lieutenant, 1st Lieutenant, Lieutenant, then Fireteam Lieutenant, and the list Lieutenant, 1st Lieutenant, Fireteam Lieutenant, then 2nd Lieutenant. K. Ballou (14 May 1998) found the cost of the climb with the Night Terror's 64,000, which will give each char several promotions the first time, but it gets to a point where you only get one promotion per 64000 exp. On the C64 the first such kill takes a new Ranger from rank 1 to 11, and from rank 63 on a kill no longer pays for even one promotion every time.

05 · Libraries

Bug: a library pays 64 skill points for a seventh level of Energy weapon

A library sells a level of a skill for skill points, at a price that doubles with each level. When the price is far above the points, the subtraction wraps round, and the Ranger walks out with more points than before and the level besides.

The price of the next level is the skill's base cost, 1, 2, or 3, doubled once for each level already learned, and 255 once that passes 255 ($CBF7). To train, a Ranger needs at least the base cost in points ($CA9C-$CAAB) and a level below the rank ($CAEE-$CAF2). The library then takes the price from the points and refuses only when the remainder has its top bit set, the sign of a negative byte ($CB03-$CB07). A price of 128 against fewer points leaves a remainder with that bit set, and is refused. A price 129 or more above the points wraps past 0 into the positive half again: a price of 192 adds 64 points, and a price of 255 adds 1.

Base costSkillsFrom level 6From level 7From level 8 on
1Every weapon skill but Energy weapon, and Climb, Swim, Perception, Acrobat, Gamble, Picklock, Silent move, Confidence, Sleight of hand, Demolitions, Forgery, Alarm disarm, and Bureaucracy64: as it should128: refused255: +1 point
2Bomb disarm, Medic, Safecrack, Cryptology, and Metallurgy128: refused255: +1 point255: +1 point
3Helicopter pilot, Electronics, Toaster repair, Doctor, Clone tech, Energy weapon, and Cyborg tech192: +64 points255: +1 point255: +1 point

The price of the next level, and what paying it does to a Ranger with fewer than 128 points. The base costs are the library's skill table ($CC6C). Below level 6 every price is 96 or less and works as it should. With 64 to 127 points a Ranger is refused the price of 192, and with 127 the price of 255, since the remainder would reach 128.

The fans found the 255 first. M. Zier's super skills, on the HQ-Grid's Underground for the C64 and DOS, describe a library that shows a 255 to increase it, where a raise will add a skill point, up to your level, the rank. S. Hunter added (24 April 1998) that skills like Energy Weapon require only level 6, the level whose price is 192. Clem the Hick, on a C64, saw characters come away with 68-71 skill points: the 64 that a price of 192 adds, on top of the 4 to 7 they brought in. It didn't always work, which fits the rank rule: a level must be below the rank before a library sells it.