How devzero32/factionmapv4 works
FactionMapv4 is a Discord-hosted faction strategy game: players use bot commands to establish factions and manage armies, regions, resources, and battles, while scheduled turns advance the game and the bot presents map imagery and notifications. The sampled code shows command dispatch, JSON-backed game state, and several domain-handler responsibilities; README documentation is minimal, and unsampled command wiring is not inferred.
Main entry points: jsonhandler.py JSON access · main.py Command bot · factionshandler.py Faction management · regionhandler.py Region operations
Components 21
Discord interface
- Command bot
main.py - Admin and logs
Imports/adminhandler.py
Game systems
- Faction management
Imports/factionshandler.py - Army operations
Imports/armyhandler.py - Region operations
Imports/regionhandler.py - Trade economy
Imports/economyHandler.py - Turn scheduler
Imports/turnshandler.py - Battle mediation
Imports/mediatorhandler.py - Game models
Imports/classhandler.py
Game state
- JSON access
Imports/jsonhandler.py - Faction records
Data/factions.json - Region records
Data/regions.json - Turn records
Data/turns.json - Battle records
Data/mediator.json - Trade records
Data/trades.json
Presentation
- Map rendering
Imports/imagehandler.py - Map assets
Data/Map - Faction logos
Data/Logos - Response embeds
Imports/embedhandler.py
Other components
- Faction players
- Discord platform
Connections 30
- Faction players → Discord platform: issue commands
- Discord platform → Command bot: deliver interactions
- Command bot → Discord platform: send responses
- Command bot → Faction management: dispatch setup
- Command bot → Army operations: dispatch army actions
- Command bot → Region operations: dispatch region actions
- Command bot → Turn scheduler: start turn sequence
- Command bot → Battle mediation: dispatch battle actions
- Command bot → Admin and logs: log commands
- Faction management → JSON access: read and update
- Army operations → JSON access: read and update
- Region operations → JSON access: read and update
- Trade economy → JSON access: read and update
- Turn scheduler → JSON access: read and update
- Battle mediation → JSON access: read battle state
- Game models → JSON access: load game data
- JSON access → Faction records: read and write
- JSON access → Region records: read and write
- JSON access → Turn records: read and write
- Battle mediation → Battle records: read and write
- Trade economy → Trade records: manage trades
- Turn scheduler → Trade economy: distribute trades
- Region operations → Map rendering: update borders and buildings
- Map rendering → Map assets: load map assets
- Faction management → Faction logos: save and use logos
- Map rendering → Command bot: provide map output
- Faction management → Response embeds: format responses
- Army operations → Response embeds: format responses
- Region operations → Response embeds: format responses
- Admin and logs → Discord platform: check roles