1984 · Epyx

Summer Games: gameplay

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

How the eight events work, from the code: the grip that sets a vaulter's speed, the seven judges who are really one score cut into pieces, the waggle that is timed, and the stroke that is a rhythm.

02 · The anthems

Music: eighteen anthems and two more tunes

Every country on the chart has its own tune, Epyx included, and a country's number is its tune's number: the U.S.A. is 0, so its tune is the first, and so on (tune_offsets). Numbers 6 and 7 fall between the countries' numbers and hold two more tunes, one for the final standings (6) and one for the world records screen (7). The U.S.A.'s opens with the falling and rising chord of The Star-Spangled Banner (tune_usa).

The player is small. A tune is a list of lines of four bytes, one note for each of the three voices and a length, and every step the player counts down the note and lifts the gates for its last four steps, so each note is separated from the next (music_step). Voices 1 and 2 play a pulse wave and voice 3 a sawtooth. Wherever the engine plays music it calls the player twice a frame.

The game's own player, music_step, run on the site's model of the 6502 over the engine's bytes, twice a frame as the game calls it, after the engine's own set-up (sound_init) and start_tune with the tune's number.

The opening ceremony has its own copy of the player, with a fanfare, and a second tune that it never starts: the same notes as the engine's world records tune (Discoveries).

The ceremony's player, cer_music_step, run the same way, twice a frame as the ceremony's two raster interrupts call it.

03 · The opening ceremony

A torch, a flame, and eight doves

The ceremony is a picture of the stadium with sprites moving over it. The torch-bearer is three sprites, the runner's body, the torch, and its flame, stepping through fourteen frames as the runner goes along the front of the stands and climbs the steps (cer_torch_frames, cer_climb). The torch's little flame flickers because every frame the ceremony writes random bytes into its shape (cer_doves). At the top the runner lifts the torch to the bowl in five frames, the bowl burns, and eight doves fly off, each at its own speed and its own rate of climb (cer_flare, cer_dove_speed). There are more sprites than the video chip shows at once, so the screen is split in two by the raster interrupt, each half with its own eight (cer_irq_mid).

04 · Pole vault

Grip, run, plant, swing, and let go

The pole vault in practice: the stadium under a blue sky, the uprights and blue landing mat on the right, and the line CONTESTANT 4.00M SET BAR HEIGHT at the bottom
Practice starts by setting the height (pv_set_height).

The bar starts at 4.00 metres and goes up to 4.50, 4.80, and then by ten centimetres at a time to 6.20 (height_m, height_dm). Each vaulter has three tries at a height; below 5.00 metres a vaulter may also pass and wait for the next (pv_state1). The bar goes up when nobody is left to try, and the event ends when nobody is left in (raise_bar).

Before each try the vaulter chooses a grip: high, medium, or low. The grip sets the starting speed, highest for the low grip, and chooses one of three sets of tables for the path over the bar (grip_speed, traj_x_high). Fire starts the run. Pulling the stick down lowers the pole, and at the 31st step of the run the pole is planted in the box; pushing up starts the swing, and the speed bends the pole through seven frames while it drains away; fire lets go, and the flight takes half the speed forward and an eighth of it up, with gravity adding to the fall each frame (pv_vault, pv_swing, pv_release, pv_flight).

The bar is a sprite, and whether it falls is decided by the video chip: when the bar's sprite touches the vaulter's or the pole's, the try fails and the bar tumbles to the ground with a thud (bar_step). A vault that clears it and lands on the mat is good, and the height becomes the vaulter's result (pv_vault_over). The whole event runs inside the raster interrupt, as a machine of eight states (pv_irq).

05 · Platform diving

Seven judges, one score

Platform diving: a diver in the air beside the yellow tower, the pool below with seven empty score boxes along its side
A forward dive, with the judges' seven boxes waiting along the pool (flight).

There are four dives, forward, backward, reverse, and inward, and each player makes one of each. A backward or a reverse dive spins the other way, and a backward or an inward dive starts facing the tower; when the way the diver faces changes from one dive to the next, the game mirrors every one of the diver's shapes in memory (dive_flags, mirror_shapes). In the air the stick chooses the body's position, and each position turns at its own rate for each dive: the tuck fastest, then the pike, the half-pike, and the layout slowest (read_position, spin_rate).

The difficulty is counted in tenths while the diver turns. It starts at 0.0 for a forward dive, 0.1 backward, 0.3 reverse, and 0.2 inward; the first three frames in each new position add 0.1 each, and every half-turn adds 0.4 (start_diff, half_turn_bonus). A dive that tries every position and turns often is worth more, as the manual says, though it does not start at the manual's 1.0.

The entry is scored from the pose the diver is in when the water is reached, and only the layout scores: 100 when the body is straight up and down, head or feet first, 80 one frame off, 32 two frames off, and nothing flat. A tuck, a pike, or a half-pike scores nothing at all (entry_base, judge_entry). The spin's progress into the next frame adds or takes a little.

Pose at entry (layout)ScoreSplash
Straight up and down100small, quiet
One frame off80larger
Two frames off32larger
Flat0widest, loudest
Any tuck, pike, or half-pike0bent entry

From entry_base and entry_type; the splash's spread, loudness, and length follow the entry (splash_spread, splash_volume).

The seven judges are that one number cut into pieces. The score is divided into five judges' marks in half points, the remainder handed out one half at a time; one mark plus a little becomes the high judge and another less a little the low judge; then the seven are shuffled before the cards go up one by one (split_judges, high_low, shuffle_scores). Dropping the highest and lowest, as the score screen says it does, gives back the five middle marks, whose sum is multiplied by the difficulty (show_total).

The dive rating screen: judges' scores 7.5 8.0 9.0 7.0 8.0 8.5 8.0; discard high and low to get 40.0; multiply by difficulty rating 1.1; total points 44.00
A forward dive. Without the high 9.0 and the low 7.0, the five middle marks add up to 40.0, and 40.0 times 1.1 is 44.00.

06 · The relay and the dash

Energy in the relay, rhythm in the dash

The 4 x 400 metre relay and the 100 metre dash are one program with two entries, and the byte that tells them apart is the clock's step (relay_start, dash_start). Two lanes race at a time. A player without an opponent runs against the computer pacer, which sprints when it is well behind, coasts when it is well ahead, and otherwise picks at random (pacer). Moving the stick before the gun is a false start, and the second one disqualifies (countdown, false_start).

The 100 metre dash: two runners leaving the line on a yellow track in front of the crowd, the clock reading 00.40, and COMPUTER PACER and ANNA (FRA) at the bottom
The dash against the computer pacer. The track scrolls under the runners as they go (irq_scroll).

In the relay the stick sets a pace: right to sprint, centre to run, left to coast. Sprinting is fast and drains an energy bar, coasting lets it recover, and each leg's runner recovers at a different rate: the first gains 24 points of energy every 32 frames, the second 10 every 16, the third 16 every 24, and the last 16 every 16, the fastest recovery, out of a full bar of 126 (read_sticks, drain_energy, regain_energy). Fire hands the baton on, but only once the incoming runner is close enough to the next (baton_pass).

In the dash the stick is waggled, and what counts is the rhythm. The game keeps the gaps between the last 32 changes of the stick, and a short total moves the runner forward while a long one, or a stick left still, lets him drift back (dash_move, waggle_ring).

Neither clock keeps real time. The dash's adds a hundredth of a second every frame, so on a PAL machine, at 50 frames a second, a ten-second dash takes twenty; the relay's adds 0.11 seconds every second frame, so its minutes pass nearly three times as fast as real ones (race_clock).

07 · Gymnastics

The vault, scored from 6.9

Gymnastics: a gymnast standing at the end of the run-up in a hall, the springboard and the horse ahead, the crowd behind, and the score board above
The vault, ready to start (wait_set).

The gymnastics event is the vault over the horse, twice for each player. Holding fire gets set, and letting go starts the run (wait_set). Fire again, near the end of the run-up, jumps for the springboard: met early enough, the take-off is good, met late it is poor, and missing it is a fault; a second miss ends the turn with no score (run_up, board_jump, miss_count). How far short of the board's sweet spot the gymnast lands sets the height of the spring, and left or right on the board adds a half twist (on_board).

On the horse the body turns over the hands until fire pushes off; the sooner the push, the less the gymnast is thrown back (push_off). In the air the stick forward tucks, the centre lays out, and back opens into the landing pose (flight, landing_pose). The rise and the fall are the same code: at the top of the flight the program rewrites its own DEC instructions as INC (rise_fall_op).

The score starts at 6.9. It loses a tenth for every frame spent in the landing pose, gains 0.8 for every half turn and twist, and loses twice the spring's shortfall in height; it cannot go below zero (blank_board, final_score). A vault with a full spring, two half turns and a twist, held in the landing pose for 12 frames, scores 6.9 − 1.2 + 2.4 = 8.1. A landing that leans costs a tenth and must be saved with the stick within 31 frames, and a fall costs 3.0 (land_lean_fwd, crash). A lean that is not saved ends in the fall, yet costs less than a fall on its own (Discoveries). The two vaults are added together (save_score).

08 · The freestyle relay and the 100 metre freestyle

A stroke in time with the arm

Swimming: PRESS BUTTON, CONTESTANT, LANE: 2 at the top, the stands, and the pool with its numbered blocks and lanes marked by red ropes
The swimmers step onto the blocks one by one, each with a press of fire (wait_blocks).

The swimming program is the largest in the game. It unpacks over the engine itself, so before it starts it saves the players and the engine's state high in memory, and it copies its own code under the KERNAL's ROM, which it switches out (sw_relocate, sw_init). The pool is a map of 100 columns by 20 rows, scrolled sideways through two screens and two character sets: while one is shown, the other is built a column further on (pool_map, scroll_left0).

After "SET:" and "GO!", pushing right dives in; moving first is a false start, and the third disqualifies (dive_start, check_false). The stroke is a rhythm. Each time an arm enters the water, the last three presses of fire decide whether the swimmer speeds up or slows down: a press at the right moment is a power stroke, a mistimed one costs speed (stroke, stroke_bonus). At the far wall, pushing left turns, and the closer to the wall the turn is made, the longer the glide that follows (wall_check, turn_glide_len). In the relay, pushing right at the wall hands over to the next swimmer (swimming).

09 · Skeet shooting

Twenty-five clays, always the same ones

Skeet shooting: a green field under a blue sky with hills and trees, a trap house at each side, the yellow arc of eight shooting stations, the round gun sight, and SKEET SHOOTING, TARGETS and HITS below
The skeet field. The gun sight is a sprite, and so is each clay and its shadow (Graphics).

Each shooter walks the arc of eight stations and shoots 25 clays. Which clays fly at each station is a fixed list: a clay from the left house, one from the right, or both together as a double, and with the doubles counted twice the list comes to 25 every time (sk_station_list). Each clay follows the same path too, a table of positions for each house (sk_left_x, sk_right_x). The first press of fire pulls, and the next shoots; a single gets one shell and a double two (sk_pull, sk_fire).

Left alone, the sight droops, a step lower every eight frames, so the aim needs constant correction, as the manual warns (move_sight). A shot is a filled disc the size of the sight, shown for one frame; any clay it touches, by the video chip's sprite collision, is a hit and shatters through four frames (sk_flash_end, break_clays).