-
Notifications
You must be signed in to change notification settings - Fork 0
Developer Documentation
This page is for contributors and anyone interested in the internal structure of Idleology.
The project has been developed iteratively. The architecture described here reflects the main design principles that have guided the code, though not every file follows them perfectly.
See the Architecture Overview page for the detailed structural description.
Idleology is a text-based idle RPG Discord bot.
- Runtime: Python 3.11.5+
- Discord library: discord.py
-
Database: SQLite via aiosqlite (
database/schema.sql) -
Game data: CSV/JSON/TXT files in
assets/(monsters, items, exp tables, partners, etc.) -
Current version: See
UPDATES.mdandREADME.md
cogs/ → Discord command handlers (primarily thin entry points)
core/ → Game logic, models, UI views, and mechanics
base_view.py → Base class for most Discord views
models.py → Dataclass wrappers for DB rows + computed properties
[module]/ → mechanics, views (or views/), ui builders, data
items/ → factory + equipment/essence mechanics
combat/ → full combat subsystem
database/
__init__.py → DatabaseManager (includes codes repo)
repositories/ → all SQL (player_currencies table for most consumables)
assets/ → game data
scripts/ → maintenance tools
Observed separation: Cogs stay relatively light. Logic and views live in core/. SQL is confined to database/repositories/. Currencies live in dedicated table with helper methods on users repo.
Full details are on the Architecture Overview page (layers, BaseView usage, module splitting patterns, combat breakdown, models, and common implementation notes).
- Combat (stamina, modifiers, passives, jewels, many view variants)
- Inventory & Equipment (forge, refine, temper, imbue, essences, factory-built models)
- Settlement (buildings, workers, Black Market, projects, plots, Zeal/DT)
- Partners & Companions (gacha, dispatch, affinity, mastery)
- Endgame: Ascent, Codex, Uber bosses, Maw, Apex
- Progression: Slayer (tasks + tree), Alchemy, Consume/Hematurgy/Hatchery, Journey, Quests, Prestige
- Other: Delve, Gathering (skills + mastery), Curios, Events, Minigames, Trade, PvP, Ideology
- Redeem codes (new
/redeem_codeutility for admin-distributed rewards)
- Views generally extend
BaseView(supports parent= chaining and auto cleanup). -
bot.database.<repo>for data access; commit after writes. - Child views inherit context via
parent. - Guard mutating buttons with a
_processingflag. - Use
state_manageraround interactive sessions. - Look at
core/inventory/,core/settlement/, andcore/combat/for how larger features are organized.
Typical steps:
- Schema + repository methods if needed.
- Models and pure logic in core.
- UI views + stateless builders.
- Thin entry in a cog.
- Wire state management and assets as appropriate.
- Main entry:
bot.py - Commands:
cogs/ - Everything else:
core/ - Data layer:
database/
Study existing modules to match the local style.
Run the bot and test changes interactively.
See the main README.md for installation and running instructions.
Contributions are welcome.
Last updated: June 2026 — synced for codes/redeem feature, player_currencies migration, model splits, and recent refactors. Design principles are sound even if the project is mostly vibe-coded.