Terrain Flux is a SimCity 2000 style sandbox with real California terrain baked in. Sculpt hills, flood the coast, zone a town, and watch it grow. Or watch it refuse to grow, if you built it somewhere ridiculous.
Made by Jerrod Lessel, a geospatial scientist who wandered into GIS and never left. Part of Lessel Geospatial Labs.
Source code: GitHub
The map is a grid of 128 by 128 tiles, and each tile can tilt to make a slope. One rule keeps the land believable: the ground can only rise or fall one step from one tile to the next. When you raise or lower a spot, the land around it adjusts to follow that rule, which is what gives the hills their classic SimCity look.
Real places start as 30 m elevation data exported from Google Earth Engine. The app crops it to a square, shrinks it to fit the grid, and softens any cliffs too steep for the one-step rule. A city then grows on top using simple rules about roads, neighbors, and demand.
Debris flows after a fire use a simplified version of the USGS M1 likelihood model, the same one behind Scar Threshold, my real post-fire hazard map. Here the burn severity comes from the game's own fires and soil is held constant, so it is a toy, not a forecast.
π¬ The science behind it: what each hazard model is based on, and where it stops being true.
Elevation: SRTM 30 m, NASA and USGS (Farr et al., 2007), via Google Earth Engine.
Debris flow likelihood: USGS M1 model (Staley et al., 2017).
Sea level scenarios: NOAA 2022 interagency report (Sweet et al., 2022).
Biome sorting: after Whittaker (1975).
GeoTIFF reading: geotiff.js (MIT license).
Fonts: Press Start 2P and VT323 (SIL Open Font License).
Inspired by SimCity 2000 (Maxis, 1993). Every pixel here is drawn in code; no original game assets are used.
β Terrain Flux is free. If it made you smile, you can buy me a cup of tea on Ko-fi.
Version 5.16.1 Β· MIT license
Copied!
The link holds everything you see: terrain, water, roads, buildings, scars, and your view.
A .json file holds a full copy of your map. Handy for keeping versions, or for maps built from your own DEM, which can't fit in a link.
Saved as a PNG. If nothing downloaded, right-click the picture and choose Save image.
π The rocket made it! Where to next?
The ground can only rise or fall one step from one tile to the next, so raising a spot drags the hillside up with it, just like the 1993 original.
π The report card grades your city on wildfire, debris flow, earthquake, sea level rise, air quality, and services, by the share of residents exposed. Click a row to see it on the map.
Factories, busy roads, and smoke pollute the air, and the wind carries it downwind. Homes grow slower in dirty air, so put industry downwind of town. Bus depots, EV charging, and bike share cut traffic pollution.
Growth takes balance. The R C I bars up top show demand: homes need about one job for every two residents, shops need customers, and industry needs workers. Level 2 needs fire or police coverage. Towers need fire and police, and homes also want a hospital and a park within 6 tiles. Hover any zone to see what it is waiting for.
Zones only grow on flat tiles near a road. Use Level to make room. A lone zone stays small and rural. Taller buildings need a real neighborhood around them, and demand: homes need jobs nearby, and shops and factories need residents. Hover a zone to see what it is waiting for. Homes like water views and dislike dirty air.
Traffic follows development. Busy neighborhoods fill their roads with cars, and a road to nowhere stays empty. Every building type comes in four styles.
Civic buildings change the city around them. Parks make homes nicer, hospitals act like jobs, fire stations help factories, stadiums pack the shops and the roads, and every tower needs police coverage. Pick one to see its reach.
Wind gusts roll across the map and set the trees they pass swaying. Watch the wind readout in the status bar.
Sea level rise works on coastal real places. It floods using the real elevation, and only land connected to the ocean, so low spots behind high ground stay dry. Hover a flooded tile to see it, and the panel totals the land, buildings, and people affected.
Storms (π§οΈ) turn burn scars into debris flow danger. Each drainage gets a likelihood from a simplified version of the USGS M1 model used in Scar Threshold: steep burned ground, burn severity, and rain rate. Make it rain and High drainages usually let go, sending mud down the channel and spreading a fan where the ground flattens.
The βοΈ button switches between always day, a slow day and night cycle (one day is five real minutes, so nothing flashes), and always night. At night windows, streetlights, and headlights come on one by one.
Earthquakes (π): pick a magnitude and click an epicenter. Shaking fades with distance. Tall towers and heavy industry are the most fragile, steep slopes slide, low ground next to water can liquefy, bridges can drop, and collapsed buildings can start fires.
π Share copies a link to exactly what you see, city and all. π File saves or opens a full backup copy.
π Grow a city of 7,000 people with a hospital and you can build a Spaceport (a 2 by 2 lot). Click it with β Pan to launch: countdown, liftoff, and then you can follow the rocket to build on the Moon or Mars. The Moon and Mars stay locked in New map until you reach them by rocket, and each world keeps its own city: the π π π΄ buttons under Map hop between them. Share links open any world for anyone.
Drag a road across water to build a bridge. Bridges need land on both ends and can span up to 16 tiles.
π Biomes paint the land: forest, prairie, desert, chaparral, rainforest, bayou, mangrove, savanna, boreal, tundra, and alpine. Each has its own ground and plants and burns differently: chaparral and prairie burn fast, deserts and wetlands barely burn. Mangroves and bayous can grow in shallow water. Pick a climate to fill a whole map, or choose one under New map.
Biomes change how things behave: prairie, savanna, and alpine are windier, rainforests are calmer and get passing showers that put out fires, and deserts get dust devils. Desert towns grow slowly without water nearby, and cold biomes grow slowly too. Mangroves, bayous, and coral reefs hold back sea level rise for the land behind them, wetlands stop debris flows, and reefs bring tourists to nearby shops.
π Volcanoes: click to raise a cone and set it erupting. Lava runs downhill, buries what it meets, starts fires, cools into black lava rock over a few months, and builds new land where it reaches the sea.
ππ΄ Pick World under New map to build on the Moon or Mars: craters, alien skies, ice instead of water, and sealed colony habitats (inflatable pods, habitat towers, 3D-printed domes, ice drills, and even a rocket pad) with glass domes over civic buildings. Instead of air pollution you track dust contamination from mining and rover traffic. No air means no fires, no rain, no biomes, and no sea to raise. The Moon has no wind at all; Mars has dust devils everywhere. Plant π² and you get Moon fungus or Martian lichen and greenhouse pods instead of trees.
Water pools on flat ground. Place it on a slope and it runs downhill as a stream, with waterfalls, until it reaches water or a low spot. The sea level buttons flood or drain the whole map.
Wildfires run downwind and uphill. Forest burns long and hot, grass burns fast and light, and roads, water, beaches, and bare rock stop them. Fire stations slow fires inside their reach. Burned ground stays scarred by severity and heals over about five game years, and forests grow back.
Load DEM takes a real GeoTIFF, crops the center square, and squeezes it into 128 by 128 tiles. Cliffs get softened into slopes because the engine refuses to do anything else.
Keys: Space pause, 1/2/3 slow/normal/fast, N day and night, L map layers, K snapshot, Q/E rotate, +/- zoom, arrows or WASD pan, G grid, C contours, T tint, P pixels, Esc cancel.