0
|
1 |
#summary Protocol for frontend/engine interaction.
|
|
2 |
#labels Documentation
|
|
3 |
|
|
4 |
= Introduction =
|
|
5 |
|
|
6 |
The frontend interacts with the engine in two separate occasions:
|
|
7 |
* map preview generation;
|
|
8 |
* game setup and statistics messages.
|
|
9 |
|
|
10 |
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).
|
|
11 |
|
|
12 |
= Map Preview =
|
|
13 |
Frontend needs to generate a preview of the map that is going to be used in game; there is no handshaking.
|
|
14 |
|
|
15 |
Files on which this protocol is implemented: MapConfigViewController.m
|
|
16 |
== Protocol ==
|
|
17 |
|| *Frontend* || *Engine* || *Format* ||
|
|
18 |
|| UUID || || {{{eseed{ ... }}}} ||
|
|
19 |
|| Template Filter || || {{{e$template_filter N}}} ||
|
|
20 |
|| Map Type || || {{{e$mapgen N}}} ||
|
|
21 |
|| Maze Value || || {{{e$maze N}}} ||
|
|
22 |
|| || 128x32 byte array || {{{0YSD3 ... FSAD0}}} ||
|
|
23 |
|
|
24 |
=== UUID ===
|
|
25 |
The UUID is a 32 bytes array composed of ASCII characters; groups of letters should be separated by '-'.
|
|
26 |
|
|
27 |
Example: _eseed {AERTB-62FASDSAD-NNIASDSADASD-12P}_
|
|
28 |
|
|
29 |
=== Template Filter ===
|
|
30 |
_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.
|
|
31 |
|
|
32 |
|| *Value* || *Filter Selected* ||
|
|
33 |
|| 0 || None ||
|
|
34 |
|| 1 || Large ||
|
|
35 |
|| 2 || Medium ||
|
|
36 |
|| 3 || Small ||
|
|
37 |
|| 4 || Cavern ||
|
|
38 |
|| 5 || Wacky ||
|
|
39 |
|
|
40 |
Example: _e$template_filter 0_
|
|
41 |
|
|
42 |
=== Map Type ===
|
|
43 |
_N_ is a boolean variable (0/1) that selects standard map generation or maze map generation.
|
|
44 |
|
|
45 |
|| *Value* || *Map Type* ||
|
|
46 |
|| 0 || Standard Map ||
|
|
47 |
|| 1 || Maze Map ||
|
|
48 |
|
|
49 |
Example: _e$mapgen 1_
|
|
50 |
|
|
51 |
=== Maze Value ===
|
|
52 |
_N_ selects the type of maze selected, similarly to Template Filter
|
|
53 |
|
|
54 |
|| *Value* || *Filter Selected* ||
|
|
55 |
|| 0 || Small Tunnels ||
|
|
56 |
|| 1 || Medium Tunnels ||
|
|
57 |
|| 2 || Large Tunnels ||
|
|
58 |
|| 3 || Small Floating Islands ||
|
|
59 |
|| 4 || Medium Floating Islands ||
|
|
60 |
|| 5 || Large Floating Islands ||
|
|
61 |
|
|
62 |
Example: _e$mazesize 4_
|
|
63 |
|
|
64 |
= In-Game = |