Quickstart Guide
This guide will help you get a GRPG server and client running on your local machine.Prerequisites
Before you begin, ensure you have:- Go 1.24+ installed (download here)
- Git for cloning the repository
- SQLite3 development libraries (for player database)
- Basic terminal/command line knowledge
On Ubuntu/Debian:
On macOS: SQLite3 is included by default
sudo apt-get install libsqlite3-devOn macOS: SQLite3 is included by default
Installation
Install dependencies
GRPG uses Go modules with local replacements for the
data-go package. Navigate to each component and install dependencies:The
data-go package is shared between components and uses Go module replacement:Prepare game assets
GRPG requires binary asset files (maps, textures, NPCs, etc.). You’ll need to either:
- Download pre-built assets (if available from the project)
- Build assets using the data-packer tool (see Data Packer)
Start the server
The server runs on port 4422 by default and creates a SQLite database for player persistence:You should see output like:
The server automatically runs database migrations on startup. The first run creates
players.db with the initial schema.Launch the client
In a new terminal window:This opens the game client window (1152x960 default resolution) with a login screen.
Connect and play
- Enter a username in the login screen
- Click connect (or press Enter)
- The server will create a new player or load your existing save
- You’ll spawn at position (0, 0) in the game world
- Arrow keys: Move player
- Space: Interact with objects/NPCs
- I: Toggle inventory
- Tab: Switch UI panels
Understanding the Server
Let’s look at what happens when the server starts:server-go/main.go
- Database: SQLite with automatic migrations from
db/migrations/ - Network: TCP listener on port 4422
- Assets: Binary files loaded from
grpg-assets/ - Game Loop: 60ms tick cycle processing packets and NPC movements
Understanding the Client
The client connects and renders using Ebiten:client-go/main.go
Using the Data Packer
Thedata-packer tool converts human-readable manifests into optimized binary formats:
Creating Your First Interactive Object
Let’s create a simple berry bush that players can interact with:Creating Your First NPC
Here’s how to spawn an NPC with dialogue:server-go/content/my_npc.go
- Spawn at coordinates (3, 3)
- Wander up to 2 tiles in any direction
- Respond with a 3-line dialogue when talked to
Database Schema
GRPG uses SQLite with migration support. The initial schema:db/migrations/000001_initial.up.sql
Network Protocol
GRPG uses a custom binary protocol with GBuf for efficient serialization:data-go/gbuf/gbuf.go
Troubleshooting
Server fails to start: 'Failed to connect to DB'
Server fails to start: 'Failed to connect to DB'
Ensure SQLite3 development libraries are installed:
- Ubuntu/Debian:
sudo apt-get install libsqlite3-dev - macOS: Included by default
- Windows: Install from sqlite.org
Client can't connect to server
Client can't connect to server
- Verify the server is running and shows “Listening on 127.0.0.1:4422”
- Check that port 4422 isn’t blocked by a firewall
- Ensure both client and server are running on the same machine
Assets not loading
Assets not loading
The server expects assets at
../../grpg-assets/ relative to server-go/. You can:- Change
assetsDirectoryinserver-go/main.go - Create the directory structure and use the data-packer to build assets
Build errors with 'data-go' package
Build errors with 'data-go' package
Ensure you’re in the correct directory. The This requires the
go.mod uses local replacement:data-go directory to exist at the same level as server-go and client-go.Next Steps
Architecture Deep Dive
Learn about GRPG’s networking, tick system, and binary formats
Content Scripting
Master content scripting for creating NPCs, objects, and interactions
Map Editor Guide
Build custom worlds with the chunk-based map editor
API Reference
Explore the complete API documentation