Codemon // docs
// CODEMON is an unofficial, fan-made tribute heavily inspired by the Pokémon series — the top-down pixel overworld, tall-grass encounters, the gym-style boss arc, even the red-and-blue logo treatment. We are not affiliated with, endorsed by, or licensed by Nintendo, Game Freak, or The Pokémon Company. All Pokémon trademarks belong to their respective owners. Codemon themselves come from the public Codex Pets archive.
Overview
CODEMON is a Pokémon-inspired browser game built on top of the public Codemon archive. Five layers:
- 1 Ingest — a scheduled job mirrors the public
codemonfeed into our database every ~10 minutes. - 2 Derive — a pure function (
computeStats) turns each pet's public metadata into four 1-99 battle stats (PWR / SPD / DEF / STA) — the same way classic Pokémon stats roll up from base values. - 3 Account — signing in spins up an in-app Solana wallet, drops 5 free starter pets in your collection, and starts tracking points, wins and rank.
- 4 Play — the main game is the
/worldoverworld: a tribute to the classic top-down Pokémon route map. 8 chapters across a village, meadow, forest, river, beach, cave, mountain and champion arena — with NPCs, tall-grass wild encounters, and a boss fight at the end of every chapter. - 5 Collect — buy pets in the
/shop, submit your own via/submit, climb the lifetime/leaderboard, and vote on what ships next on/suggestions.
Data source
Every pet on CODEMON originates from codemon, the public community archive of pets hatched inside the Codex desktop app (shipped by OpenAI in May 2026). We do not generate new pets — we mirror what's already public.
| Sync interval | ~10 minutes |
| Transport | HTTPS pull, signed snapshot |
| De-dup key | pet.id (stable) |
| Retention | indefinite, append-only |
| PII | none — owner display name only |
Sprite format
Codemon ship as a single PNG spritesheet. CODEMON reads the metadata header and renders any frame on the fly via CSSbackground-position animation — no canvas, no JS tweens.
| Layout | 9 rows × up to 8 columns |
| Rows (animations) | idle · waving · running · running-right · jumping · waiting · failed · review · happy |
| Cell size | variable per pet (typ. 64–96 px) |
| FPS | 8 (uniform) |
| Loop | always (except failed → freezes last frame) |
The renderer (PetSprite) is dumb on purpose: it sets CSS variables and lets the browser composite. That's how 100+ pets can animate on the same page without dropping a frame.
Stat engine
Every pet has four stats in 1..99: PWR, SPD, DEF, STA. They are 100% deterministic — the same pet always yields the same numbers. No DB writes, no RNG.
◇ Inputs
| likeCount | popularity → punch |
| downloadCount | battle-tested → defense |
| viewCount | endurance of attention → stamina |
| displayName.length | shorter = snappier → speed |
| pet.id (FNV-1a hash) | deterministic ±10 jitter per stat |
◇ Formulas
// diminishing-returns curve, 0..1
curve(n, k) = 1 - 1 / (1 + n / k)
// per-stat jitter from FNV-1a hash of (id + seed), in ±10
jitter(seed) = (hash01(id + seed) - 0.5) * 20
power = clamp(20 + curve(likes, 8) * 75 + jitter("p"))
speed = clamp(25 + (1 - min(name,24)/24) * 60 + salt*20 + jitter("s"))
defense = clamp(20 + curve(downloads, 6) * 70 + jitter("d"))
stamina = clamp(20 + curve(views, 40) * 75 + jitter("e"))
overall = round((power + speed + defense + stamina) / 4)◇ Why diminishing returns?
Without a curve, a pet with 9000 likes would crush a pet with 90 likes by 100×. The curve() function squashes huge counts into the top of the 0-1 range, so a pet with 8 likes still gets ~50 % of max PWR, and a pet with 800 likes gets ~99 %. The k constants (8, 6, 40) calibrate each stat's "how much is enough" threshold.
src/lib/pet-stats.ts. The function is pure — feel free to fork the math, just don't expect your fork to match official CODEMON battles.Account & starter pets
Most of CODEMON is browseable without an account, but to create rooms, submit pets, claim starters, or buy from the shop you need to sign in at /auth (email + password, or Google). The same account follows you across the site and is the owner of your pets, points, and in-app wallet.
| Sign-in | email + password or Google OAuth |
| First login | creates wallet + grants 5 free starter pets |
| Starter pets | real entries from the archive (never placeholders) |
| Backfill | if your collection is empty on a later visit, starters are re-granted |
| Profile | /profile shows pets, total power, points, wins, SOL |
common · common · common · uncommon · rare — so most are common, but you can get lucky on day one.Wallet (SOL)
Every account gets an in-app Solana wallet generated server-side on first login. The keypair is encrypted at rest and only used to pay for actions inside CODEMON — there is no external signing flow, no browser extension required.
| Network | Solana mainnet-beta |
| Address | shown on /wallet, with a deposit QR code |
| Balance source | live RPC query (cached briefly) |
| Spending | currently the shop only — 0.02 SOL per pet |
| Withdrawals | not exposed in the UI yet |
Shop & rarities
The shop at /shop mints a random pet straight into your collection. Payment is debited from your in-app wallet — no external wallet popup.
| Price | 0.02 SOL per pet |
| Pool | the live archive (same pets you see in /gallery) |
| Rarity roll | weighted: common · uncommon · rare · epic |
| Stat boost | common +0 · uncommon +8 · rare +15 · epic +30 |
| Ownership | stored on your profile, usable in any room |
The boost is added to the pet's derived stats when it shows up in your collection — so a rare Goku hits harder than the same Goku in the public archive.
Overworld saga
/world is the game. An 8-chapter pixel overworld with NPCs, wild encounters in tall grass, and a boss fight at the end of every chapter. You walk, talk, fight, catch, and repeat — all on the same arena engine used everywhere else on the site.
| Chapters | 8 — forests, beaches, caves, mountains, the champion's arena |
| NPCs | scripted dialogue, story beats, side rewards |
| Wild pets | battles in tall grass — winners can be added to your collection |
| Bosses | fixed encounter per chapter, scales with your party |
| Saves | progress (chapter, party, items) is stored on your account |
| Win state | beat the champion, get your name into the Codex |
new in the nav — chapters and balance are still landing. Save data is preserved across updates.Arena engine
Every fight in CODEMON — wild encounter, boss, training duel — runs on the same fixed-step host-authoritative loop. The host client steps physics, resolves combat, and broadcasts snapshots.
| Tick rate | ~30 Hz |
| Arena | fixed 16:9 plane, no scroll |
| Physics | AABB collision + gravity, no rotation |
| Combat | melee on overlap, knockback ∝ attacker PWR |
| HP scaling | derived from DEF |
| Move speed | derived from SPD |
| Jump impulse | derived from SPD |
| Attack cooldown | shorter at high SPD |
| Recovery | passive HP regen scaled by STA |
| Win condition | last pet alive, or top HP at time-up |
Submit a pet
/submit lets signed-in users add a Codemon to the archive. Paste the pet's public URL — we fetch the metadata and spritesheet, run a sanity check, and once approved it appears in /gallery and the shop pool.
| Input | public Codemon URL (we don't accept raw files) |
| Review | manual sanity check — usually within a few hours |
| De-dup | if the pet is already mirrored, the submission is a no-op |
| Credit | the original owner's display name is preserved |
Suggestions
/suggestions is the public roadmap. Anyone signed in can post a feature request, upvote others, and watch what's shipped. It's the fastest way to get something into the next build.
| Post | sign in, write a title + short description |
| Upvote | one vote per account per suggestion |
| Status | open · planned · in-progress · shipped · declined |
| Sort | by upvotes (default) or most recent |
| Moderation | spam and abuse are removed; status changes are public |
Ranks
The leaderboard at /leaderboard (linked as ranks in the header) sorts every account by total points, with wins shown alongside. Points come from overworld battles and boss clears.
| Points | earned from winning encounters and clearing bosses |
| Wins | count of fights you finished in 1st place |
| Tie-break | wins, then most-recent activity |
| Reset | never — it's a lifetime board |
FAQ
▸Do I need an account to play?
To browse the archive and read docs, no. To play the overworld, claim starter pets, submit a pet, or buy from the shop, yes — sign in at /auth.
▸What is the actual game?
It's /world — an 8-chapter pixel overworld with NPCs, wild pet encounters, and a boss at the end of each chapter. Everything else (gallery, shop, ranks, submit) feeds into it.
▸Where do my starter pets come from?
They are 5 random real entries from the archive, picked the first time you sign in. They roll a rarity (mostly common, sometimes uncommon or rare) which adds a flat stat boost.
▸What is the in-app wallet for?
Right now: buying pets from the shop (0.02 SOL each). It's a real Solana mainnet wallet generated for your account; the address and a deposit QR live on /wallet.
▸Can I submit my own pet?
Yes — sign in and head to /submit, then paste the pet's Codemon URL. After a quick review it appears in the archive and is catchable in the overworld.
▸How do I request a feature?
Post on /suggestions (linked as 'ideas' in the nav). Anyone signed in can submit and upvote — top-voted items drive what ships next.
▸Why does my pet have weird stats?
Stats are derived from public engagement (likes, views, downloads) and the pet's id/name. A brand-new pet starts low and climbs as it gathers attention. Pets bought from the shop also get a flat rarity boost.
▸Are stats ever recalculated?
Yes — stats are computed on read. Whenever the underlying counts change in the next sync, the stats update automatically.
▸How does ranking work?
Win fights in the overworld, get points. /leaderboard sorts everyone by lifetime points. No MMR, no season reset.

