Hey guys
Have been working on my terrain editor. Thought it deserves to create a demo video for it.
I’m using BSP algorithm and Java’s Random to procedurally generate the terrain.
It’s ES based and terrain blocks and bridge blocks are represented with ES at server side.
The TerrainSystem at server side generate collision shapes and navigation components for terrain blocks. Not done yet, will put another video for it when done.
Edit:
Also there is an option to create prefab/blueprint from terrain as JSON data using Gson library.
This is an example of exported json data. it’s aroun 14 kb
////
{"components":[{"cType":"Terrain","scale":100,"minBlockSize":25,"maxBlockSize":55,"seed":1,"firstBridgeModel":1,"secondBridgeModel":1},{"cType":"Scene","name":"terrain-1","worldWidth":1000.0,"worldHeight":1000.0,"scenarioId":0},{"cType":"SceneState","state":2},{"cType":"EntityName","nameId":14},{"cType":"Level","level":0}],"children":[{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"BridgeBlock","bridgeModel":1,"size":1,"fillDirection":5},{"cType":"BlockInfo","type":2,"number":48},{"cType":"BlockJoint","parentBlockNumber":6,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-90.45714,"y":1.0598588,"z":-17.159523},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":1}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"BridgeBlock","bridgeModel":1,"size":2,"fillDirection":5},{"cType":"BlockInfo","type":2,"number":49},{"cType":"BlockJoint","parentBlockNumber":8,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-55.138092,"y":1.0598588,"z":-63.957138},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":1}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"BridgeBlock","bridgeModel":1,"size":1,"fillDirection":5},{"cType":"BlockInfo","type":2,"number":50},{"cType":"BlockJoint","parentBlockNumber":12,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-23.437778,"y":2.1197176,"z":-63.797615},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":1}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"BridgeBlock","bridgeModel":1,"size":1,"fillDirection":5},{"cType":"BlockInfo","type":2,"number":51},{"cType":"BlockJoint","parentBlockNumber":3,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-120.776184,"y":1.0598588,"z":-33.54079},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":1}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"BridgeBlock","bridgeModel":1,"size":1,"fillDirection":5},{"cType":"BlockInfo","type":2,"number":52},{"cType":"BlockJoint","parentBlockNumber":5,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-90.45714,"y":1.0598588,"z":-54.47857},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":1}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"BridgeBlock","bridgeModel":1,"size":1,"fillDirection":5},{"cType":"BlockInfo","type":2,"number":53},{"cType":"BlockJoint","parentBlockNumber":2,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-120.776184,"y":1.0598588,"z":-65.85983},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":1}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":17,"yExtent":3,"zExtent":17},{"cType":"BlockInfo","type":1,"number":1},{"cType":"BlockJoint","parentBlockNumber":53,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-120.776184,"y":0.0,"z":-80.019356},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":17,"yExtent":3,"zExtent":21},{"cType":"BlockInfo","type":1,"number":2},{"cType":"BlockJoint","parentBlockNumber":51,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-120.776184,"y":0.0,"z":-49.700314},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":17,"yExtent":3,"zExtent":31},{"cType":"BlockInfo","type":1,"number":3},{"cType":"BlockJoint","parentBlockNumber":47,"jointSide":1,"jointPosition":8,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-120.776184,"y":0.0,"z":-12.381268},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":21,"yExtent":3,"zExtent":20},{"cType":"BlockInfo","type":1,"number":4},{"cType":"BlockJoint","parentBlockNumber":52,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-90.45714,"y":0.0,"z":-70.13809},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":21,"yExtent":3,"zExtent":26},{"cType":"BlockInfo","type":1,"number":5},{"cType":"BlockJoint","parentBlockNumber":48,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-90.45714,"y":0.0,"z":-35.819046},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":21,"yExtent":3,"zExtent":23},{"cType":"BlockInfo","type":1,"number":6},{"cType":"BlockJoint","parentBlockNumber":43,"jointSide":1,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-90.45714,"y":0.0,"z":0.0},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":27,"yExtent":3,"zExtent":28},{"cType":"BlockInfo","type":1,"number":7},{"cType":"BlockJoint","parentBlockNumber":49,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-55.138092,"y":0.0,"z":-89.276184},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":27,"yExtent":3,"zExtent":20},{"cType":"BlockInfo","type":1,"number":8},{"cType":"BlockJoint","parentBlockNumber":44,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-55.138092,"y":0.0,"z":-42.638092},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":27,"yExtent":3,"zExtent":20},{"cType":"BlockInfo","type":1,"number":9},{"cType":"BlockJoint","parentBlockNumber":41,"jointSide":1,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-55.138092,"y":0.0,"z":0.0},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":17,"yExtent":3,"zExtent":18},{"cType":"BlockInfo","type":1,"number":10},{"cType":"BlockJoint","parentBlockNumber":50,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-23.437778,"y":1.0598588,"z":-78.45714},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":21,"yExtent":3,"zExtent":18},{"cType":"BlockInfo","type":1,"number":11},{"cType":"BlockJoint","parentBlockNumber":46,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":6.8812675,"y":1.0598588,"z":-78.45714},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":18,"yExtent":3,"zExtent":20},{"cType":"BlockInfo","type":1,"number":12},{"cType":"BlockJoint","parentBlockNumber":45,"jointSide":1,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-23.437778,"y":1.0598588,"z":-48.138092},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":20,"yExtent":3,"zExtent":20},{"cType":"BlockInfo","type":1,"number":13},{"cType":"BlockJoint","parentBlockNumber":42,"jointSide":5,"jointPosition":5,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":6.8812675,"y":1.0598588,"z":-48.138092},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"TerrainBlock","xExtent":38,"yExtent":3,"zExtent":31},{"cType":"BlockInfo","type":1,"number":14},{"cType":"BlockJoint","parentBlockNumber":0,"jointSide":0,"jointPosition":0,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":0.0,"y":0.0,"z":0.0},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":0}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"BridgeBlock","bridgeModel":1,"size":2,"fillDirection":2},{"cType":"BlockInfo","type":2,"number":41},{"cType":"BlockJoint","parentBlockNumber":14,"jointSide":1,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-30.319046,"y":1.0598588,"z":0.0},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":1}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"BridgeBlock","bridgeModel":1,"size":2,"fillDirection":5},{"cType":"BlockInfo","type":2,"number":42},{"cType":"BlockJoint","parentBlockNumber":14,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":0.0,"y":1.0598588,"z":-26.819046},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":1}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"BridgeBlock","bridgeModel":1,"size":1,"fillDirection":2},{"cType":"BlockInfo","type":2,"number":43},{"cType":"BlockJoint","parentBlockNumber":9,"jointSide":1,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-74.297615,"y":1.0598588,"z":0.0},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":1}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"BridgeBlock","bridgeModel":1,"size":2,"fillDirection":5},{"cType":"BlockInfo","type":2,"number":44},{"cType":"BlockJoint","parentBlockNumber":9,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-55.138092,"y":1.0598588,"z":-21.319046},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":1}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"BridgeBlock","bridgeModel":1,"size":1,"fillDirection":2},{"cType":"BlockInfo","type":2,"number":45},{"cType":"BlockJoint","parentBlockNumber":13,"jointSide":1,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-8.778255,"y":2.1197176,"z":-48.138092},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":1}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"BridgeBlock","bridgeModel":1,"size":1,"fillDirection":5},{"cType":"BlockInfo","type":2,"number":46},{"cType":"BlockJoint","parentBlockNumber":13,"jointSide":5,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":6.8812675,"y":2.1197176,"z":-63.797615},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":1}],"children":[]},{"components":[{"cType":"Buff","target":{"id":143},"type":1,"startTime":0},{"cType":"BridgeBlock","bridgeModel":1,"size":1,"fillDirection":2},{"cType":"BlockInfo","type":2,"number":47},{"cType":"BlockJoint","parentBlockNumber":6,"jointSide":1,"jointPosition":2,"offset":{"x":0.0,"y":0.0,"z":0.0}},{"cType":"SpawnPosition","location":{"x":-106.61666,"y":1.0598588,"z":0.0},"orientation":{"x":0.0,"y":0.0,"z":0.0,"w":1.0}},{"cType":"Interactable","interactable":true},{"cType":"EntityTag","tag":1}],"children":[]}]}
///