Menu

Designing an idle RPG economy in vanilla JS: lessons from Snow317.io
📰

Designing an idle RPG economy in vanilla JS: lessons from Snow317.io

DEV Community: beginners·SnowRSPS·19 days ago
#PxCjPHce
#devtobeginners#devto#dev#coins#pets
Reading 0:00
15s threshold

Snow317.io is a small 8-bit clicker RPG we're building in plain JavaScript: no framework, no engine, one page. You click ATTACK, monsters drop coins, and coins buy weapons, armour and pets. Pets deal damage for you. It's a spin-off of SnowRSPS, a custom game server we've run since 2012.

The code is easy. The economy is the hard part. Here's what we've learned so far.

1. Pick your growth curves before you write content

Every incremental game comes down to two curves:

Income growth : how fast coins per second rise

Cost growth : how fast prices rise

If costs grow faster than income, the player hits a wall. If income grows faster, the game is "solved" in an afternoon. The usual pattern is exponential costs and multiplicative income:

const cost = ( base , owned , rate = 1.15 ) => Math . floor ( base * Math . pow ( rate , owned ));

Enter fullscreen mode

Exit fullscreen mode

Tune rate per item category.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.