Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AsciiWorldEngine — the wordmark with a setback tower standing in place of the second I, a cyan full stop closing the word and a skyline beneath it, over the tagline: a walkable city in your terminal

With thanks to Grow Now! Games, the inspiration for this project.

CI status latest release license: PolyForm Noncommercial 1.0.0


A cyberpunk city, drawn out of characters, that you can walk around in — down the avenues, in through the doors, up to the rooftops. There is no engine underneath it: the world, the camera, the projection, the raycaster, every glyph and every colour are written from scratch in Rust and painted straight into your terminal.

It is not a screensaver and it is not a video. It is a real 3D world, generated as you move through it, running faster than your monitor can show you.

a street

Key details

Native Rust one crate, and exactly one dependency (libc, for termios). No browser, no runtime, no node, no wasm on the default path
0.602 ms a frame 180×60, measured on the current build — a 1,660 fps ceiling. What a frame costs
3.2 MB resident there is no world grid; every cell is a pure function of its coordinate, so the city is unbounded and walking further costs nothing
The world avenues and junctions, towers with six different silhouettes, lit storefronts, traffic carrying readable registration plates, pedestrians, lampposts, street trees, benches, phone booths, bus stops, branded pylon signs, rain you can turn on, and a star field behind it all
The insides every street-facing building has a door. Walk through it and you are in a real room — one of fourteen trades, with its own furniture, fixtures, and a glazed wall you can see the actual city through
A drive-through a fast-food unit on an avenue has a marked bay in the kerb lane, a serving hatch with somebody in it, and traffic that actually pulls up, waits, and drives on
The lift a tall building has a glass car in a shaft. Press the panel and it takes you up — the floors sliding past on one side, the street falling away on the other
Runs anywhere a terminal does 24-bit ANSI; it sizes itself to your window

Run it

One command, from nothing to standing on a pavement:

git clone https://github.com/Alchemy86/AsciiWorldEngine.git && cd AsciiWorldEngine && ./play

./play finds a Rust toolchain (offering to install one if there is none), builds in release, and drops you into the city. Everything you pass it goes straight through — ./play --demo, ./play --help, and every flag below.

Already have a Rust toolchain? cargo install --path . from the checkout builds the same binary straight onto your $PATH as asciicity.

Controls

key key
W A S D / arrows walk and strafe J K turn
R F look up / down space or shift sprint
E C / PgUp PgDn rise / sink V street ↔ elevated vista
T weather: clear / rain / downpour Tab lock a walk on
X or Enter act on what is in reach — the lift panel M hand over to the autopilot
N the nearest lift: which building, which way, how far L ride mode: let a lift run itself
P write the frame to disk
Q or Esc quit

One press of X in a lift commits the car to the whole journey and lets go of you, so you can turn round and watch the city while it climbs; press again to pull up at the next floor, or the button at the other end to turn round.

Keys are held for exactly as long as your finger is on them in any terminal that speaks the kitty keyboard protocol, and there is a measured fallback for the ones that do not — Holding a key down.

Pictures

Every one of these is a real frame out of the engine, same seed, same city.

Up on the observation deck.

the skyline from the observation deck

Inside a bar. The floor, the walls, the ceiling and the furniture are all geometry.

inside a room

The same street in a downpour.

the city in a downpour

Examples

./play --demo                                 # the city walks itself; any key takes over
./play --seed 90210                           # a different city, same rules
./play --plates "AB12 CDE,K9 PAW,1 RG"        # put your own plates on the traffic
./play --weather downpour --variety 0.4       # wetter, and a more regular district
./play --vista --out shots --name skyline     # one skyline frame, to .svg and .txt
./play --doorway --out shots                  # in through a door and back out, as frames
./play --lift --out shots                     # into the lift, up it, and out on to a floor
./play --ride                                 # load straight into a glass lift and just look
./play --wayfind --landmark --out shots       # find a lift building, and walk to it
./play --drivethru --out shots                # the drive-through: hatch, bay, a car that stops
./play --film --weather rain --out frames     # every tick, ready for ffmpeg
./play --bench                                # per-frame cost: sim / cast / render / paint

Coming next

  • More to press. Every terminal, notice board and exit sign in a room already carries a label, a verb and a reach, and X now acts on whatever is nearest — the lift panel is the first thing it does something with. The rest is a matter of deciding what a terminal should say.
  • Down as well as up. The shaft is cut to the roof, not below it: there are no basements and no plant levels yet, and the storey table is where they would go.
  • More than a terminal. The engine decides the whole picture and hands a frontend one flat buffer of characters and colours; a frontend only paints it. The terminal is one. A browser canvas is already another (./build-wasm.sh). Anything that can paint a grid of coloured cells can be the next.

Deeper

The shape of the engine crate layout, the no-grid world, the projection, the browser target
Generating the city blocks and plots, six building silhouettes, the --variety knob
Doors, rooms and windows how inside and outside are one mode, and how you see out
A glass lift which buildings get one, the panel, and the floors going past
Finding your way names on facades, the seventh silhouette, and the N pointer
Registration plates drawn out of characters, sized to the registration, honest at distance — the idea came from regtransfers.co.uk
Weather and what is on the pavement rain, the drive-through, pylon signs, stars, lamps, trees
Recording a film --film, the script format, the ffmpeg pipeline
The city walking itself --demo, and how it differs from a recording
Holding a key down what a terminal can and cannot tell you
What a frame costs the measured numbers, and how they were measured
Brand the mark, the palette, and how to regenerate it

Licence

PolyForm Noncommercial License 1.0.0. Personal and noncommercial use is free; commercial use needs permission from Aaron Gibson first. See LICENSE for the full terms — that text, unmodified, is what actually governs use.

About

Walkable ASCII city engine in Rust - world, camera, entities and renderer, native terminal binary

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages