A retro first-person party RPG built with Go and Ebiten. Lead a four-member party through raycasted dungeons, fight in real-time or turn-based combat, and slay the four dragons to save the realm.
- First-person raycasting engine with sprite-based monsters and NPCs
- 4-member party with distinct classes (Knight, Sorcerer, Cleric, Archer)
- Hybrid combat: switch between real-time and turn-based modes
- YAML-driven content: items, weapons, spells, monsters, quests, and maps
- NPC interactions: merchants, spell traders, and encounter triggers
- Victory system with score tracking and local high scores
Requirements: Go 1.23+, Ebiten v2
go mod tidy
go run .Build:
mkdir -p bin
go build -o bin/raysandmagic .
go build -o bin/map_viewer ./assets/map_viewerThe game and map viewer both locate config.yaml/assets/ next to the binary or one directory above it, so local bin/ builds can run against the repo-root data files.
Release bundles:
./build_mac_release.shRelease archives include both the game executable and RaysAndMagicMapViewer for macOS Intel, macOS Apple Silicon, and Windows.
| Key | Action |
|---|---|
| WASD / Arrows | Move and turn |
| Q / E | Strafe |
| Space | Melee attack / confirm action |
| F | Cast equipped spell |
| H + click | Targeted heal |
| 1-4 | Select party member |
| Tab | Toggle real-time / turn-based |
| I / C / M | Inventory / Characters / Spellbook |
| T | Talk to nearby NPC |
| ESC | Menu / close dialogs |
├── main.go # Entry point
├── assets/ # Game data (YAML configs, maps, sprites)
│ ├── *.yaml # Items, weapons, spells, monsters, quests, NPCs
│ ├── *.map # ASCII map files
│ └── sprites/ # Character and monster sprites
└── internal/ # Game packages
├── game/ # Core game loop, combat, UI, rendering
├── character/ # Party, classes, stats, equipment
├── monster/ # Monster AI and configuration
├── items/ # Item system
├── spells/ # Spell casting system
├── quests/ # Quest tracking
├── world/ # Map loading and tile system
└── config/ # YAML loaders
| File | Purpose | Guide |
|---|---|---|
items.yaml |
Armor, accessories, consumables | |
weapons.yaml |
Melee and ranged weapons | Adding a weapon |
spells.yaml |
Magic spells with damage/healing | Adding a spell |
monsters.yaml |
Monster stats, AI, and map letters | Adding a monster |
quests.yaml |
Quest definitions and rewards | |
npcs.yaml |
NPCs (merchants, trainers, encounters) | Adding an NPC |
loots.yaml |
Monster drop tables | |
tiles.yaml |
Tile types per biome | Adding a tile |
map_configs.yaml |
Per-map settings (biome, sky color) |
Step-by-step guides for the most common content additions:
- How to add a new weapon
- How to add a new spell
- How to add a new monster
- How to add a new NPC
- How to add a new tile
Maps are ASCII files where each character represents a tile or entity:
.Floor /#Wall /+Player startTTree (biome-dependent) /WWater /DDoor- Lowercase letters spawn monsters (e.g.,
w= wolf,d= dragon) @marks NPC/special tile positions, defined at line end with>[npc:key]
go fmt ./... && go vet ./... # Format and lint
go test ./... # Run tests