Konosuba RPG
Fan-made RPG project inspired by the Konosuba universe, built for Discord interactions and image-based battles.
Project Status
Already implemented
- Core game simulation loop (
processGame) and URL/action parsing. - Full monster roster and turn-based combat actions (attack, defend, heal, hug, special).
- Character progression system:
- Global player XP/level.
- Per-character XP/level for Darkness, Megumin, and Aqua.
- Stat scaling integrated into gameplay.
- Run result persistence wired to both global and character progression.
- Accessory and inventory system:
- Localized item catalogs (FR/EN).
- Accessory drops after wins.
- Affinity gain from dropped accessories.
- Accessory persistence in
inventory_items. - Inventory API and inventory image rendering.
- Difficulty-aware drops with loot-table style distribution.
- Affinity command and profile display for character progression/affinity overview.
- Discord interaction routing extracted from the main entrypoint.
- Profile/quest/achievement/menu command handlers and API routes.
- Unit and performance test suites (including leak-oriented tests).
Remaining work (high level)
- Economy and progression balancing pass.
- Expanded affinity gameplay effects.
- Documentation alignment and release-gate tracking (TODO/DONE/README consistency).
- Long-term PVP backlog (explicitly deferred).
Roadmap status is tracked in TODO.md and updated as features are validated.
Assets Attribution
Game visual assets are sourced from KonoSuba: Fantastic Days and are used here in a fan-project context.
Development
Common commands
bun run devbun run buildbun run testbun run test:perfbun run test:leaksbun run lint
Vercel deployment
The repository has a GitHub Actions workflow that deploys to Vercel on pushes to dev.
Required GitHub repository secrets:
VERCEL_TOKENVERCEL_ORG_IDVERCEL_PROJECT_ID
To create the Vercel token:
- Open the Vercel dashboard.
- Go to your account settings.
- Open the
Tokenssection. - Create a new token and copy it once.
- Add it to GitHub under
Settings>Secrets and variables>Actions>New repository secret.
You can find VERCEL_ORG_ID and VERCEL_PROJECT_ID in the local .vercel/project.json after linking the project, or by running vercel link locally and reusing the generated values.
Cloudflare Worker deployment
Worker configuration is in wrangler.toml and Worker entrypoint is src/worker.ts.
Useful commands:
bun run worker:devbun run worker:dry-runbun run worker:deploybun run deploy:workerbun run deploy:all
Required secrets (set once via Wrangler):
SUPABASE_URLSUPABASE_SERVICE_ROLE_KEYDISCORD_TOKENDISCORD_APPLICATION_ID
Example:
npx wrangler secret put SUPABASE_URLnpx wrangler secret put SUPABASE_SERVICE_ROLE_KEYnpx wrangler secret put DISCORD_TOKENnpx wrangler secret put DISCORD_APPLICATION_ID
Deployment Architecture
Cloudflare Workers now supports the complete application including image rendering:
- ✅ All routes supported: Game logic (
/konosuba-rpg/:lang/*), Discord interactions (/api/interactions), image rendering (/inventory,/profile,/quest,/shop,/achievements) - ✅ Uses
@cf-wasm/photon/edge-lightfor WASM image processing - ✅ Pre-compiled WASM avoids runtime instantiation restrictions
Technical detail: The application was updated to use Cloudflare's optimized WASM build (@cf-wasm/photon/edge-light) instead of the standard build, which allows the Worker to bypass the "Wasm code generation disallowed by embedder" restriction.
Production strategy:
- Use Vercel as primary production deployment (proven stable)
- Use Cloudflare Workers for identical functionality with reduced latency
- Both deployments share the same codebase
- Workers provides automatic global edge distribution
License (Important)
This repository uses a custom source-available license in LICENSE.
TL;DR
- Source code is available for viewing, downloading, and local evaluation.
- Redistribution is not allowed (source or binaries).
- Commercial use is not allowed.
- Derivative works may be created only for private/local use and may not be distributed.
- This project has no affiliation with Studio Deen or related rights holders.
- The application is intended to remain free to use with zero ads.
Not Open Source
Although the source code is visible, this license is not an open source license and is not OSI-approved.
If you need permissions beyond what is written in LICENSE, contact the repository owner.