openRoads Architecture
This document provides an overview of the openRoads architecture and how the different components interact.
Overview
openRoads is a multiplayer, room-based RPG for Synchronet BBS systems, written in Go. The architecture follows a client-server model where:
The server manages the game world, player sessions, and game logic
Clients connect via terminal connections to interact with the game
Background routines handle periodic tasks like cleanup and events
Core Components
Server
The server component (server.go) handles:
Client connections and session management
Command processing and routing
Multiplayer coordination
World Management
The world system (lib/world.go) is responsible for:
Loading and saving the game world from JSON files
Managing room data and state
Handling transitions between rooms
Player System
The player system (lib/player.go) manages:
Player data and persistence
Character attributes and inventory
Player actions and commands
UI System
The UI component (lib/ui.go) handles:
Terminal input/output
Text formatting and display
User interface elements
Background Routines
Background routines (routines/) handle asynchronous tasks:
Scheduled cleanup operations
Game events and triggers
Time-based game mechanics
Data Flow
Client connects to the server
Server creates a session and authenticates the player
Player commands are processed by the server
World state is updated and persisted
Changes are broadcast to relevant players
Background routines maintain the game world
Configuration
The configuration system (config/) provides:
Runtime configuration options
Game settings management
Environment-specific settings
Last updated
Was this helpful?