Home

Grand Motherload

A browser-native take on the 2004 mining game I never quite stopped playing.

Motherload came out in 2004 and I still think about it. You pilot a little drill rig into the earth, fill your cargo hold with ore, fly back to the surface, sell it, buy better equipment, and go deeper. That is the whole game. It is perfect.

This is my version, running right here. Same loop, my own world, no install.

Grand Motherload v1.0
move | Spacejet | drill | Pshop | Tteleport | Rrestart
• • •

The layers

The world is 40 tiles wide and 200 tiles deep, divided into eight depth bands. Each layer has its own palette, its own ore distribution, and a couple have nasty surprises waiting for you.

Layer Depth Notes
Topsoil0–15mLoose dirt and roots. Coal and copper.
Bedrock15–35mBauxite, iron, the first silver.
Permafrost35–55mFrozen solid. Requires the Heated Drill upgrade or you cannot break a single tile. Methane ice deposits hide here.
Fossil layer55–80mAncient sediment. Amber with insects, trilobite fossils.
Deep crust80–110mCinnabar, gold, and the first uranium veins.
Magma veins110–145mGlowing red rock. Without a Heat Shield, your hull drains continuously while you are inside.
Crystal caves145–180mTanzanite, more diamonds. The walls glitter.
Mantle edge180–200mPainite and unobtanium. Even worse heat than the magma layer. Endgame only.

What is down there

Eighteen things to mine, give or take. Some are real, some are deliberately not. Where the real ones are concerned I played a little fast and loose with relative values, but the general ordering (copper before silver before gold before tanzanite before painite) is roughly how the world works.

Ore Value Found in Notes
Coal$5Topsoil → bedrockCheap and common.
Copper$12Topsoil → bedrockStarter cash.
Bauxite$25BedrockAluminum ore.
Iron$35Bedrock → deep crustUbiquitous.
Pyrite$60BedrockFool's gold. Looks valuable, isn't.
Silver$90Bedrock → deep crust
Methane ice$180PermafrostHeated drill required.
Cinnabar$140Deep crustMercury ore. Crystal clusters.
Gold$200Deep crustThe real thing.
Amber$350Fossil layerInsect trapped inside.
Trilobite$600Fossil layerHalf-billion-year-old arthropod.
Uranium$800Deep crustGlows. Requires drill Lv 3.
Obsidian$280Magma veinsVolcanic glass.
Emerald$900Fossil → crystal
Ruby$1,400Deep crust → crystal
Tanzanite$2,000Crystal cavesReal, found only in Tanzania.
Diamond$3,000Crystal cavesRequires drill Lv 4.
Painite$6,000Mantle edgeReal, briefly the world's rarest gem.
Unobtanium$12,000Mantle edgeNot real. Sue me.

Dirt and stone are not in this table because you do not collect them. You drill them, they disappear, you move on. The shop has six upgrades: drill, fuel, hull, cargo, plus a one-time Heated Drill purchase (gates the permafrost) and a two-tier Heat Shield (lets you survive the magma and mantle layers).

• • •

One piece of code I like

The world generates once at startup. Every tile rolls against a list of candidate ores filtered by depth, with rarer ores getting a slowly-increasing edge the deeper you go. The trick is walking the candidate list from rarest to most common, so diamond gets first dibs on the random number and common dirt only gets picked when nothing rarer has claimed the roll.

function pickOre(depth) {
  var candidates = [];
  for (var i = 0; i < ORE_KEYS.length; i++) {
    var o = ORES[ORE_KEYS[i]];
    if (depth >= o.minDepth) candidates.push(ORE_KEYS[i]);
  }
  var r = Math.random();
  // Deeper = rarer ores more likely. Walk from rarest to common.
  var cumul = 0;
  for (var j = candidates.length - 1; j >= 0; j--) {
    var ore = ORES[candidates[j]];
    var adjustedChance = ore.chance * (1 + depth * 0.003);
    cumul += adjustedChance;
    if (r < cumul / (cumul + 1)) {
      return { type: candidates[j], hp: ore.hp };
    }
  }
  if (Math.random() < 0.12) return null; // air pocket
  return { type: 'dirt', hp: ORES.dirt.hp };
}

Two things going on here. The cumul / (cumul + 1) bit is a soft normalization: it keeps the running probability bounded between 0 and 1 without needing to know the total ahead of time, which is handy because the candidate list changes with depth. And the depth multiplier (1 + depth * 0.003) is small but compounds. By 150 metres down, rare ores are getting a 45% bonus on every tile roll, which is why the crystal caves feel like a payday after the long climb to get there.