gzochi

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.

Features

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 (g:@ go!) (* s 1000))))

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

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

(define (received-message msg 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)
	  (schedule-reset)))))

(define (client-connected session)
  (gzochi:join-channel (gzochi:get-channel "trebek") session)
  (gzochi:make-client-session-listener
   (g:@ received-message) (g:@ client-disconnected)))
      

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 the diagram colored green — namely the client application and the server-side game logic — are the parts you write. Everything else is provided by the framework; use as much or as little of it as you need!

News

gzochi version 0.7 released

We're pleased to announce the next development release of the gzochi game development framework!

This release includes a set of tools for manipulating data in game application databases outside of the gzochid container. A reference client library written in Guile Scheme is now included in the source distribution. The gzochid server's handling of configuration files has been made configurable and more robust. A number of important bugs related to serialization and data persistence have also been resolved.

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.


gzochi version 0.6 released

We're pleased to announce the next development release of the gzochi game development framework!

This release adds support for two new alternative storage engines: hamsterdb and Symas Lightning (LMDB). The framework now builds on Mac OS X and similar platforms. Some syntactic sugar for creating task callbacks has been added to the Scheme API. A number of memory leaks in the server have been plugged, and an event handling bug in the GLib reference client has been fixed.

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.


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.


More...

Download

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.

Community

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

Trackers