Desuq Cafe

Back to Devlog
Cross-Server Networking Backend Architecture

Cross-World Server System

The Idea

What if playing solo didn’t mean playing alone? The concept: an opt-in system where players in separate game sessions can affect each other — sending custom quests, delivering monsters, interacting through a shared economy.

Architecture

Three-layer design:

  • Flask API on Fly.io (Tokyo region) — owns all game logic. Rewards, costs, validation are all server-side. The client sends monster_type and kill_count; the server calculates the reward.
  • HTTP Client Layer — thin Unity client with event-driven modules. Sends requests, displays results, never calculates sensitive values.
  • Integration Layer — reactive bridge between gameplay and the API. Listens for kills, tracks quest progress, polls for deliveries, spawns monsters on claim.

Token Economy

Players spend tokens to create quests and send deliveries, earn tokens by completing quests. Starting balance, costs, and difficulty multipliers are all configured server-side so nothing can be exploited client-side.

Key Design Decisions

  • Server-Authoritative — all rewards and validation happen on the server
  • Mode-Agnostic — game code calls the same interfaces in singleplayer and multiplayer through a routing layer
  • Interface-Based — the PoC ships with dummy implementations so the real game just swaps in real ones
  • Steam Auth Ready — scaffolded for real Steam authentication with a development fallback for testing

What’s Working

Full quest lifecycle (create, claim, progress tracking, auto-completion), monster delivery system (send, inbox, claim/decline with refund), and the token economy. The PoC runs with dummy implementations — real game integration comes later.

Other posts