◢ initializing archive
Codemon

decoding the codex…

0%
Codemon
◢ docs // v1.0

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.

★ pokémon-inspired fan project — not affiliated with nintendo
00 //

Overview

CODEMON is a Pokémon-inspired browser game built on top of the public Codemon archive. Five layers:

  1. 1 Ingest — a scheduled job mirrors the public codemon feed into our database every ~10 minutes.
  2. 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. 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. 4 Play — the main game is the /world overworld: 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. 5 Collect — buy pets in the /shop, submit your own via /submit, climb the lifetime /leaderboard, and vote on what ships next on /suggestions.
01 //

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
TransportHTTPS pull, signed snapshot
De-dup keypet.id (stable)
Retentionindefinite, append-only
PIInone — owner display name only
⚠ noteCODEMON is unofficial and not affiliated with OpenAI. We never modify sprite data or owner names.
02 //

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.

Layout9 rows × up to 8 columns
Rows (animations)idle · waving · running · running-right · jumping · waiting · failed · review · happy
Cell sizevariable per pet (typ. 64–96 px)
FPS8 (uniform)
Loopalways (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.

03 //

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

likeCountpopularity → punch
downloadCountbattle-tested → defense
viewCountendurance of attention → stamina
displayName.lengthshorter = 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.

◆ infoStats live in 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.
04 //

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-inemail + password or Google OAuth
First logincreates wallet + grants 5 free starter pets
Starter petsreal entries from the archive (never placeholders)
Backfillif your collection is empty on a later visit, starters are re-granted
Profile/profile shows pets, total power, points, wins, SOL
◆ infoStarter pets roll a rarity from common · common · common · uncommon · rare — so most are common, but you can get lucky on day one.
05 //

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.

NetworkSolana mainnet-beta
Addressshown on /wallet, with a deposit QR code
Balance sourcelive RPC query (cached briefly)
Spendingcurrently the shop only — 0.02 SOL per pet
Withdrawalsnot exposed in the UI yet
⚠ noteDon't deposit more than you're willing to spend on pets. The wallet is a fun in-app feature, not a custody product.
06 //

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.

Price0.02 SOL per pet
Poolthe live archive (same pets you see in /gallery)
Rarity rollweighted: common · uncommon · rare · epic
Stat boostcommon +0 · uncommon +8 · rare +15 · epic +30
Ownershipstored 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.

07 //

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.

Chapters8 — forests, beaches, caves, mountains, the champion's arena
NPCsscripted dialogue, story beats, side rewards
Wild petsbattles in tall grass — winners can be added to your collection
Bossesfixed encounter per chapter, scales with your party
Savesprogress (chapter, party, items) is stored on your account
Win statebeat the champion, get your name into the Codex
◆ infoWorld is currently flagged new in the nav — chapters and balance are still landing. Save data is preserved across updates.
08 //

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
Arenafixed 16:9 plane, no scroll
PhysicsAABB collision + gravity, no rotation
Combatmelee on overlap, knockback ∝ attacker PWR
HP scalingderived from DEF
Move speedderived from SPD
Jump impulsederived from SPD
Attack cooldownshorter at high SPD
Recoverypassive HP regen scaled by STA
Win conditionlast pet alive, or top HP at time-up
◆ infoAll four stats matter. A glass-cannon (high PWR / low DEF) wins short trades; a tank (high DEF / STA) wins attrition.
09 //

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.

Inputpublic Codemon URL (we don't accept raw files)
Reviewmanual sanity check — usually within a few hours
De-dupif the pet is already mirrored, the submission is a no-op
Creditthe original owner's display name is preserved
10 //

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.

Postsign in, write a title + short description
Upvoteone vote per account per suggestion
Statusopen · planned · in-progress · shipped · declined
Sortby upvotes (default) or most recent
Moderationspam and abuse are removed; status changes are public
11 //

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.

Pointsearned from winning encounters and clearing bosses
Winscount of fights you finished in 1st place
Tie-breakwins, then most-recent activity
Resetnever — it's a lifetime board
12 //

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.

end of transmission // /docs v1.0