Hello, world!

gzochi (/zoʊ-ʧi:/) is a framework for developing massively multiplayer online games. A server container provides services to deployed games, which are written in Guile Scheme, that abstract and simplify some of the most challenging and error-prone aspects of online game development: Concurrency, data persistence, and network communications. A very thin client library can be embedded to provide connectivity for client applications written in any language.


For example...

Here's what a gzochi application looks like:

(define-module (jeopardy!) 
  #:use-module (gzochi)
  #:use-module (rnrs bytevectors))

(gzochi:define-managed-record-type button
  (fields (mutable flashing (serialization gzochi:boolean-serialization))))

(define (go!)
  (let ((msg (string->utf8 "go!!!")))
    (button-flashing-set! (gzochi:get-binding "button") #t)
    (gzochi:send-channel-message (gzochi:get-channel "trebek") msg)))

(define (schedule-reset)
  (let ((s (+ (random 10) 1)))
    (gzochi:schedule-task (gzochi:make-callback 'go! '(jeopardy!)) (* s 1000))))

(define (initialized properties)
  (gzochi:set-binding! "button" (make-button #f))
  (gzochi:create-channel "trebek")

(define (client-disconnected session) 
  (gzochi:leave-channel (gzochi:get-channel "trebek") session))

(define (received-message session)
  (let ((button (gzochi:get-binding "button")))
    (if (button-flashing button)
	(let* ((name (gzochi:client-session-name session))
	       (msg (string->utf8 (simple-format #f "~A wins!" name))))
	  (button-flashing-set! button #f)
	  (gzochi:send-channel-message (gzochi:get-channel "trebek") msg)

(define (client-connected session)
  (gzochi:join-channel (gzochi:get-channel "trebek") session)
   (gzochi:make-callback 'received-message '(jeopardy!)) 
   (gzochi:make-callback 'client-disconnected '(jeopardy!))))

gzochi turns this code into a network game server capable of supporting thousands of simultaneously-connected players, and transparently persists the state of all game objects so that data integrity is guaranteed — even in the event of a power failure or hard restart. gzochi prevents race conditions and other concurrency issues by executing every task in its own transactional context, protected from modifications happening elsewhere. Write your game as a single thread, and do away with explicit synchronization: gzochi responds to clients, schedules tasks, and resolves deadlocks for you.

How it works

Thumbnail for gzochi architectural diagram Click the image link to see an architectural diagram of a game application managed by the gzochi framework. The parts of diagram colored green — namely the client application and the server-side game logic — are the parts you write. Everything else is part of the framework; use as much or as little of it as you need!


gzochi version 0.5 released

Happy new year! We're pleased to announce the next development release of the gzochi game development framework.

This release resolves a number of issues with the durability of scheduled tasks and the execution of highly concurrent application code. A new scalable, concurrent data structure has been added to the Scheme API. Several improvements have also been made to the performance of the server and the reference client implementations.

See the NEWS and README files of the individual framework components for more details. The manual has been updated to reflect all new and modified features.



Try it out! The source distribution comes with everything you need to get started building games with gzochi. In additon to the server, source code for several reference client libraries and two complete client-server example games is included, along with detailed Texinfo and man page documentation.


Development for the gzochi project is generously hosted by the nice people at Savannah. Visit the project page for more information.

git repository

git clone git://git.savannah.nongnu.org/gzochi.git (browse)

Mailing lists