I am not sure if somebody asked but i want to know how to start server with my own terrain heightmap/geometry? Mercator is used only to decorate (client&serverside) base terrain?
Neither Cyphesis nor Ember currently have direct support for heightmap terrain. You are of course free to use the terrain editor controls in Ember to manipulate and modify the Mercator terrain, but it does not give you full heightmap control. If you want heightmap terrain you are of course free to implement it, either as a complement to the existing system, or as a complete alternative.
All the terrain is generated in terrain.py script in rulesets? Am I right? I searched it yesterday, also I was trying to wrote python function which get data form grayscale-bmp and use it in the same way as terrain.py script:
So, few questions:
surfaces = [{name:, sth:sth } , ]
does it defines the world texture depending on height (?)
m.set( ) - sets up the world puting data generated earlier to mapeditor m (methinks). but what is the meaning of that: [code] world = m.look() [\code] Is these part of server documented somewhere? There is a way to contorol how "dense" mesh will be produced basing on data provided in script? Are there any boundings for number of control points(these ones which define height) in the world map?
terrain.py contains some obsolete utility functions for quickly setting up terrain.
The default server terrain is defined in rulesets/mason/define_world.py in the _setup_terrain() function, but in any case these client scripts only define the coarse control points for the terrain. The detailed terrain data is generated algorithmically by the C++ Mercator terrain library internally to both the server and the client. Mercator guarantees that given the same control points exactly the same data will be generated in both places.
The "surfaces" declares the rules used to define the terrain surface, and yes some of those rules depend on height. For example the snow terrain surface only occurs above a certain altitude. The grass terrain surface also depends on height, and in addition only grows on terrain which is less steep than the cutoff parameter. More details of the algorithms involved can be found in the comment sections of the Mercator library.
m.look() is used to obtain a reference to the world entity on the server. m.set is then used to send changes to the server entity's attributes. By changing the world's terrain attribute the server is caused to regenerate therrain data based on new values. mapeditor is an instance of cyphesis.editor and is simply a helper class for creating and sending messages to the server.
We currently do not have a way to modify the density of the terrain mesh.
The control points are currently fixed at 64 metres apart, and no limit is implemented on how many you can have. In practice performance will degrade the more terrain you add, and eventually there will be issues with the precision of floating point numbers.
Note that the generated terrain can be modified using what we call "terrain mods". Any entity can act as a terrain modifier. Here's a video showing how a terrain mod which flatten the ground is applied to a house entity: http://www.youtube.com/watch?v=H_9-_9Fi ... re=related