DYSTOPIANPIXEL

playerControl Driver

From the first movement experiments to the V1 release and plans for what comes next.

playerControl Driver artwork
Illustrative Z80N code and movement schematic for playerControl Driver.
Planning beyond one player

With V1 available, the next question is how playerControl can support more ambitious games without losing the clear division of work that made the first version useful. The V2 direction includes up to four players, with independent settings and controls, while preserving the established walking, jumping, climbing and fall reporting.

The discussions with the other driver projects have helped clarify ownership. scrollingControl supplies camera, terrain and moving-platform information. playerControl uses that information to resolve the player’s movement, including slopes, external pushes and continuing forces. BASIC remains responsible for lives, death, respawning and the wider game rules.

World boundaries are part of that agreement. Each player needs movement limits and a report when an edge is first reached, without repeatedly generating the same event while the player holds against it. Temporary input disabling, landing bounce, optional blocking between players and sprite magnification also belong to the planned work.

The existing 50 Hz behaviour remains the reference. Consistent behaviour at 60 Hz still needs investigation and hardware proof. These are plans for the next version, not additions already present in the released V1 driver.

The earlier shipControl discussions also explored a shared approach to player-owned weapons, projectiles and damage across playerControl, shipControl and enemyControl. That was a future ecosystem direction, separate from the released platform movement. The important boundary remains that the drivers report outcomes while BASIC decides score, rewards and the consequences for the game.

Making the release maintainable

Publishing the driver was not quite the end of the release work. I also wanted the source, documentation and licence to form a package that I could maintain and other people could understand.

The reconstruction work checked the source against the hardware-tested release rather than using the opportunity to change its behaviour. Matching that working binary mattered: a tidier source tree would not be much help if it quietly produced a different driver.

The early experiments had started with Simon N Goodwin’s SpriteHax material, as the original development article records. The later source comparison did not identify a remaining code dependency on those routines in the release. That review informed the decision to distribute the completed work under the MIT licence; it should not be confused with a claim that reconstructing source is itself a clean-room audit.

By 17 October, the licence had been added to the itch.io ZIP and the repository had been tidied. Linking the README to the Dystopian Pixel tutorial gave people a route from downloading the driver to understanding how to use it.

Preparing the first public release

Once the V1 hardware checks passed on 6 October, attention moved from making the driver work in my game to making it approachable for somebody else. The initial release package and itch.io listing were prepared privately while the supporting material took shape.

A useful demonstration needed to stand on its own. I asked for a small BASIC programme, the driver, generic player sprites and a simple level, arranged in a straightforward folder structure. The sample artwork used a changing ball for the animation and clear platforms and ladders, so readers could see the driver’s behaviour without needing The Lost Caverns assets.

The sample map also needed matching collision information. A visible platform is not enough if the driver has not been told that it is solid. The demonstration was updated for ordinary ladders and blocked ladder sections as well as the platforms.

On 14 October, playerControl Driver V1.0 was published on itch.io. The accompanying explanation introduced the driver, sprite and map files, and the BASIC demonstration. It was a milestone of its own: something developed to solve a problem in one game was now available for other people to try.

Putting the joystick in control

Keyboard control was only part of the intended V1 experience. I wanted games to offer keyboard input, a Kempston joystick, or both together, without needing separate movement code for each choice.

A single-button joystick raised a practical question: how should the player sprint while keeping the button available for jumping? Double-tapping the direction of travel provided a useful answer. Ladder sprinting needed to feel consistent with the rest of the controls too.

The first joystick test did not move the player, so it was important to prove each behaviour rather than assume that adding an input option had completed the job. The later hardware tests confirmed walking, running, jumping, super-jump when enabled, climbing and ladder sprinting. Keyboard and joystick operation also worked together.

One apparent combined-input problem turned out to be mixed-up configuration values. Checking the settings restored the expected behaviour. Kempston was the hardware I could test; I did not treat untested joystick types as supported merely because there was room for them in the design.

A reusable driver

By 4 October the movement behaviour was stable enough to turn the remaining fixed choices into settings. This was the point where playerControl began to become useful beyond the particular character and level layout in The Lost Caverns.

The configuration work covered the player’s starting position and direction, movement boundaries, walking and climbing speeds, gravity and jumping, sprite selection and animation. Controls also needed to be redefinable rather than tied permanently to my preferred keys.

Each group was introduced and checked on hardware. Initial and idle artwork needed separate attention, and enabling the driver after setting the starting position gave the expected result. Changing animation and movement settings made it possible to explore different effects without rebuilding the driver.

The work also exposed how easy it was to confuse an older enable setting with the new super-jump setting. Keeping those responsibilities clear mattered as much as adding the parameters. By 6 October, the configurable V1 behaviour and input checks had reached the point where release preparation could begin.

Measuring the fall

I wanted dangerous falls to be measured consistently before making the remaining settings configurable. Walking off a platform and jumping from it are not the same fall: a jump begins its descent from a higher point, and a super-jump can make that difference larger.

The driver therefore measures a completed descent from its highest point. BASIC can then decide what the result means for the game. With a safe limit of six tiles, for example, six remains safe and seven becomes dangerous; the driver’s report does not itself have to remove a life.

The hardware checks matched one-, five- and six-tile drops. Standing normally should not create a fall, climbing down is not falling, and catching a ladder cancels an unfinished descent. The crashes and interrupted animation encountered during these checks were corrected before the result was accepted.

Super-jump was restored as a separate checkpoint. When enabled, a fresh press while rising gives one extra boost. Holding the button cannot repeat it, and walking off a ledge cannot start it. The completed-fall measurement and the enabled and disabled super-jump cases passed before development moved on.

Getting ladders to behave

Ladders became one of the most demanding parts of the controller. Moving up and down was only the beginning. The player also had to leave sideways, jump away, land on the top and respect a broken section without being pulled back or snapped to another position.

The September tests exposed several awkward combinations: a blocked ladder beside a platform, landing on a shorter ladder, and leaving a ladder while changing direction. At times a correction helped one case but disturbed another. Returning to a known working build and checking one change at a time became essential.

By 22 September the movement was feeling smooth and slick, but later checks still found problems at ladder tops. The late-September checkpoints restored floor jumping and highlighted the difference between landing on a ladder and deliberately climbing it. Landing should not automatically switch the player into a climbing pose.

The final checks on 4 October established the intended rules. The player could jump away to either side while climbing, but not jump straight up the ladder body. Normal vertical jumping worked at the top, including after climbing there. Abandoning a sideways departure no longer unlocked an unintended jump. With those transitions working, fall measurement could finally be tackled on a dependable foundation.

Making animation follow movement

A character can move correctly and still look wrong. The next problem was making the visible artwork agree with the movement state: climbing frames on a ladder, ordinary frames when leaving it, and no unnecessary switching while standing still.

This work helped me understand the difference between a hardware sprite slot, an image stored in an asset bank and a live pattern used for drawing. Changing one is not necessarily the same as changing another. The player’s climbing artwork needed to be available in the right place and selected at the right moment.

A separate roof-acid test made that distinction clearer. Loading the correct bank and choosing the stationary animation setting produced the expected result. It was a useful lesson for the player too: shared sprite-pattern space needs to be managed deliberately.

The wider game also needed room for exit gates, acid, flames, bullets and moving platforms. Keeping the exit frames available and loading other object artwork only where needed was still a proposal at this point. For playerControl, the immediate task remained reliable transitions between climbing and normal animation.

Jumping without surprises

The early jumping tests showed why a platform controller needs more than an upward movement. Hitting the underside of a platform could leave the player stuck, and a bad vertical position could send the sprite beyond the playing area and back from the opposite edge.

The tests gradually brought ordinary jumping, gravity and ladder departures into agreement. Broken ladder sections had to remain obstacles, including when jumping away to the right as well as the left. Super-jump then added another combination to check rather than replacing those ordinary rules.

I wanted super-jump to be optional, with the possibility of a collectible enabling it temporarily in the game. That meant the driver needed a controllable ability rather than an extra jump that was always available.

An apparent collision problem also revealed a mismatch with the intended map dimensions. The first game used a 16-by-12 layout, and changing that would have meant redesigning existing levels. Correcting the assumption preserved the game’s layout and restored the expected movement boundaries.

Movement beyond the BASIC loop

The first movement-driver experiments were about keeping the player responsive while BASIC continued with the rest of the game. Moving the frequent control work into regular machine-code updates was promising, but it still needed to understand the same room that the game was drawing.

The early checks covered ground movement, horizontal jumping and holding the player at the top of a ladder. They also exposed cases where the player fell through a ladder top or failed to catch a ladder during a jump. Each working result became a checkpoint rather than proof that the whole controller was finished.

A particularly useful discovery came when changing levels. The visible map changed, but the driver’s collision information did not automatically change with it. Refreshing the solid and ladder masks when the room was built made the movement agree with the new level.

I renamed the integration procedures to setupPlayerMovement and refreshTileMasks to match the rest of my programme. On 11 September, that refreshed-mask approach was working correctly and became the baseline for the next jumping tests.

Why I’m building playerControl

Original article from 10 September 2026, with its 15 September additions preserved. It describes the early development stage; later panels record the subsequent release and source review.

When the game outgrew its controls

playerControl began because The Lost Caverns was getting bigger. With more enemies, collectibles, collision checks and game logic, player control slowed to around 6–7 frames per second. It was still working, in the sense that the character eventually did what I asked, but it no longer looked or felt like a playable game. The pauses made it difficult to judge a jump or react to what was happening.

I didn’t want to give up the convenience of NextBASIC for building the game. I wanted to give it less work to do between player updates. The answer I’m exploring is a machine-code driver that takes over player control, leaving BASIC to provide the structure. The Lost Caverns is the first project the driver was developed for and used in, and it continues to provide the test of whether those changes make the game better to play.

What the driver is taking on

The intended scope includes keyboard and joystick input, walking, running, slowing down, facing direction, jumping, gravity, falling and landing. There are ladders to enter and leave, walls and ceilings to respect, and animation frames to switch as the character’s actions change. Temporary effects, such as a springboard giving the player a bigger jump, need to work with those rules too.

The foundation is Simon N Goodwin’s SpriteHax solution. His routines are the starting point for this work, with playerControl building on them for a 2D platformer. Simon’s Next Tech: Get the Best from your ZX Spectrum Next explains his slot driver and Sprite Hacks, including regular sprite updates and efficient movement calculations. Credit for the original routines belongs to him.

Buy Simon’s Next Tech book ↗ Book details and companion files ↗ Download Simon’s SpriteHax code ↗

Where the improvement should come from

Machine code avoids the repeated interpretation of BASIC statements for the work it takes over. Regular, interrupt-driven updates are intended to give the player a more consistent response as the rest of the game gets busier. Preparing compact collision masks when a room is created is another part of the approach: the driver receives the information it needs without BASIC having to describe the whole room for every movement.

There is still only one processor doing this work, so the driver has to use its time carefully. The original 6–7 fps observation explains why I started; it is not a benchmark of the current build. I still need a repeatable comparison before putting a figure on the improvement.

The current job: climbing patterns

The working game still contains BASIC control and collision routines alongside the driver. I’m currently connecting the player’s ladder movement to its sprite-pattern switching: loading the climbing frames on entry, avoiding repeated copies while climbing, and bringing back the usual frames on exit.

Damage, death, respawn and jumping away from the ladder all need the appropriate result. Those details matter just as much as speed. I want a controller that feels consistent, rather than one that is quick until the player does something unexpected.

The Ideas pages for current progress and known issues follow that work. There is no standalone driver release yet.

Current driver progress ↗ Ladders and sprite-bank development notes ↗