dosmud

Architecture

DOSMUD is a DOS-first adventure/RPG written in ANSI C89.

Core philosophy

The codebase intentionally avoids:

Platform boundary rule

Core gameplay must not depend on platform APIs or rendering details.

Good:

game_process_input(game, line);

Bad in gameplay systems:

printf("Player moved.\n");

High-level flow

Input
  ->
Command Parsing
  ->
Gameplay Logic
  ->
World Tick Advance
  ->
Rendering

Commands mutate game state, world ticks mutate simulation state, and rendering only displays state.

Subsystem responsibilities

main

game

game should not grow into a monolith; specialized systems should move into dedicated modules over time.

command

world

Configuration (config.h)

include/config.h is the compile-time home for:

Conventions:

grendr

txtres

invent

items

Core data ownership

GameState

GameState is the primary simulation container. Gameplay systems should mutate it explicitly and avoid shadow copies.

World and Room

World stores room graph data. Room stores room metadata, exits, and ambient state.

Determinism rules

ANSI C89/C90 compatibility rules

Target constraints:

Allowed/preferred:

Avoid:

Feature development guidance

When adding features: