cd /news/developer-tools/title-show-hn-10-killer-game-apps-o-… · home topics developer-tools article
[ARTICLE · art-43962] src=big.lain.technology ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Title: Show HN: 10 Killer Game Apps – O(1) hash-table lookup for game logic

A developer released 10 single-file game apps using a 61-atom hash-table lattice that replaces traditional game logic with O(1) lookups, achieving sub-microsecond response times and zero dependencies. The lattice, originally derived from a cross-language error taxonomy, maps (state, event) to action in 1,348 nanoseconds per query, enabling NPC reactions, item crafting, and dialogue branching without behavior trees, LLMs, or databases. The project demonstrates a universal lookup-table approach to game engines, with identical deployment across Python, Rust, C, Go, JavaScript, WASM, and JSON.

read5 min views1 publishedJun 29, 2026
Title: Show HN: 10 Killer Game Apps – O(1) hash-table lookup for game logic
Image: source

The lattice deployed. 10 hash tables. O(1) lookup. 0 latency. Polyglot.

NPC reactions. Item combos. Damage calculation. Dialogue branching. Quest progress. Loot drops. State transitions. World generation.

All of these are (input) → (output)

. The lattice IS the game engine.

A hash table replaces 100,000 lines of game code with 1 file.

The lattice is a 61-atom semantic execution substrate. It is a universal lookup table that maps inputs to outputs in O(1) time with zero dependencies. Originally derived from a cross-language error taxonomy (61 programming error domains from Rust, Python, TypeScript, Go), the lattice generalizes to any domain where (state, event) → (action)

is the dominant pattern.

1,348 nanoseconds per query. That's 741,667 lookups per second per core. Below human perception.

No LLM. No API. No network. No database. No Redis. Just a Python dict.

Same lattice deploys in Python, Rust, C, Go, JavaScript, WASM, or JSON. Identical output across all surfaces.

Every game app is one Python file. No build step. No compilation. No package management.

Same input, same output, every time. No randomness in lookup. Perfect for testing and replay.

Ship the free tier today. Monetize the extended atom sets. No backend. No subscriptions to manage.

Each app is a standalone Python file. No shared source. No imports between them. Click "Try it" to run in your browser via Pyodide, or "Download" to get the source.

Player action → NPC reaction in 1,348ns. 6 NPC types × 6 actions = 36 reactions. Replaces behavior trees with a single hash table.

A + B = C. 50 recipes. O(1) lookup. No spreadsheet, no database. Just a hash table. Minecraft-style crafting without the XML.

"Player has X, needs Y, give Z." 5 complete quests with status evaluation. Visual designer-compatible JSON output. O(1) per check.

Level × Rarity × Affinity = Item. 10 bases, 6 rarities, 12 affinities. Deterministic. Seedable. Same seed = same item.

Player says X → NPC says Y. 5 NPCs × 5 actions × 19 moods = 475 unique lines. No conversation tree to maintain.

ATK × DEF × Affinity × Crit = Damage. 12 affinities, 5 crit tiers. O(1) per hit. No formula spaghetti.

"Sword + Dragon Scale = Dragonbane." 35 discoverable combos. Reverse lookup supported. O(1) combine.

State × Event → New State. 42 states, 39 transitions. Replaces 10,000-node FSMs. Covers enemy AI, doors, plants, day/night, weather.

Seed × Biome × Depth = Content. 8 biomes, infinite seeds, deterministic. SHA-256-based. Share seeds, share worlds.

A + B = C. 50+ fusions from elemental (fire+water=steam) to cosmic (life+death=rebirth). Tier upgrades. O(1) fuse.

The entire lattice is a Python dict

. Lookup is a hash table operation. That's it.

Every app follows the same three-atom pattern:

LATTICE = {
    ("input_a", "input_b"): "output",
    ("player_attacks", "guard_npc"): "defend_return_attack",
    ...
}

def execute(a, b):
    return LATTICE.get((a, b), LATTICE.get((b, a), "default"))

result = execute("fire", "water")  # -> "steam"
Approach Lookup Speed File Size Dependencies Offline
Behavior Tree (10K nodes) ~50 µs 5MB XML Engine + editor Yes
LLM / GPT API ~500ms 0 bytes API key + network No
SQLite lookup ~10 µs Schema + files SQLite Yes
Redis cache ~100 µs 0 bytes Redis server No
Lattice (Python dict) ~1,348ns One file None Yes

Measured on a typical x86_64 server (Python 3.11). All apps are single-file Python with zero imports beyond the standard library.

App Atoms Lookup Latency Throughput File Size
StateZero 42 states, 39 transitions ~300ns 3.3M/sec 5KB
CraftCore 50 recipes ~500ns 2.0M/sec 6KB
Dialoop 475 lines ~500ns 2.0M/sec 9KB
FusionCore 50+ fusions ~700ns 1.4M/sec 7KB
AffinityGraph 35 combos ~1,000ns 1.0M/sec 8KB
NPC-Brain 36 reactions ~1,348ns 741K/sec 6KB
BattleCalc 12 affinities, 5 crits ~1,500ns 666K/sec 5KB
QuestFlow 5 quests ~2,500ns 400K/sec 6KB
LootForge 10 bases, 6 rarities ~15,000ns 66K/sec 5KB
ProceduralHash 8 biomes, infinite seeds ~25,000ns 40K/sec 5KB

40,000 lookups/second is fast enough for a turn-based RPG with 1,000 entities making 40 lookups each per frame. 3.3M/sec runs an RTS with 10,000 units. The slowest app is still 4,000x faster than human visual reaction time.

Why a hash table beats the conventional approach for game logic.

5MB XML, 10K nodes, 50µs/eval. The lattice does 80% of the work in 0.05% of the time.

GPT-4: $0.01-0.05/response, 500-2000ms. Lattice: $0, 1,348ns.

Right pattern, wrong implementation. Lattice is the same FSM, 10x more maintainable, 10x faster.

Loaded at startup, parsed at runtime. Lattice IS a config file with the parser built in.

What are the inputs, and what should the system do for each?

6 player actions × 6 NPC types = 36 combinations.

LATTICE = {
    ("greet", "merchant"): "offer_wares",
    ("attack", "merchant"): "call_guards",
    ...
}

One function. Three lines. Done.

def react(action, npc_type):
    return LATTICE.get((action, npc_type), "do_nothing")
assert react("attack", "merchant") == "call_guards"

Add more entries. The lattice grows linearly. Performance stays O(1).

The free tier ships today. The pro tier is a Python file you can sell.

Every app is a single Python file. Zero dependencies. MIT-style license. Ship in your game today.

Python is the densest expression of a hash table. You can transpile the lattice to Rust or C in minutes.

Yes. MIT-style licensed. No attribution required for the free tier.

Open the Python file. Find the lattice dictionary. Add a new entry. Save. Done.

Call from Python or export lattice to JSON. 3 lines of lookup logic in any language.

Linear. 360 reactions = 1,500ns. 3,600 = 2,000ns. Hash table doesn't care.

Yes. LATTICE[("new_action", "new_npc")] = "new_reaction"

. Instant.

── more in #developer-tools 4 stories · sorted by recency
── more on @python 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/title-show-hn-10-kil…] indexed:0 read:5min 2026-06-29 ·