Map preview protocol documentation
authorvittorio.giovara@gmail.com
Tue, 22 Jun 2010 11:17:50 +0000
changeset 0 89253999c825
child 1 d51ef96162d8
Map preview protocol documentation
EngineProtocol.wiki
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EngineProtocol.wiki	Tue Jun 22 11:17:50 2010 +0000
@@ -0,0 +1,64 @@
+#summary Protocol for frontend/engine interaction.
+#labels Documentation
+
+= Introduction =
+
+The frontend interacts with the engine in two separate occasions:
+  * map preview generation;
+  * game setup and statistics messages.
+
+Messages are always in form of a string of bytes, and the first byte contains the message size (hence the maximum length is 255-1).
+
+= Map Preview =
+Frontend needs to generate a preview of the map that is going to be used in game; there is no handshaking.
+
+Files on which this protocol is implemented: MapConfigViewController.m
+== Protocol ==
+|| *Frontend*      || *Engine*          || *Format*                  ||
+|| UUID            ||                   || {{{eseed{ ... }}}}        ||
+|| Template Filter ||                   || {{{e$template_filter N}}} ||
+|| Map Type        ||                   || {{{e$mapgen N}}}          ||
+|| Maze Value      ||                   || {{{e$maze N}}}            ||
+||                 || 128x32 byte array || {{{0YSD3 ... FSAD0}}}     ||
+
+=== UUID ===
+The UUID is a 32 bytes array composed of ASCII characters; groups of letters should be separated by '-'.
+
+Example: _eseed {AERTB-62FASDSAD-NNIASDSADASD-12P}_
+
+=== Template Filter ===
+_N_ selects the type of map that is going to be generated. This command is ignored when MapGen is not 0, but it must be set anyways.
+
+|| *Value* || *Filter Selected* ||
+|| 0       || None          ||
+|| 1       || Large         ||
+|| 2       || Medium        ||
+|| 3       || Small         ||
+|| 4       || Cavern        ||
+|| 5       || Wacky         ||
+
+Example: _e$template_filter 0_
+
+=== Map Type ===
+_N_ is a boolean variable (0/1) that selects standard map generation or maze map generation.
+
+|| *Value* || *Map Type*   ||
+|| 0       || Standard Map ||
+|| 1       || Maze Map     ||
+
+Example: _e$mapgen 1_
+
+=== Maze Value ===
+_N_ selects the type of maze selected, similarly to Template Filter
+
+|| *Value* || *Filter Selected*       ||
+|| 0       || Small Tunnels           ||
+|| 1       || Medium Tunnels          ||
+|| 2       || Large Tunnels           ||
+|| 3       || Small Floating Islands  ||
+|| 4       || Medium Floating Islands ||
+|| 5       || Large Floating Islands  ||
+
+Example: _e$mazesize 4_
+
+= In-Game =
\ No newline at end of file