- How the JSON configuration is loaded. Is it imported and bundled? Loaded at runtime? The number one thing I’m begging for these days are examples of data-driven games. There’s a playground example of almost anything, but most have everything hard-coded, which makes it very difficult to build a full game of off.
So right now everything gets loaded during runtime, right now both the client and server loads the scene (and I am working on making it only the server loading the scene, and sending it to the client).
So client is JSON → DTO → iterating through the entities in the entity-system, loading the required assets with the asset-system, and then putting them into the game.
The server is JSON → DTO → iterating through the entities and creating the required schemas.
The scene format is straight forward:
{
"metadata": {
"version": "0.1",
"name": "Mystic Meadows",
"author": "Basic",
"description": "A mystical place."
},
"environment": {
"lightDirection": {
"x": 0,
"y": 1,
"z": 0
},
"lightIntensity": 1.2,
"skybox": "mp_drakeq",
"heightmap": {
"name": "test",
"width": 256,
"height": 256,
"minHeight": 0,
"maxHeight": 16
}
},
"entities": [
{
"id": "spawn_0",
"prefab": "spawn",
"components": [
{
"type": "transform",
"position": {
"x": -10,
"y": 4,
"z": 30
}
},
{
"type": "mesh_rendering",
"meshes": [
{
"type": "model",
"position": {
"x": 0,
"y": -3,
"z": 0
},
"modelPath": "prop/base.glb"
}
]
},
{
"type": "ui",
"elements": [
{
"id": "name",
"type": "text",
"text": "SPAWN",
"fontSize": "256",
"color": "white"
}
]
},
{
"type": "spawn_point"
}
]
},
{
"id": "boombox",
"components": [
{
"type": "transform",
"position": {
"x": 6,
"y": 5,
"z": 62
}
},
{
"type": "mesh_rendering",
"meshes": [
{
"type": "model",
"position": {
"x": 0,
"y": -3,
"z": 0
},
"scale": {
"x": 0.2,
"y": 0.2,
"z": 0.2
},
"modelPath": "equipment/pls_donate_big_boombox/scene.gltf"
}
]
},
{
"type": "ui",
"elements": [
{
"id": "name",
"type": "text",
"text": "PARTY",
"fontSize": "256",
"color": "green"
}
]
},
{
"type": "sound",
"sound": "music/party-time.ogg",
"loop": true
}
]
},
{
"id": "portal_river",
"components": [
{
"type": "transform",
"position": {
"x": -55,
"y": 3,
"z": 13
},
"scale": { "x": 1, "y": 1, "z": 1 },
"rotation": { "x": 0, "y": 0, "z": 0 }
},
{
"type": "collider",
"colliders": [
{
"type": "box",
"position": {
"x": 0,
"y": 0,
"z": 0
},
"size": {
"x": 5,
"y": 5,
"z": 5
}
}
]
},
{
"type": "trigger",
"actions": [
{
"type": "teleport_space",
"id": "river"
}
]
},
{
"type": "mesh_rendering",
"meshes": [
{
"type": "primitive",
"primitiveType": "sphere",
"radius": 2.5,
"position": {
"x": 0,
"y": 0,
"z": 0
},
"material": {
"diffuseColor": {
"r": 0,
"g": 0,
"b": 0
},
"specularColor": {
"r": 0,
"g": 0,
"b": 0
},
"emissiveColor": {
"r": 0.2,
"g": 0.2,
"b": 0.2
},
"specularPower": 64,
"reflection": {
"texturePath": "skybox/miramar/miramar",
"level": 0.5
},
"fresnel": {
"bias": 0.4,
"power": 2,
"leftColor": {
"r": 0,
"g": 0,
"b": 0
},
"rightColor": {
"r": 1,
"g": 1,
"b": 1
}
}
},
"glow": true
},
{
"type": "model",
"modelPath": "prop/teleporter.glb",
"position": { "x": 0, "y": -3, "z": 0 }
}
]
},
{
"type": "ui",
"elements": [
{
"id": "name",
"type": "text",
"text": "RIVER",
"fontSize": "128",
"color": "lime"
}
]
},
{
"type": "particle",
"texture": {
"path": "vfx/dot.png",
"hasAlpha": true
},
"color1": {
"r": 0.2,
"g": 0.2,
"b": 0.5,
"a": 1
},
"color2": {
"r": 0.2,
"g": 0.8,
"b": 1.0,
"a": 0
},
"colorDead": {
"r": 0.2,
"g": 0,
"b": 0,
"a": 0
},
"minSize": 0.1,
"maxSize": 0.5,
"minLifeTime": 0.3,
"maxLifeTime": 1.5,
"emitRate": 100,
"minEmitPower": 1,
"maxEmitPower": 3,
"updateSpeed": 0.01
}
]
},
}
}
}