Skip to content

New Share your ideas with the AWTRIX community. Keep your creations together in your account.

Sign in

Which AWTRIX do you have? Choose it once and the Hub shows what runs on it.

ScriptAWTRIX NG

Pixel Aquarium

On an AWTRIX display
Pixel Aquarium shown on an AWTRIX display
Pixel Aquarium · by Galadril

On your display

Three fish that glide and turn, swaying weed, light rays, jelly fish, a crab and a chest that opens.

Which AWTRIX do you have? See below where it runs, or choose your device.
Topic
Miscellaneous
Includes
Script

Runs on

  • Runs on 32×8 (TC001 & DIY) 32×8 (TC001 & DIY) version
  • Runs on 52×16 (TC002)
  • Does not run on 32×8 with AWTRIX 3 (TC001 & DIY) Made for AWTRIX NG.

Choose your display in the next step.

Send to AWTRIX

Choose your AWTRIX

Pixel AquariumAWTRIX NG script

Install this script on your AWTRIX NG. Its icons and sounds are installed with it.

Your AWTRIX’s local address, for example 192.168.178.39 or awtrix.local.

The name shown in your AWTRIX script list. Use letters, digits, hyphens or underscores.

Connection & device login

Connect your phone or computer to the same network as your AWTRIX. Allow local network access if your browser asks.

Use the device’s IP address, without a page path such as /#/apps.

If your AWTRIX requires a login, the username and password fields will appear when you connect.

Sign in to the Hub to install scripts. Attached files are installed separately.

Script description

Pixel Aquarium

One ocean seen through four windows. Pan between a reef, a kelp forest, a flooded cave and a wreck — each with its own fish — and the tank keeps living while you are not watching.

Panels: 52x16 and 32x8 — but they are not the same tank, see below · Needs: nothing, no account, no network

Four biomes, not four backdrops

SELECT swims to the next one. They sit in a ring — reef → kelp → dark → wreck → reef — and each has its own water, bed, planting and, more to the point, its own residents:

  • Reef — clownfish, blue tang, angelfish, pufferfish, shrimp, coral, a crab and three shafts of sunlight
  • Kelp — a forest tall enough to reach most of the water column, with pipefish, silversides, a seahorse and triggerfish
  • Dark — a flooded cave: pale limestone ceiling and stalactites over water running teal at the roof to violet at the floor, a shaft of light through a gap in the rock, crystals pulsing cyan and magenta, glowing weed, and an anglerfish whose lure actually pulses, with lanternfish, squid and jellyfish
  • Wreck — a ship lying tilted in the silt with its bow up and its mast snapped, the chest that opens every fifteen seconds, a grouper, a moray and a ray along the bottom

Something big in the haze

Something large passes behind everything now and then, drawn darker than the
water it moves through rather than as another fish. There are five — a shark,
a ray, a whale, a turtle and a shoal — and each biome draws from three of
them, so it is not the same shape every time.

Behind that there is a layer of movement per biome: plankton drifting on the
reef, a second rank of darker fronds swaying at its own rate in the kelp,
motes drifting through the shaft in the dark, silt drifting past the hull in the
wreck. One tank used to have more going on in its background than four biomes
did, which was the wrong way round.

It keeps living while you are not watching

This is the part that changed most. The old build ran its whole life cycle from draw(), which only runs while the app is on screen — so breeding advanced for about fifteen seconds per rotation and, in practice, nothing ever happened.

Now the ocean runs in loop(), once a second, on screen or not. Fry grow up, fish migrate, and the tank you come back to is not the one you left.

And it survives a reboot. The population is kept in the device's own store, three characters a fish, so a power cut no longer wipes it. A progression system with no memory is just a screensaver.

Only the small fish travel

The first build let everything roam and it put a grouper over the coral and an anglerfish in full sunlight. These four biomes are far enough apart that most species belong to exactly one, so a visitor read as a bug rather than as ecology.

So the silversides and the tiddlers wander between biomes and everything else stays home. The bar is colour as much as size: the blue tang roamed at first, and a bright reef fish in the kelp looked exactly as wrong as the grouper had. A wanderer leaving through the glass arrives at the far edge of the next biome along a moment later — and food is what pulls them across, which is the one lever you have over where the ocean gathers.

One button does everything

SELECT is the only button this app takes. LEFT and RIGHT are never
consumed, so the carousel always works — an app that eats them leaves no way
out but the device menu.

SELECT once Swims to the next biome
SELECT twice, quickly Drops food — and deliberately does not pan

A press is not acted on the instant it lands. The app waits 450 ms to see
whether a second one follows, which is what lets one button mean two things.
Both top corners light up the moment you press, so the wait reads as
acknowledgement rather than lag.

The cost, stated plainly: panning two biomes along needs two deliberate
presses with a beat between them rather than a quick double-tap. With four
biomes that is at most three presses.

A fed fish may spawn a fry, which takes about ten minutes of real time to
grow through two stages into its parent's species. Only species native to that
biome are ever born there.

It also breeds on its own

Nothing here dies, so the tank cannot empty — but without this it could only
ever grow when somebody pressed a button, and coming back after a week to an
identical tank is the thing persistence was meant to fix.

So a settled biome breeds slowly by itself: roughly one new fish every twenty
minutes somewhere in the ocean, provided that biome is under its cap and
already holds two grown fish. Feeding is far faster, which keeps it worth
doing.

Dusk actually happens

The light is interpolated rather than switched: full day until seven in the evening, then three hours fading to full night, and three hours back at dawn. The old build flipped palettes outright at 22:00 and 07:00.

Measured at eight in the evening the reef renders a third of the way to night — which is the difference between a tank that has a time of day and one that has two states.

Settings

Starting fish (8) Three to twelve. Breeding grows it from there, up to four or five a biome
Small fish roam (on) Silversides and tiddlers cross between biomes; everything else stays home
Breeding (on) Fed fish lay eggs, and a settled biome slowly breeds on its own
Dim with the clock (on) Off keeps it permanently daylit
Sound (off) A short cue when food goes in and when an egg hatches — and never while the app is off screen

More scripts in Miscellaneous

Something wrong with this script? Report it.