ARCPG is a production-ready Discord idle RPG bot with extraction-run gameplay loops inspired by high-stakes scavenging fiction.
- Language: Python
- Bot framework: discord.py 2.x slash commands
- DB: PostgreSQL + SQLAlchemy + Alembic
arkpg/
bot/
cogs/
admin.py
gameplay.py
client.py
core/
config.py
logging.py
db/
base.py
models.py
session.py
game/
constants.py
deployments.py
economy.py
loot.py
progression.py
quest_catalog.py
title_catalog.py
service.py
alembic/
versions/
0001_init.py
0002_progression_systems.py
tests/
test_deployments.py
test_economy.py
test_loot.py
test_profile.py
test_trade.py
- 40+ gameplay-earned titles across Raider, Crafter, Trader, Expedition, Squad, PvP, Collector, Events.
- Hidden-title support (10+ hidden) and inspectable progress via rule functions.
/titles_list,/titles_inspect,/title_equip.- Profile now shows equipped title plus editable callsign and bio.
- Multi-stage seasonal expedition with donation-based progression.
- Transactional crafting-material donations with row locks and contribution scoring.
- Departure window with permanent rewards + temporary stacked buffs.
- Catch-up state support for missed permanent progression.
- Commands:
/expedition_status/expedition_donate_item/expedition_depart/expedition_rewards/expedition_catchup_status- Admin:
/expedition_start,/expedition_end,/expedition_configure
- 30 quests across 5 chapters (6 each), sequential progression with milestone rewards.
- Quest requirements support counters, activity completion, rarity/foundIn collection, and multi requirements.
- Added deterministic seeded activities:
/scavenge(short cooldown, low-risk loot)/salvage(recycle items for scraps + rare refined jackpot)/courier <stake>(timed risk/reward credits run)
- Unified EventBus updates quests and titles from emitted gameplay events.
/profilenow renders a square image card with a dark bottom fade for readability.- Card includes avatar, callsign/title, stats, credits, bio, and an XP progress bar.
- Users can only collect and equip curated backgrounds (no user uploads).
- Commands:
/backgrounds_list/background_equip- Admin:
/background_grant
- Seeder uses
arkpg/db/items.jsonfor item metadata (falls back to/mnt/data/items.jsonin external-hosted setups). - Rarity normalization:
common/uncommon/rare/epic/legendary, null/malformed rarity defaults tocommon. - If file is unavailable in local/dev environment, a tiny fallback seed is used to keep the bot bootable.
- Copy environment template:
cp .env.example .env
- Fill in
DISCORD_TOKENand DB connection values (on some hosts you can useBOT_TOKEN/TOKENinstead). - Start services:
docker compose up --build
- Run migrations:
alembic upgrade head
- Start the bot:
python -m arkpg.main
At startup, ARCPG requires these variables to exist in the host panel/environment (or in .env):
DISCORD_TOKEN(orBOT_TOKEN/TOKEN)DATABASE_URLor all of:DB_HOST,DB_PORT,DB_NAME,DB_USER,DB_PASSWORDREDIS_URL
If any are missing, startup now exits early with a clear message listing exactly which variables are missing.
- This repo includes a
requirements.txtso hosts that auto-runpip install -r ...install all runtime dependencies before launch. - Ensure your panel startup variable points to
requirements.txt(often namedREQUIREMENTS_FILE). - If you see
ModuleNotFoundError: No module named 'discord', dependency install was skipped; rerun install or restart after fixing the requirements file path.
If startup says Missing required environment variables: DATABASE_URL, DISCORD_TOKEN,
your bot token alone is not enough. ARCPG needs a SQL database connection string.
- In Databases in Bot-Hosting.net, click New Database.
- Create either PostgreSQL or MySQL credentials (host, port, database, username, password).
- In your server startup/environment variables set:
DISCORD_TOKEN(orBOT_TOKEN/TOKEN)DATABASE_URL
- Use one of these URL formats:
- PostgreSQL (recommended):
postgresql+asyncpg://USER:PASSWORD@HOST:PORT/DBNAME - MySQL:
mysql+aiomysql://USER:PASSWORD@HOST:PORT/DBNAME
- PostgreSQL (recommended):
- If your panel only shows a JDBC string (starts with
jdbc:mysql://...), removejdbc:and change the prefix tomysql+aiomysql://. - If your DB password contains special characters (for example
@,/,:), URL-encode the password portion before putting it intoDATABASE_URL. - Restart the bot.
Example conversion for a Bot-Hosting MySQL endpoint like us.mysql.db.bot-hosting.net:3306:
DISCORD_TOKEN=your_discord_bot_token_here
DATABASE_URL=mysql+aiomysql://DB_USER:DB_PASSWORD@us.mysql.db.bot-hosting.net:3306/DB_NAMEREDIS_URL is optional in this project and defaults to redis://localhost:6379/0.
If your MySQL password contains special characters and DATABASE_URL is error-prone, you can set
individual DB vars instead. ARCPG will build a safe SQLAlchemy URL for you:
DB_HOST=us.mysql.db.bot-hosting.net
DB_PORT=3306
DB_NAME=your_database
DB_USER=your_user
DB_PASSWORD=your_raw_passwordIf both DATABASE_URL and DB_* values are set, DB_* takes precedence.
Some host panels expose these as MYSQL_HOST, MYSQL_PORT, MYSQL_DATABASE,
MYSQL_USER, MYSQL_PASSWORD (or Postgres-style PG* / POSTGRES_* names).
ARCPG accepts those aliases as well.
- Monetization remains non-pay-to-win.
- Titles in this system are gameplay-earned only.
- RNG-relevant loops store deterministic seeds for auditability.