For some situations it might be a useful feature to be able to change the map layout while the players are playing. This will allow us to implement features which allow the players to affect the ingame world with their actions. Examples are:
This message is sent by the map server to inform the clients about the differences between the original map as it is in the map files and its current state. The packet can either include the changes in a rectangular section of the map or of the whole map (by defining a rectangle which spans the whole map).
It is sent:
GPMSG_MAP_LAYOUT_PATCH byte layer, coordinates x_y, coordinates width_height, byte compression_method,{ int16 data }
When the walkmap is changed some beings might end up stuck in an inaccessible area. The feature which invokes the map change is responsible for preventing or fixing this situation. Examples for handling this are:
Note regarding detecting such situations: Remember that we are developing a massive multiplayer online game. You never know how many (or few) characters are in one area.
Bertram - 2010/02/01: Maps files could also have preset multi-state parts stored within their data. The server could then trigger the state of the wanted map part, which could still be the entire map. Then, the task to reload the map part would only go to the client. This state mechanism, if well thought, could also add/remove layers, and/or change its size. Last but no least: We still have to think about the multi-level map design and handling.
This message allows to change a map property like background music or ambient overlays. It is used in the same way as the layout patch message - when the client enters the map or when a change occurs.
GPMSG_MAP_PROPERTY_PATCH { string key, byte mode, string value }
The patch can include any number of key/mode/value combinations.
Bertram - 2010/03/31: Again, here, maybe we should go more likely for presets triggered by the server.
Otherwise, the server will have to be aware of available ambient overlays, music files, etc...
I'd provide this, IMHO:
**GPMSG_MAP_PROPERTY_CHANGE { string key, byte preset }**
Change a visible map property the client should take care of.
* **key** is the affected property. ("overlay{0,1,...,n}", "music", "title", ...)
* **preset** The map preset to be loaded by the client. A 0 value means that this property should be disabled, or emptied.
In other cases, the value tells the client which preset is to be used for the corresponding **key** value.
On client side, the preset values are map properties stored as: preset_<key>_<preset>="value"
If the client doesn't have such preset, nothing happens.