recursive foliage definition files
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
b21343b830
commit
b08d008a08
@ -1,248 +1,9 @@
|
|||||||
{
|
{
|
||||||
"foliageList" : [
|
"foliageList" : [
|
||||||
{
|
],
|
||||||
"id" : "Green Grass",
|
"files" : [
|
||||||
"tokens" : [
|
"Data/entity/foliage/grass.json",
|
||||||
"AMBIENT",
|
"Data/entity/foliage/trees.json",
|
||||||
"REACTS_TO_WIND",
|
"Data/entity/foliage/bushes.json"
|
||||||
"GROWS_BACK",
|
|
||||||
"FLAMMABLE"
|
|
||||||
],
|
|
||||||
"growthModel": {
|
|
||||||
"growthRate" : 0.001
|
|
||||||
},
|
|
||||||
"grassData": {
|
|
||||||
"baseColor": {"x": 0.25, "y": 0.6, "z": 0.43},
|
|
||||||
"tipColor": {"x": 0.17, "y": 0.71, "z": 0.12},
|
|
||||||
"maxTipCurve" : 0.27,
|
|
||||||
"minHeight" : 0.7,
|
|
||||||
"maxHeight" : 1.3
|
|
||||||
},
|
|
||||||
"graphicsTemplate": {
|
|
||||||
"model": {
|
|
||||||
"path" : "Models/foliage/grass2.fbx"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id" : "pine",
|
|
||||||
"tokens" : [
|
|
||||||
"TREE",
|
|
||||||
"REACTS_TO_WIND",
|
|
||||||
"GROWS_BACK",
|
|
||||||
"FLAMMABLE",
|
|
||||||
"SEEDED"
|
|
||||||
],
|
|
||||||
"growthModel": {
|
|
||||||
"growthRate" : 0.001
|
|
||||||
},
|
|
||||||
"ambientAudio": {
|
|
||||||
"responseWindAudioFilePath": "Audio/ambienceWind1SeamlessMono.ogg",
|
|
||||||
"responseWindLoops": true,
|
|
||||||
"randomizeOffset": true,
|
|
||||||
"gainMultiplier": 0.9,
|
|
||||||
"emitterSpatialOffset": [0,3,0]
|
|
||||||
},
|
|
||||||
"graphicsTemplate": {
|
|
||||||
"proceduralModel": {
|
|
||||||
"treeModel": {
|
|
||||||
"trunkModel": {
|
|
||||||
"trunkScalarFalloffFactor": 0.2,
|
|
||||||
"minimumTrunkScalar": 0.2,
|
|
||||||
"maximumTrunkSegments": 6,
|
|
||||||
"physicsCutoff": 3,
|
|
||||||
"centralTrunk": true
|
|
||||||
},
|
|
||||||
"branchModel": {
|
|
||||||
"limbScalarFalloffFactor": 0.3,
|
|
||||||
"minimumLimbScalar": 0.25,
|
|
||||||
"maximumLimbDispersion": 0.5,
|
|
||||||
"minimumLimbDispersion": 0.3,
|
|
||||||
"minimumNumberForks": 3,
|
|
||||||
"maximumNumberForks": 5,
|
|
||||||
"maximumBranchSegments": 3,
|
|
||||||
"maxBranchSegmentFalloffFactor": 1,
|
|
||||||
"minimumSegmentToSpawnLeaves": 2
|
|
||||||
},
|
|
||||||
"minBranchHeightToStartSpawningLeaves": 1.5,
|
|
||||||
"maxBranchHeightToStartSpawningLeaves": 3.01,
|
|
||||||
"leafIncrement": 0.5,
|
|
||||||
"minLeavesToSpawnPerPoint": 3,
|
|
||||||
"maxLeavesToSpawnPerPoint": 5,
|
|
||||||
"leafDistanceFromCenter": 1.2,
|
|
||||||
"peelVariance": 0.2,
|
|
||||||
"peelMinimum": 0.1,
|
|
||||||
"swaySigmoidFactor": 2,
|
|
||||||
"minimumSwayTime": 500,
|
|
||||||
"swayTimeVariance": 500,
|
|
||||||
"yawVariance": 0.2,
|
|
||||||
"yawMinimum": 0.1,
|
|
||||||
"minimumScalarToGenerateSwayTree": 0.5,
|
|
||||||
"maximumScalarToGenerateSwayTree": 1.0,
|
|
||||||
"branchHeight": 3,
|
|
||||||
"physicsBody": {
|
|
||||||
"type" : "CYLINDER",
|
|
||||||
"dimension1" : 0.5,
|
|
||||||
"dimension2" : 3,
|
|
||||||
"dimension3" : 0.5,
|
|
||||||
"rotX": 0,
|
|
||||||
"rotY": 0,
|
|
||||||
"rotZ": 0,
|
|
||||||
"rotW": 1,
|
|
||||||
"offsetX" : 0,
|
|
||||||
"offsetY" : 1.5,
|
|
||||||
"offsetZ" : 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id" : "oak",
|
|
||||||
"tokens" : [
|
|
||||||
"TREE",
|
|
||||||
"REACTS_TO_WIND",
|
|
||||||
"GROWS_BACK",
|
|
||||||
"FLAMMABLE",
|
|
||||||
"SEEDED"
|
|
||||||
],
|
|
||||||
"growthModel": {
|
|
||||||
"growthRate" : 0.001
|
|
||||||
},
|
|
||||||
"ambientAudio": {
|
|
||||||
"responseWindAudioFilePath": "Audio/ambienceWind1SeamlessMono.ogg",
|
|
||||||
"responseWindLoops": true,
|
|
||||||
"randomizeOffset": true,
|
|
||||||
"gainMultiplier": 0.9,
|
|
||||||
"emitterSpatialOffset": [0,3,0]
|
|
||||||
},
|
|
||||||
"graphicsTemplate": {
|
|
||||||
"proceduralModel": {
|
|
||||||
"treeModel": {
|
|
||||||
"trunkModel": {
|
|
||||||
"maximumTrunkSegments": 4,
|
|
||||||
"physicsCutoff": 3,
|
|
||||||
"centralTrunk": false
|
|
||||||
},
|
|
||||||
"branchModel": {
|
|
||||||
"limbScalarFalloffFactor": 0.3,
|
|
||||||
"minimumLimbScalar": 0.25,
|
|
||||||
"maximumLimbDispersion": 0.5,
|
|
||||||
"minimumLimbDispersion": 0.3,
|
|
||||||
"minimumNumberForks": 3,
|
|
||||||
"maximumNumberForks": 5,
|
|
||||||
"maximumBranchSegments": 3,
|
|
||||||
"maxBranchSegmentFalloffFactor": 1,
|
|
||||||
"minimumSegmentToSpawnLeaves": 2
|
|
||||||
},
|
|
||||||
"minBranchHeightToStartSpawningLeaves": 1.5,
|
|
||||||
"maxBranchHeightToStartSpawningLeaves": 3.01,
|
|
||||||
"leafIncrement": 0.5,
|
|
||||||
"minLeavesToSpawnPerPoint": 3,
|
|
||||||
"maxLeavesToSpawnPerPoint": 5,
|
|
||||||
"leafDistanceFromCenter": 1.2,
|
|
||||||
"peelVariance": 0.2,
|
|
||||||
"peelMinimum": 0.1,
|
|
||||||
"swaySigmoidFactor": 2,
|
|
||||||
"minimumSwayTime": 500,
|
|
||||||
"swayTimeVariance": 500,
|
|
||||||
"yawVariance": 0.2,
|
|
||||||
"yawMinimum": 0.1,
|
|
||||||
"minimumScalarToGenerateSwayTree": 0.5,
|
|
||||||
"maximumScalarToGenerateSwayTree": 1.0,
|
|
||||||
"branchHeight": 3,
|
|
||||||
"physicsBody": {
|
|
||||||
"type" : "CYLINDER",
|
|
||||||
"dimension1" : 0.5,
|
|
||||||
"dimension2" : 3,
|
|
||||||
"dimension3" : 0.5,
|
|
||||||
"rotX": 0,
|
|
||||||
"rotY": 0,
|
|
||||||
"rotZ": 0,
|
|
||||||
"rotW": 1,
|
|
||||||
"offsetX" : 0,
|
|
||||||
"offsetY" : 1.5,
|
|
||||||
"offsetZ" : 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id" : "pine2",
|
|
||||||
"tokens" : [
|
|
||||||
"TREE",
|
|
||||||
"FLAMMABLE"
|
|
||||||
],
|
|
||||||
"hitboxes" : [
|
|
||||||
{
|
|
||||||
"type": "hurt",
|
|
||||||
"offset": [0, 0.045, 0],
|
|
||||||
"radius": 0.175
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "hurt",
|
|
||||||
"offset": [0, 0.6, 0],
|
|
||||||
"radius": 0.175
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "hurt",
|
|
||||||
"offset": [0, 1.2, 0],
|
|
||||||
"radius": 0.175
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "hurt",
|
|
||||||
"offset": [0, 1.8, 0],
|
|
||||||
"radius": 0.175
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"collidable" : {
|
|
||||||
"type" : "CYLINDER",
|
|
||||||
"dimension1" : 0.2,
|
|
||||||
"dimension2" : 1.6,
|
|
||||||
"dimension3" : 0.2,
|
|
||||||
"linearFriction": 0.001,
|
|
||||||
"mass": 0.3,
|
|
||||||
"rotX": 0,
|
|
||||||
"rotY": 0,
|
|
||||||
"rotZ": 0,
|
|
||||||
"rotW": 1,
|
|
||||||
"offsetX" : 0,
|
|
||||||
"offsetY" : 0.8,
|
|
||||||
"offsetZ" : 0,
|
|
||||||
"kinematic" : true
|
|
||||||
},
|
|
||||||
"healthSystem" : {
|
|
||||||
"maxHealth" : 50,
|
|
||||||
"onDamageIFrames" : 5,
|
|
||||||
"lootPool" : {
|
|
||||||
"tickets" : [
|
|
||||||
{
|
|
||||||
"itemId" : "Log",
|
|
||||||
"rarity" : 0.8,
|
|
||||||
"minQuantity" : 0,
|
|
||||||
"maxQuantity" : 2
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"graphicsTemplate": {
|
|
||||||
"model": {
|
|
||||||
"path" : "Models/foliage/tree4.glb"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id" : "bush4",
|
|
||||||
"tokens" : [
|
|
||||||
"FLAMMABLE"
|
|
||||||
],
|
|
||||||
"graphicsTemplate": {
|
|
||||||
"model": {
|
|
||||||
"path" : "Models/foliage/bush4.glb"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
17
assets/Data/entity/foliage/bushes.json
Normal file
17
assets/Data/entity/foliage/bushes.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"foliageList" : [
|
||||||
|
{
|
||||||
|
"id" : "bush4",
|
||||||
|
"tokens" : [
|
||||||
|
"FLAMMABLE"
|
||||||
|
],
|
||||||
|
"graphicsTemplate": {
|
||||||
|
"model": {
|
||||||
|
"path" : "Models/foliage/bush4.glb"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"files" : [
|
||||||
|
]
|
||||||
|
}
|
||||||
30
assets/Data/entity/foliage/grass.json
Normal file
30
assets/Data/entity/foliage/grass.json
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"foliageList" : [
|
||||||
|
{
|
||||||
|
"id" : "Green Grass",
|
||||||
|
"tokens" : [
|
||||||
|
"AMBIENT",
|
||||||
|
"REACTS_TO_WIND",
|
||||||
|
"GROWS_BACK",
|
||||||
|
"FLAMMABLE"
|
||||||
|
],
|
||||||
|
"growthModel": {
|
||||||
|
"growthRate" : 0.001
|
||||||
|
},
|
||||||
|
"grassData": {
|
||||||
|
"baseColor": {"x": 0.25, "y": 0.6, "z": 0.43},
|
||||||
|
"tipColor": {"x": 0.17, "y": 0.71, "z": 0.12},
|
||||||
|
"maxTipCurve" : 0.27,
|
||||||
|
"minHeight" : 0.7,
|
||||||
|
"maxHeight" : 1.3
|
||||||
|
},
|
||||||
|
"graphicsTemplate": {
|
||||||
|
"model": {
|
||||||
|
"path" : "Models/foliage/grass2.fbx"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"files" : [
|
||||||
|
]
|
||||||
|
}
|
||||||
214
assets/Data/entity/foliage/trees.json
Normal file
214
assets/Data/entity/foliage/trees.json
Normal file
@ -0,0 +1,214 @@
|
|||||||
|
{
|
||||||
|
"foliageList" : [
|
||||||
|
{
|
||||||
|
"id" : "pine",
|
||||||
|
"tokens" : [
|
||||||
|
"TREE",
|
||||||
|
"REACTS_TO_WIND",
|
||||||
|
"GROWS_BACK",
|
||||||
|
"FLAMMABLE",
|
||||||
|
"SEEDED"
|
||||||
|
],
|
||||||
|
"growthModel": {
|
||||||
|
"growthRate" : 0.001
|
||||||
|
},
|
||||||
|
"ambientAudio": {
|
||||||
|
"responseWindAudioFilePath": "Audio/ambienceWind1SeamlessMono.ogg",
|
||||||
|
"responseWindLoops": true,
|
||||||
|
"randomizeOffset": true,
|
||||||
|
"gainMultiplier": 0.9,
|
||||||
|
"emitterSpatialOffset": [0,3,0]
|
||||||
|
},
|
||||||
|
"graphicsTemplate": {
|
||||||
|
"proceduralModel": {
|
||||||
|
"treeModel": {
|
||||||
|
"trunkModel": {
|
||||||
|
"trunkScalarFalloffFactor": 0.2,
|
||||||
|
"minimumTrunkScalar": 0.2,
|
||||||
|
"maximumTrunkSegments": 6,
|
||||||
|
"physicsCutoff": 3,
|
||||||
|
"centralTrunk": true
|
||||||
|
},
|
||||||
|
"branchModel": {
|
||||||
|
"limbScalarFalloffFactor": 0.3,
|
||||||
|
"minimumLimbScalar": 0.25,
|
||||||
|
"maximumLimbDispersion": 0.5,
|
||||||
|
"minimumLimbDispersion": 0.3,
|
||||||
|
"minimumNumberForks": 3,
|
||||||
|
"maximumNumberForks": 5,
|
||||||
|
"maximumBranchSegments": 3,
|
||||||
|
"maxBranchSegmentFalloffFactor": 1,
|
||||||
|
"minimumSegmentToSpawnLeaves": 2
|
||||||
|
},
|
||||||
|
"minBranchHeightToStartSpawningLeaves": 1.5,
|
||||||
|
"maxBranchHeightToStartSpawningLeaves": 3.01,
|
||||||
|
"leafIncrement": 0.5,
|
||||||
|
"minLeavesToSpawnPerPoint": 3,
|
||||||
|
"maxLeavesToSpawnPerPoint": 5,
|
||||||
|
"leafDistanceFromCenter": 1.2,
|
||||||
|
"peelVariance": 0.2,
|
||||||
|
"peelMinimum": 0.1,
|
||||||
|
"swaySigmoidFactor": 2,
|
||||||
|
"minimumSwayTime": 500,
|
||||||
|
"swayTimeVariance": 500,
|
||||||
|
"yawVariance": 0.2,
|
||||||
|
"yawMinimum": 0.1,
|
||||||
|
"minimumScalarToGenerateSwayTree": 0.5,
|
||||||
|
"maximumScalarToGenerateSwayTree": 1.0,
|
||||||
|
"branchHeight": 3,
|
||||||
|
"physicsBody": {
|
||||||
|
"type" : "CYLINDER",
|
||||||
|
"dimension1" : 0.5,
|
||||||
|
"dimension2" : 3,
|
||||||
|
"dimension3" : 0.5,
|
||||||
|
"rotX": 0,
|
||||||
|
"rotY": 0,
|
||||||
|
"rotZ": 0,
|
||||||
|
"rotW": 1,
|
||||||
|
"offsetX" : 0,
|
||||||
|
"offsetY" : 1.5,
|
||||||
|
"offsetZ" : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id" : "oak",
|
||||||
|
"tokens" : [
|
||||||
|
"TREE",
|
||||||
|
"REACTS_TO_WIND",
|
||||||
|
"GROWS_BACK",
|
||||||
|
"FLAMMABLE",
|
||||||
|
"SEEDED"
|
||||||
|
],
|
||||||
|
"growthModel": {
|
||||||
|
"growthRate" : 0.001
|
||||||
|
},
|
||||||
|
"ambientAudio": {
|
||||||
|
"responseWindAudioFilePath": "Audio/ambienceWind1SeamlessMono.ogg",
|
||||||
|
"responseWindLoops": true,
|
||||||
|
"randomizeOffset": true,
|
||||||
|
"gainMultiplier": 0.9,
|
||||||
|
"emitterSpatialOffset": [0,3,0]
|
||||||
|
},
|
||||||
|
"graphicsTemplate": {
|
||||||
|
"proceduralModel": {
|
||||||
|
"treeModel": {
|
||||||
|
"trunkModel": {
|
||||||
|
"maximumTrunkSegments": 4,
|
||||||
|
"physicsCutoff": 3,
|
||||||
|
"centralTrunk": false
|
||||||
|
},
|
||||||
|
"branchModel": {
|
||||||
|
"limbScalarFalloffFactor": 0.3,
|
||||||
|
"minimumLimbScalar": 0.25,
|
||||||
|
"maximumLimbDispersion": 0.5,
|
||||||
|
"minimumLimbDispersion": 0.3,
|
||||||
|
"minimumNumberForks": 3,
|
||||||
|
"maximumNumberForks": 5,
|
||||||
|
"maximumBranchSegments": 3,
|
||||||
|
"maxBranchSegmentFalloffFactor": 1,
|
||||||
|
"minimumSegmentToSpawnLeaves": 2
|
||||||
|
},
|
||||||
|
"minBranchHeightToStartSpawningLeaves": 1.5,
|
||||||
|
"maxBranchHeightToStartSpawningLeaves": 3.01,
|
||||||
|
"leafIncrement": 0.5,
|
||||||
|
"minLeavesToSpawnPerPoint": 3,
|
||||||
|
"maxLeavesToSpawnPerPoint": 5,
|
||||||
|
"leafDistanceFromCenter": 1.2,
|
||||||
|
"peelVariance": 0.2,
|
||||||
|
"peelMinimum": 0.1,
|
||||||
|
"swaySigmoidFactor": 2,
|
||||||
|
"minimumSwayTime": 500,
|
||||||
|
"swayTimeVariance": 500,
|
||||||
|
"yawVariance": 0.2,
|
||||||
|
"yawMinimum": 0.1,
|
||||||
|
"minimumScalarToGenerateSwayTree": 0.5,
|
||||||
|
"maximumScalarToGenerateSwayTree": 1.0,
|
||||||
|
"branchHeight": 3,
|
||||||
|
"physicsBody": {
|
||||||
|
"type" : "CYLINDER",
|
||||||
|
"dimension1" : 0.5,
|
||||||
|
"dimension2" : 3,
|
||||||
|
"dimension3" : 0.5,
|
||||||
|
"rotX": 0,
|
||||||
|
"rotY": 0,
|
||||||
|
"rotZ": 0,
|
||||||
|
"rotW": 1,
|
||||||
|
"offsetX" : 0,
|
||||||
|
"offsetY" : 1.5,
|
||||||
|
"offsetZ" : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id" : "pine2",
|
||||||
|
"tokens" : [
|
||||||
|
"TREE",
|
||||||
|
"FLAMMABLE"
|
||||||
|
],
|
||||||
|
"hitboxes" : [
|
||||||
|
{
|
||||||
|
"type": "hurt",
|
||||||
|
"offset": [0, 0.045, 0],
|
||||||
|
"radius": 0.175
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "hurt",
|
||||||
|
"offset": [0, 0.6, 0],
|
||||||
|
"radius": 0.175
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "hurt",
|
||||||
|
"offset": [0, 1.2, 0],
|
||||||
|
"radius": 0.175
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "hurt",
|
||||||
|
"offset": [0, 1.8, 0],
|
||||||
|
"radius": 0.175
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"collidable" : {
|
||||||
|
"type" : "CYLINDER",
|
||||||
|
"dimension1" : 0.2,
|
||||||
|
"dimension2" : 1.6,
|
||||||
|
"dimension3" : 0.2,
|
||||||
|
"linearFriction": 0.001,
|
||||||
|
"mass": 0.3,
|
||||||
|
"rotX": 0,
|
||||||
|
"rotY": 0,
|
||||||
|
"rotZ": 0,
|
||||||
|
"rotW": 1,
|
||||||
|
"offsetX" : 0,
|
||||||
|
"offsetY" : 0.8,
|
||||||
|
"offsetZ" : 0,
|
||||||
|
"kinematic" : true
|
||||||
|
},
|
||||||
|
"healthSystem" : {
|
||||||
|
"maxHealth" : 50,
|
||||||
|
"onDamageIFrames" : 5,
|
||||||
|
"lootPool" : {
|
||||||
|
"tickets" : [
|
||||||
|
{
|
||||||
|
"itemId" : "Log",
|
||||||
|
"rarity" : 0.8,
|
||||||
|
"minQuantity" : 0,
|
||||||
|
"maxQuantity" : 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"graphicsTemplate": {
|
||||||
|
"model": {
|
||||||
|
"path" : "Models/foliage/tree4.glb"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"files" : [
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -1423,6 +1423,7 @@ Add rock and stick items
|
|||||||
Update ServerEntityUtils.repositionEntityRecursive behavior
|
Update ServerEntityUtils.repositionEntityRecursive behavior
|
||||||
Add bush entity
|
Add bush entity
|
||||||
Add bushes to forest biome
|
Add bushes to forest biome
|
||||||
|
Make foliage data files recursive
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -176,7 +176,7 @@ public class FoliageCellManager {
|
|||||||
*/
|
*/
|
||||||
public void init(){
|
public void init(){
|
||||||
//queue ambient foliage models
|
//queue ambient foliage models
|
||||||
for(FoliageType foliageType : Globals.gameConfigCurrent.getFoliageMap().getFoliageList()){
|
for(FoliageType foliageType : Globals.gameConfigCurrent.getFoliageMap().getTypes()){
|
||||||
if(foliageType.getTokens().contains(FoliageType.TOKEN_AMBIENT)){
|
if(foliageType.getTokens().contains(FoliageType.TOKEN_AMBIENT)){
|
||||||
Globals.assetManager.addModelPathToQueue(foliageType.getGraphicsTemplate().getModel().getPath());
|
Globals.assetManager.addModelPathToQueue(foliageType.getGraphicsTemplate().getModel().getPath());
|
||||||
Globals.assetManager.addShaderToQueue(FoliageCell.vertexPath, FoliageCell.fragmentPath);
|
Globals.assetManager.addShaderToQueue(FoliageCell.vertexPath, FoliageCell.fragmentPath);
|
||||||
|
|||||||
@ -181,7 +181,7 @@ public class FoliageModel {
|
|||||||
Random placementRandomizer = new Random();
|
Random placementRandomizer = new Random();
|
||||||
//get type
|
//get type
|
||||||
String foliageTypeName = foliageTypesSupported.get(0);
|
String foliageTypeName = foliageTypesSupported.get(0);
|
||||||
FoliageType foliageType = Globals.gameConfigCurrent.getFoliageMap().getFoliage(foliageTypeName);
|
FoliageType foliageType = Globals.gameConfigCurrent.getFoliageMap().getType(foliageTypeName);
|
||||||
CommonEntityUtils.setCommonData(rVal, foliageType);
|
CommonEntityUtils.setCommonData(rVal, foliageType);
|
||||||
CommonEntityUtils.setEntityType(rVal, EntityType.FOLIAGE);
|
CommonEntityUtils.setEntityType(rVal, EntityType.FOLIAGE);
|
||||||
CommonEntityUtils.setEntitySubtype(rVal, foliageType.getId());
|
CommonEntityUtils.setEntitySubtype(rVal, foliageType.getId());
|
||||||
|
|||||||
@ -94,7 +94,7 @@ public class SpawnSelectionPanel {
|
|||||||
//get relevant types
|
//get relevant types
|
||||||
List<CommonEntityType> types = new LinkedList<CommonEntityType>();
|
List<CommonEntityType> types = new LinkedList<CommonEntityType>();
|
||||||
types.addAll(Globals.gameConfigCurrent.getCreatureTypeLoader().getTypes());
|
types.addAll(Globals.gameConfigCurrent.getCreatureTypeLoader().getTypes());
|
||||||
types.addAll(Globals.gameConfigCurrent.getFoliageMap().getFoliageList());
|
types.addAll(Globals.gameConfigCurrent.getFoliageMap().getTypes());
|
||||||
types.addAll(Globals.gameConfigCurrent.getItemMap().getTypes());
|
types.addAll(Globals.gameConfigCurrent.getItemMap().getTypes());
|
||||||
types.addAll(Globals.gameConfigCurrent.getObjectTypeMap().getTypes());
|
types.addAll(Globals.gameConfigCurrent.getObjectTypeMap().getTypes());
|
||||||
types = types.stream().filter((type) -> type.getId().toLowerCase().contains(searchString.toLowerCase())).toList();
|
types = types.stream().filter((type) -> type.getId().toLowerCase().contains(searchString.toLowerCase())).toList();
|
||||||
|
|||||||
@ -230,7 +230,7 @@ public class MenuGeneratorsLevelEditor {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
//button for spawning all foliage types
|
//button for spawning all foliage types
|
||||||
for(FoliageType data : Globals.gameConfigCurrent.getFoliageMap().getFoliageList()){
|
for(FoliageType data : Globals.gameConfigCurrent.getFoliageMap().getTypes()){
|
||||||
//spawn foliage button
|
//spawn foliage button
|
||||||
scrollable.addChild(Button.createButton("Spawn " + data.getId(), () -> {
|
scrollable.addChild(Button.createButton("Spawn " + data.getId(), () -> {
|
||||||
LoggerInterface.loggerEngine.INFO("spawn " + data.getId() + "!");
|
LoggerInterface.loggerEngine.INFO("spawn " + data.getId() + "!");
|
||||||
|
|||||||
@ -33,7 +33,7 @@ public class FoliageUtils {
|
|||||||
* @return The entity for the foliage
|
* @return The entity for the foliage
|
||||||
*/
|
*/
|
||||||
public static Entity clientSpawnBasicFoliage(String type, long seed){
|
public static Entity clientSpawnBasicFoliage(String type, long seed){
|
||||||
FoliageType rawType = Globals.gameConfigCurrent.getFoliageMap().getFoliage(type);
|
FoliageType rawType = Globals.gameConfigCurrent.getFoliageMap().getType(type);
|
||||||
Entity rVal;
|
Entity rVal;
|
||||||
if(
|
if(
|
||||||
rawType.getGraphicsTemplate().getProceduralModel() != null &&
|
rawType.getGraphicsTemplate().getProceduralModel() != null &&
|
||||||
@ -78,7 +78,7 @@ public class FoliageUtils {
|
|||||||
* @return the tree entity
|
* @return the tree entity
|
||||||
*/
|
*/
|
||||||
public static Entity serverSpawnTreeFoliage(Realm realm, Vector3d position, String type, long seed){
|
public static Entity serverSpawnTreeFoliage(Realm realm, Vector3d position, String type, long seed){
|
||||||
FoliageType rawType = Globals.gameConfigCurrent.getFoliageMap().getFoliage(type);
|
FoliageType rawType = Globals.gameConfigCurrent.getFoliageMap().getType(type);
|
||||||
Entity rVal;
|
Entity rVal;
|
||||||
if(
|
if(
|
||||||
rawType.getGraphicsTemplate().getProceduralModel() != null &&
|
rawType.getGraphicsTemplate().getProceduralModel() != null &&
|
||||||
|
|||||||
@ -101,7 +101,7 @@ public class ProceduralTree {
|
|||||||
Random treeRandom = new Random(seed);
|
Random treeRandom = new Random(seed);
|
||||||
|
|
||||||
//call recursive branching routine to generate branches from trunk + leaf blobs
|
//call recursive branching routine to generate branches from trunk + leaf blobs
|
||||||
FoliageType foliageType = Globals.gameConfigCurrent.getFoliageMap().getFoliage(type);
|
FoliageType foliageType = Globals.gameConfigCurrent.getFoliageMap().getType(type);
|
||||||
TreeModel treeModel = foliageType.getGraphicsTemplate().getProceduralModel().getTreeModel();
|
TreeModel treeModel = foliageType.getGraphicsTemplate().getProceduralModel().getTreeModel();
|
||||||
|
|
||||||
//generate trunk
|
//generate trunk
|
||||||
|
|||||||
@ -14,6 +14,8 @@ import electrosphere.game.data.creature.type.CreatureData;
|
|||||||
import electrosphere.game.data.creature.type.CreatureTypeLoader;
|
import electrosphere.game.data.creature.type.CreatureTypeLoader;
|
||||||
import electrosphere.game.data.creature.type.attack.AttackMoveResolver;
|
import electrosphere.game.data.creature.type.attack.AttackMoveResolver;
|
||||||
import electrosphere.game.data.creature.type.model.CreatureTypeMap;
|
import electrosphere.game.data.creature.type.model.CreatureTypeMap;
|
||||||
|
import electrosphere.game.data.foliage.type.FoliageType;
|
||||||
|
import electrosphere.game.data.foliage.type.FoliageTypeLoader;
|
||||||
import electrosphere.game.data.foliage.type.model.FoliageTypeMap;
|
import electrosphere.game.data.foliage.type.model.FoliageTypeMap;
|
||||||
import electrosphere.game.data.item.ItemDataMap;
|
import electrosphere.game.data.item.ItemDataMap;
|
||||||
import electrosphere.game.data.projectile.ProjectileTypeHolder;
|
import electrosphere.game.data.projectile.ProjectileTypeHolder;
|
||||||
@ -31,13 +33,22 @@ import electrosphere.util.FileUtils;
|
|||||||
*/
|
*/
|
||||||
public class Config {
|
public class Config {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The container for all creature definitions
|
||||||
|
*/
|
||||||
CreatureTypeLoader creatureTypeLoader;
|
CreatureTypeLoader creatureTypeLoader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The container for all item definitions
|
* The container for all item definitions
|
||||||
*/
|
*/
|
||||||
ItemDataMap itemMap;
|
ItemDataMap itemMap;
|
||||||
FoliageTypeMap foliageMap;
|
|
||||||
|
/**
|
||||||
|
* The container for all foliage definitions
|
||||||
|
*/
|
||||||
|
FoliageTypeLoader foliageMap;
|
||||||
|
|
||||||
|
|
||||||
CommonEntityMap objectTypeLoader;
|
CommonEntityMap objectTypeLoader;
|
||||||
SymbolMap symbolMap;
|
SymbolMap symbolMap;
|
||||||
RaceMap raceMap;
|
RaceMap raceMap;
|
||||||
@ -85,10 +96,10 @@ public class Config {
|
|||||||
*/
|
*/
|
||||||
public static Config loadDefaultConfig(){
|
public static Config loadDefaultConfig(){
|
||||||
Config config = new Config();
|
Config config = new Config();
|
||||||
config.creatureTypeLoader = loadCreatureTypes("Data/entity/creatures.json");
|
config.creatureTypeLoader = Config.loadCreatureTypes("Data/entity/creatures.json");
|
||||||
config.itemMap = ItemDataMap.loadItemFiles("Data/entity/items.json");
|
config.itemMap = ItemDataMap.loadItemFiles("Data/entity/items.json");
|
||||||
config.foliageMap = FileUtils.loadObjectFromAssetPath("Data/entity/foliage.json", FoliageTypeMap.class);
|
config.foliageMap = Config.loadFoliageTypes("Data/entity/foliage.json");
|
||||||
config.objectTypeLoader = loadCommonEntityTypes("Data/entity/objects.json");
|
config.objectTypeLoader = Config.loadCommonEntityTypes("Data/entity/objects.json");
|
||||||
config.symbolMap = FileUtils.loadObjectFromAssetPath("Data/game/symbolism.json", SymbolMap.class);
|
config.symbolMap = FileUtils.loadObjectFromAssetPath("Data/game/symbolism.json", SymbolMap.class);
|
||||||
config.raceMap = FileUtils.loadObjectFromAssetPath("Data/game/races.json", RaceMap.class);
|
config.raceMap = FileUtils.loadObjectFromAssetPath("Data/game/races.json", RaceMap.class);
|
||||||
config.voxelData = FileUtils.loadObjectFromAssetPath("Data/game/voxelTypes.json", VoxelData.class);
|
config.voxelData = FileUtils.loadObjectFromAssetPath("Data/game/voxelTypes.json", VoxelData.class);
|
||||||
@ -163,7 +174,7 @@ public class Config {
|
|||||||
}
|
}
|
||||||
//push types from any other files
|
//push types from any other files
|
||||||
for(String filepath : typeMap.getFiles()){
|
for(String filepath : typeMap.getFiles()){
|
||||||
List<CreatureData> parsedTypeList = readCreatureTypeFile(filepath);
|
List<CreatureData> parsedTypeList = Config.readCreatureTypeFile(filepath);
|
||||||
for(CreatureData type : parsedTypeList){
|
for(CreatureData type : parsedTypeList){
|
||||||
typeList.add(type);
|
typeList.add(type);
|
||||||
}
|
}
|
||||||
@ -178,7 +189,7 @@ public class Config {
|
|||||||
*/
|
*/
|
||||||
static CreatureTypeLoader loadCreatureTypes(String initialPath) {
|
static CreatureTypeLoader loadCreatureTypes(String initialPath) {
|
||||||
CreatureTypeLoader loader = new CreatureTypeLoader();
|
CreatureTypeLoader loader = new CreatureTypeLoader();
|
||||||
List<CreatureData> typeList = readCreatureTypeFile(initialPath);
|
List<CreatureData> typeList = Config.readCreatureTypeFile(initialPath);
|
||||||
for(CreatureData type : typeList){
|
for(CreatureData type : typeList){
|
||||||
if(type.getAttackMoves() != null){
|
if(type.getAttackMoves() != null){
|
||||||
type.setAttackMoveResolver(new AttackMoveResolver(type.getAttackMoves()));
|
type.setAttackMoveResolver(new AttackMoveResolver(type.getAttackMoves()));
|
||||||
@ -194,6 +205,42 @@ public class Config {
|
|||||||
return loader;
|
return loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads a child foliage defintion file
|
||||||
|
* @param filename The filename
|
||||||
|
* @return The list of foliage in the file
|
||||||
|
*/
|
||||||
|
static List<FoliageType> readFoliageTypeFile(String filename){
|
||||||
|
List<FoliageType> typeList = new LinkedList<FoliageType>();
|
||||||
|
FoliageTypeMap typeMap = FileUtils.loadObjectFromAssetPath(filename, FoliageTypeMap.class);
|
||||||
|
//push the types from this file
|
||||||
|
for(FoliageType foliage : typeMap.getFoliageList()){
|
||||||
|
typeList.add(foliage);
|
||||||
|
}
|
||||||
|
//push types from any other files
|
||||||
|
for(String filepath : typeMap.getFiles()){
|
||||||
|
List<FoliageType> parsedTypeList = Config.readFoliageTypeFile(filepath);
|
||||||
|
for(FoliageType type : parsedTypeList){
|
||||||
|
typeList.add(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return typeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads all creature definition files recursively
|
||||||
|
* @param initialPath The initial path to recurse from
|
||||||
|
* @return The creature defintion interface
|
||||||
|
*/
|
||||||
|
static FoliageTypeLoader loadFoliageTypes(String initialPath) {
|
||||||
|
FoliageTypeLoader loader = new FoliageTypeLoader();
|
||||||
|
List<FoliageType> typeList = Config.readFoliageTypeFile(initialPath);
|
||||||
|
for(FoliageType type : typeList){
|
||||||
|
loader.putType(type.getId(), type);
|
||||||
|
}
|
||||||
|
return loader;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the interface for creature definitions loaded into memory
|
* Gets the interface for creature definitions loaded into memory
|
||||||
* @return The interface
|
* @return The interface
|
||||||
@ -214,7 +261,7 @@ public class Config {
|
|||||||
* Gets the data on all foliage types in memory
|
* Gets the data on all foliage types in memory
|
||||||
* @return The foliage data
|
* @return The foliage data
|
||||||
*/
|
*/
|
||||||
public FoliageTypeMap getFoliageMap() {
|
public FoliageTypeLoader getFoliageMap() {
|
||||||
return foliageMap;
|
return foliageMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,49 @@
|
|||||||
|
package electrosphere.game.data.foliage.type;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class FoliageTypeLoader {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The map of entity id -> entity data
|
||||||
|
*/
|
||||||
|
Map<String,FoliageType> idTypeMap = new HashMap<String,FoliageType>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds entity data to the loader
|
||||||
|
* @param name The id of the entity
|
||||||
|
* @param type The entity data
|
||||||
|
*/
|
||||||
|
public void putType(String name, FoliageType type){
|
||||||
|
idTypeMap.put(name,type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets entity data from the id of the type
|
||||||
|
* @param id The id of the type
|
||||||
|
* @return The entity data if it exists, null otherwise
|
||||||
|
*/
|
||||||
|
public FoliageType getType(String id){
|
||||||
|
return idTypeMap.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the collection of all entity data
|
||||||
|
* @return the collection of all entity data
|
||||||
|
*/
|
||||||
|
public Collection<FoliageType> getTypes(){
|
||||||
|
return idTypeMap.values();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the set of all entity data id's stored in the loader
|
||||||
|
* @return the set of all entity data ids
|
||||||
|
*/
|
||||||
|
public Set<String> getTypeIds(){
|
||||||
|
return idTypeMap.keySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -8,9 +8,17 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class FoliageTypeMap {
|
public class FoliageTypeMap {
|
||||||
|
|
||||||
//The list of all foliage types
|
/**
|
||||||
|
* List of all the foliage types in this file
|
||||||
|
*/
|
||||||
List<FoliageType> foliageList;
|
List<FoliageType> foliageList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The list of sub-files under this file
|
||||||
|
*/
|
||||||
|
List<String> files;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the list of all foliage types
|
* Gets the list of all foliage types
|
||||||
* @return The list of all foliage types
|
* @return The list of all foliage types
|
||||||
@ -33,4 +41,12 @@ public class FoliageTypeMap {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the list of files under this file
|
||||||
|
* @return The list of files
|
||||||
|
*/
|
||||||
|
public List<String> getFiles(){
|
||||||
|
return files;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import electrosphere.game.data.common.CommonEntityType;
|
|||||||
import electrosphere.game.data.creature.type.CreatureData;
|
import electrosphere.game.data.creature.type.CreatureData;
|
||||||
import electrosphere.game.data.creature.type.CreatureTypeLoader;
|
import electrosphere.game.data.creature.type.CreatureTypeLoader;
|
||||||
import electrosphere.game.data.foliage.type.FoliageType;
|
import electrosphere.game.data.foliage.type.FoliageType;
|
||||||
import electrosphere.game.data.foliage.type.model.FoliageTypeMap;
|
import electrosphere.game.data.foliage.type.FoliageTypeLoader;
|
||||||
import electrosphere.game.data.item.Item;
|
import electrosphere.game.data.item.Item;
|
||||||
import electrosphere.game.data.item.ItemDataMap;
|
import electrosphere.game.data.item.ItemDataMap;
|
||||||
import electrosphere.test.annotations.IntegrationTest;
|
import electrosphere.test.annotations.IntegrationTest;
|
||||||
@ -44,8 +44,8 @@ public class SpawnAllEntitiesTests extends EntityTestTemplate {
|
|||||||
ItemUtils.serverSpawnBasicItem(Globals.realmManager.first(), new Vector3d(0.1,0.1,0.1), item.getId());
|
ItemUtils.serverSpawnBasicItem(Globals.realmManager.first(), new Vector3d(0.1,0.1,0.1), item.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
FoliageTypeMap foliageTypeMap = Globals.gameConfigCurrent.getFoliageMap();
|
FoliageTypeLoader foliageTypeMap = Globals.gameConfigCurrent.getFoliageMap();
|
||||||
for(FoliageType foliage : foliageTypeMap.getFoliageList()){
|
for(FoliageType foliage : foliageTypeMap.getTypes()){
|
||||||
FoliageUtils.serverSpawnTreeFoliage(Globals.realmManager.first(), new Vector3d(0.1,0.1,0.1), foliage.getId(), 0);
|
FoliageUtils.serverSpawnTreeFoliage(Globals.realmManager.first(), new Vector3d(0.1,0.1,0.1), foliage.getId(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user