Page 1 of 2

Layered Earth

PostPosted: Tue Dec 18, 2012 6:17 am
by ImpalerWrG
While digging in Salem I've realized that the map structure basically consists of a Height value at each tile corner and a material type (soil, clay, stone, lime) for each tile. This is a rather simplistic implementation and it's having some effects that are both illogical and annoying. No matter how deep one digs the material type never changes, its as if the world is constructed of vertically oriented columns of material but with different heights.

I propose this be modified to a layer system, the layers occur in specific order both to keep the system simple computationally and for the player. Of the 4 materials they would always occur in top-2-bottom order of Soil > Clay > Lime > Stone. Each material has its own separate elevation value but they are constrained such that they obey Soil >= Clay >= Lime >= Stone, the difference between each is thus the thickness of the layer, when two values are equal it means you have a zero thickness layer. By very simple comparisons its possible to determine what the top most material should be displayed for situations ware Soil has been stripped away exposing something underneath. Map generation consists of generating 4 randomized height-maps with the lower levels being more rough so they poke up and form mountains or outcroppings that will be useful for the player.

This system would have a lot of benefits, first and foremost it lets the player access all 4 materials almost any ware with sufficient effort. Second it allows the dig/fill system to be extended to all 4 materials rather then just soil. Currently any removal of Clay, Lime and Stone is irreparable not only in that it consumes a finite resource but the hole can never be filled in with ANYTHING. Under the layering system a tile of any material can accept a boulder/pile of like material OR any higher level material, so for example soil can be placed over atone. It's would just re-establish that layer and keep the proper layer structure intact. Paving and grass are of no thickness so that would be possible to do on anything as well the data being encoded separate from layer-elevations, I see no reason to disallow it on clay as is presently the case nor why structures can't be placed on clay (Any home builder will tell you it's an excellent foundation).

Finally I think Clay should be dug by the 'boulder' method similar to lime with the chunks yielding at least 5 clay, the amount of ground deflation caused by digging enough clay for objects that are quite modest in size is just absurd (We have managed to create a quite larger crater already just making a dozen urns), I have no issue with the humor drain involved in getting the clay just the huge holes. And lastly clay really need to look different from soil, but I'm sure that's been mentioned before.

Re: Layered Earth

PostPosted: Tue Dec 18, 2012 8:14 am
by Procne
I don't think the benefits you listed warrant the more complicated and resource-heavy implamantation.
Height maps are pretty much a standard in gaming - they are cheap and easy to deal with.

Re: Layered Earth

PostPosted: Tue Dec 18, 2012 11:40 am
by ImpalerWrG
Procne, are you speaking from a technical background on server based games? I have a basic understanding and estimate that Salem elevation values are probably in 1 or 2 Bytes and Material in another Byte and 'Cover' (grass, paved etc) in yet another. That's about 4 Bytes minimum to store it, what I'm proposing would need 3 additional elevation values which would be 6 Bytes, minus the now superfluous Material Byte and the net is 5 Bytes about double the current amount. I don't know how large the worlds are but I doubt very much that the raw land height map amounts to more then a fraction of the total, and in any case memory is cheap, its processing power and bandwidth that are imitators and this doesn't add to either.

Re: Layered Earth

PostPosted: Tue Dec 18, 2012 12:07 pm
by MvGulik
Wonder if you can fill up a clay pit with other/normal soil. (presuming you can than dig for some more clay.)

Re: Layered Earth

PostPosted: Tue Dec 18, 2012 12:24 pm
by Procne
Doubling memory usage for the map alone is not something you can simply ignore.
Then client code which displays terrain gets more complicated. Basically all custom clients get broken for a tleast couple of days and loftar has to rewrite default client as well. Also client and server code responsible for terraforming. And all the code related to terrain in any way - building placement, spawning, grass/biome growth etc.
Plus map data packets from server to client also have to be changed, to include info about which layer is visible. And I assume that majority of comunication between server and client consists of those packets. So it has impact on bandwidth as well.

All this for what? So that you can mine lime anywhere in the world with enough effort? Not worth it imo.

Re: Layered Earth

PostPosted: Tue Dec 18, 2012 12:27 pm
by Dallane
Everyone is forgetting they would have to wipe the map and remake it also

Re: Layered Earth

PostPosted: Tue Dec 18, 2012 12:29 pm
by Potjeh
Worth it if they add granite quarries while they're at it ;)

Re: Layered Earth

PostPosted: Tue Dec 18, 2012 12:41 pm
by Dallane
Potjeh wrote:Worth it if they add granite quarries while they're at it ;)


oh god yes

Re: Layered Earth

PostPosted: Tue Dec 18, 2012 12:58 pm
by ImpalerWrG
I had actually though of suggesting that Granite replace generic Stone for that bottom most layer but decided that would probably come off as some kind of wet-dream and distract from what I think are the real merits of this approach. That you feel in control of your clay/lime/stone resource and location is reduced as a determinant factor (death to quality nodes).

Naturally any change to basic map structure would require complete regeneration of the world, thus the better to do it early. Surely no one here is operating under any illusion that the servers will not be wiped at the end of Beta or maybe several more times in Beta, ideally another new server would test this structure change.

Re: Layered Earth

PostPosted: Tue Dec 18, 2012 1:01 pm
by Dallane
ImpalerWrG wrote:Naturally any change to basic map structure would require complete regeneration of the world, thus the better to do it early. Surely no one here is operating under any illusion that the servers will not be wiped at the end of Beta or maybe several more times in Beta, ideally another new server would test this structure change.


Actually you are wrong. There will be no more wipes unless something really bad happens.