1986 · Activision

Alter Ego

This minisite was contributed by air, 64kramsystem. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/alter-ego with me to Gold.

When Old Age ends, the next life is born with the personality the last one died with. And a saved life comes back from the disk without the months since its last birthday, so it gets those months to live again.

01 · Reborn

Secret: after Old Age, the next life is born with the same personality

When Old Age is over, the game moves on to the phase after the seventh, and that phase is Infancy (finish_life_stage, $8CFF). The new life starts in the womb, as every life does, but the twelve traits are the ones the old life ended with, and the name stays too. The game clears everything else about the old life: the job, the money and the debt, the age, the possessions and the flags its scenes set (the 88 bytes from $7F58, the numbers 12 to 55).

A brown panel over the map of Old Age: the last thing you see are players from both benches running out to greet you, ending How you only wish you could have said good-bye
The last scene of a life, at 70.
Do you wish to: CONTINUE, SAVE GAME, RESUME GAME, QUIT, DISPLAY STATUS, THEN ASK ME AGAIN
The menu that ends every phase.
A brown panel on a red border: You are in a warm, dark, comfortable place, then CONTINUE
The next life's first page, the border back to Infancy's red.
TraitAt 70, in Old AgeNewborn
Calmness1212
Confidence4343
Expressiveness4949
Familial5050
Gentleness77
Happiness2525
Intelligence5050
Physical4545
Social8080
Thoughtfulness55
Trustworthiness2828
Vocational5050

The original program, Old Age chosen at the start and then played with keys pressed at random. The life ended at the age of 70. At the menu the keys picked SAVE GAME and then Cancel, and the new life began anyway: the game has already moved the phase on before it acts on the menu's answer. The traits are the twelve numbers at $7F40, read as the last scene began and again on the new life's first page.

The new life is not quite a clean slate in one more way. The four bytes at $7FC0 record which scenes of the lifelong choices have been played, one bit each, and the new life starts with them set to 00 00 70 2A: six scenes already marked as played. A life can also end before Old Age, when a scene ends with the value 253; the game then sets the phase to 7 and ends it, so that the same rebirth follows (play_life_map_cell, $8A85).

02 · Saving

Bug: a resumed life loses the months since its last birthday

The age is kept in two parts: whole years at $7F74, and the fraction of a year since the last birthday at $7FC4, which the scenes add to and the LIFE TIME screen shows as months. A save holds seven stretches of memory (transfer_save_slot_state, $4E0F), and the fraction is not one of them. A life resumed after a fresh start comes back at its birthday, with 0 months.

LIFE TIME: YEARS 0, MONTHS 3, RETURN TO GAME
Before saving: 0 years and 3 months.
LIFE TIME: YEARS 0, MONTHS 0, RETURN TO GAME
The same life resumed: 0 years and 0 months.

The original program: Infancy played from a new game until a scene moved the fraction to $4703, three months, then saved in the first place and quit. The machine was started again and the life resumed from the title's menu.

The lost months come back as time to live. The years move on only as scenes are played, and a phase ends when the age passes its last year, so a life saved just before a birthday and resumed lives almost all of that year again, with scenes to fill it. A life resumed from the menu without starting afresh takes the fraction of whatever life was being played before.

03 · Memory

Bug: the memory allocator says yes to a request so large that the sum wraps round

The game keeps loaded objects in a heap that grows upwards from $8465, while the program's stack grows down towards it. The allocator adds the size asked for to the heap's 16-bit pointer and refuses only when the end would come within 256 bytes of the stack (AllocateVmHeapBlock, $6E70). The sum wraps round at 65,536, so a request large enough to pass the top of memory gives a small end, which passes the test, and the heap's pointer moves backwards. The game never asks for that much. Try a size against the heap at $C465 and the stack at $CDF6.

The limit is the stack's address less 256, $CCF6. The game's own routine, given these sizes on their own, accepts 2,193 bytes, refuses 2,194, and accepts 15,259, which leaves the pointer at 0.

04 · Name

Secret: the name takes sixteen letters and ignores any more

Please enter your name: followed by savabcdefghijklm

The name is kept in 16 bytes at $82CB (EditMenuTextOrSelectEntry, $511C). Letters typed unshifted are stored in lower case and shifted ones in upper case, and DEL takes the last one off. Once the sixteenth is in, further letters change nothing, and RETURN accepts the name. A name of 16 letters fills the field with no end marker after it, and every place that shows the name copies at most 16 bytes, so it shows whole.