Version 3 (modified by dave, 10 years ago) (diff)


Overview of structure and layers/programming languages involved.

Code can be found here:

Server (Oak)

FAtiMA layer

Running agents defined using XML, standard Lirec codebase, no changes. Each agent runs as a Java process, sending and receiving messages from the world server program.

World server layer

Another Java process, programmed in Clojure. Listens to messages from agents, and dispatches them to the others. Contains the FAtiMA world state, agents and objects,

Webserver layer

Running in the same process as the world server, but in another thread, the webserver responds to requests with information based on the world state. Programmed in Clojure, and based on the Compojure web server.

Client (Fungi)

Multiple clients, running in web browsers, programmed in Haxe, for flash or HTML5 canvas. Responsible for displaying the world state, and allowing players to interact with it. Objects created here are passed up to the world server layer, so characters respond to changes the player makes.

FAtiMA server API

The FAtiMA server receives http requests and returns all data in JSON format.


Returns all the information for all the agents in the world.

This is in the form of:

[agent1, agent2, agent3]

Where each agent consists of:

General information:

  • name - name of the agent
  • fatactions - a list of the actions recently performed
  • fatemotions - the raw output from the FAtiMA emotional state, converted to JSON

Game specific data:

  • tile - current world tile location
  • pos - position in the tile
  • emotions - the current accumulated emotional values
  • emotionalloc - the location of the object causing the most significant emotional response

This is a real example from the game:

     "tile": {"x":1,"y":0},
     "pos": {"x":7,"y":8},
     "name": "CoverSpirit",
           {"time":232021, "msg":"look-at cover-fruit-b#102#"},
           {"time":232021,"msg":"look-at vertical-fruit-c#147#"},
           {"time":232019,"msg":"look-at cover-fruit-a#146#"},
           {"time":232018,"msg":"look-at cover-fruit-a#183#"},
           {"time":232018,"msg":"flower cover-fruit-c#22#"}


Causes all agents to perceive the world - for debugging purposes.


This command returns a list of all the sprite textures making up the agent's body. This makes it possible to change them in game.