fixes, docs, skeleton creature
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2024-09-14 21:45:51 -04:00
parent 4eb4fba8a0
commit efd2ff1bb7
31 changed files with 1513 additions and 431 deletions

View File

@ -2,48 +2,10 @@
"creatures" : [
{
"id" : "CUBE_MAN",
"hitboxes" : [],
"tokens" : [
"SENTIENT",
"GRAVITY"
],
"movementSystems" : [
{
"type" : "GROUND",
"acceleration" : 0.15,
"maxVelocity" : 1
}
],
"collidable" : {
"type" : "CYLINDER",
"dimension1" : 0.1,
"dimension2" : 0.45,
"dimension3" : 0.1,
"rotX": 0,
"rotY": 0,
"rotZ": 0,
"rotW": 1,
"offsetX" : 0,
"offsetY" : 0.45,
"offsetZ" : 0
},
"healthSystem" : {
"maxHealth" : 100,
"onDamageIFrames" : 30
},
"modelPath" : "Models/unitcube.fbx"
}
],
"files" : [
"Data/entity/creatures/human.json",
"Data/entity/creatures/animals.json",
"Data/entity/creatures/test.json"
"Data/entity/creatures/skeleton.json"
]
}

View File

@ -1,340 +0,0 @@
{
"creatures" : [
{
"id" : "elf",
"hitboxes" : [
{
"type": "hurt",
"bone": "Bone.031",
"radius": 0.04
},
{
"type": "hurt",
"bone": "Bone.012",
"radius": 0.04
},
{
"type": "hurt",
"bone": "Bone.003",
"radius": 0.04
},
{
"type": "hurt",
"bone": "Bone.010",
"radius": 0.06
},
{
"type": "hurt",
"bone": "Bone.001",
"radius": 0.06
},
{
"type": "hurt",
"bone": "Bone.014",
"radius": 0.06
},
{
"type": "hurt",
"bone": "Bone",
"radius": 0.08
},
{
"type": "hurt",
"bone": "Bone.014",
"radius": 0.06
},
{
"type": "hurt",
"bone": "Bone.019",
"radius": 0.04
}
],
"tokens" : [
"SENTIENT",
"ATTACKER",
"GRAVITY",
"TARGETABLE",
"CAN_EQUIP",
"INVENTORY",
"OUTLINE",
"PLAYABLE"
],
"visualAttributes" : [
{
"attributeId" : "TorsoHeight",
"type" : "bone",
"subtype" : "offy",
"primaryBone" : "UpperTorso",
"minValue" : -0.2,
"maxValue" : 0.2
},
{
"attributeId" : "TorsoWidth",
"type" : "bone",
"subtype" : "scalex",
"primaryBone" : "UpperTorso",
"minValue" : 0.8,
"maxValue" : 1.2
},
{
"attributeId" : "ShoulderSize",
"type" : "bone",
"subtype" : "scale",
"primaryBone" : "Shoulder.R",
"mirrorBone" : "Shoulder.L",
"minValue" : 0.8,
"maxValue" : 1.2
},
{
"attributeId" : "JawWidth",
"type" : "bone",
"subtype" : "scalex",
"primaryBone" : "Jaw",
"minValue" : 0.8,
"maxValue" : 1.2
},
{
"attributeId" : "JawExtrude",
"type" : "bone",
"subtype" : "posz",
"primaryBone" : "Jaw",
"minValue" : -0.1,
"maxValue" : 0.1
},
{
"attributeId" : "HeadWidth",
"type" : "bone",
"subtype" : "scalex",
"primaryBone" : "Head",
"minValue" : 0.8,
"maxValue" : 1.2
},
{
"attributeId" : "hair",
"type" : "remesh",
"variants" : [
{
"id" : "hairshort1",
"model" : "Models/creatures/person2/hair/hairshort1meshed.fbx",
"meshes" : [
"Hair"
]
}
]
}
],
"movementSystems" : [
{
"type" : "GROUND",
"acceleration" : 10.0,
"maxVelocity" : 0.025,
"animationStartup" : {
"name" : "Jog",
"length" : 1,
"loops" : false
},
"animationLoop" : {
"name" : "Jog",
"length" : 1,
"loops" : false
},
"animationWindDown" : {
"name" : "Jog",
"length" : 1,
"loops" : false
},
"sprintSystem" : {
"maxVelocity" : 5.8,
"staminaMax" : 500,
"animationStartUp" : {
"name" : "Sprint",
"length" : 1,
"loops" : false
},
"animationMain" : {
"name" : "Sprint",
"length" : 1,
"loops" : false
}
}
},
{
"type" : "JUMP",
"jumpFrames" : 30,
"jumpForce" : 0.05,
"animationJump" : {
"name" : "Jump",
"length" : 1,
"loops" : false
}
},
{
"type" : "FALL",
"animationFall" : {
"name" : "Fall",
"length" : 1,
"loops" : true
},
"animationLand" : {
"name" : "Land",
"length" : 1,
"loops" : true
}
}
],
"rotatorSystem" : {
"rotatorItems" : [
{
"boneName" : "Bone",
"constraints" : [
{
"followsView" : true,
"followsBone" : false,
"parentBone" : "",
"allowedMarginPitch" : 0.2
}
]
},
{
"boneName" : "Leg.L",
"constraints" : [
{
"followsView" : false,
"followsBone" : true,
"parentBone" : "Bone",
"allowedMarginYaw" : 0.2
}
]
},
{
"boneName" : "Leg.R",
"constraints" : [
{
"followsView" : false,
"followsBone" : true,
"parentBone" : "Bone",
"allowedMarginYaw" : 0.2
}
]
}
]
},
"equipPoints" : [
{
"equipPointId" : "handLeft",
"bone" : "MiddleLower.L",
"offsetVector" : [],
"offsetRotation" : [],
"equipClassWhitelist" : [
"tool",
"shield",
"item"
]
},
{
"equipPointId" : "handRight",
"bone" : "MiddleLower.R",
"offsetVector" : [],
"offsetRotation" : [0.3057,0.2926,0.09933,0.9006],
"equipClassWhitelist" : [
"tool",
"weapon",
"item"
]
},
{
"equipPointId" : "Torso",
"bone" : "Bone",
"offsetVector" : [],
"offsetRotation" : [],
"equipClassWhitelist" : [
"armor",
"clothing"
]
},
{
"equipPointId" : "Legs",
"bone" : "Bone",
"offsetVector" : [],
"offsetRotation" : [],
"equipClassWhitelist" : [
"armor",
"clothing"
]
}
],
"collidable" : {
"type" : "CYLINDER",
"dimension1" : 0.1,
"dimension2" : 0.45,
"dimension3" : 0.1,
"rotX": 0,
"rotY": 0,
"rotZ": 0,
"rotW": 1,
"offsetX" : 0,
"offsetY" : 0.45,
"offsetZ" : 0
},
"attackMoves" : [
{
"attackMoveId" : "Sword1HSlash1",
"type" : "MELEE_WEAPON_SWING_ONE_HAND",
"attackAnimationName" : "Sword1HSlash1",
"windupFrames" : 5,
"attackFrames" : 5,
"cooldownFrames" : 25,
"firesProjectile" : false,
"nextMoveId" : "Sword1HSlash2",
"nextAttackMoveWindowStart" : 0,
"nextAttackMoveWindowEnd" : 1,
"moveChainWindowStart" : 12,
"moveChainWindowEnd" : 18,
"driftGoal" : 0.02,
"driftFrameStart" : 7,
"driftFrameEnd" : 15,
"initialMove" : true
},
{
"attackMoveId" : "Sword1HSlash2",
"type" : "MELEE_WEAPON_SWING_ONE_HAND",
"attackAnimationName" : "Sword1HSlash2",
"windupFrames" : 2,
"attackFrames" : 5,
"cooldownFrames" : 28,
"firesProjectile" : false,
"nextMoveId" : "Sword1HSlash1",
"nextAttackMoveWindowStart" : 10,
"nextAttackMoveWindowEnd" : 18,
"driftGoal" : 0.03,
"driftFrameStart" : 1,
"driftFrameEnd" : 10,
"initialMove" : false
},
{
"attackMoveId" : "Bow2HFire",
"type" : "RANGED_WEAPON_BOW_TWO_HAND",
"windupAnimationName" : "HoldBowString",
"holdAnimationName" : "HoldBow",
"attackAnimationName" : "HoldBowString",
"damageStartFrame" : 30,
"damageEndFrame" : 60,
"firesProjectile" : true,
"nextMoveId" : "",
"nextAttackMoveWindowStart" : 0,
"nextAttackMoveWindowEnd" : 1,
"movementStart" : 0,
"movementEnd" : 0,
"movementGoal" : 0,
"initialMove" : true
}
],
"healthSystem" : {
"maxHealth" : 100,
"onDamageIFrames" : 30
},
"modelPath" : "Models/elf1.fbx"
}
],
"files" : []
}

View File

@ -457,7 +457,7 @@
}
},
{
"attackMoveId" : "Sword2HSlash1",
"attackMoveId" : "SwordR2HSlash1",
"type" : "MELEE_WEAPON_SWING_TWO_HAND",
"windupFrames" : 2,
"attackFrames" : 5,

View File

@ -0,0 +1,518 @@
{
"creatures" : [
{
"id" : "skeleton",
"hitboxes" : [
{
"type": "hurt",
"bone": "Bicep.L",
"radius": 0.04
},
{
"type": "hurt",
"bone": "Bicep.R",
"radius": 0.04
},
{
"type": "hurt",
"bone": "Forearm.L",
"radius": 0.06
},
{
"type": "hurt",
"bone": "Forearm.R",
"radius": 0.06
},
{
"type": "hurt",
"bone": "Leg.L",
"radius": 0.06
},
{
"type": "hurt",
"bone": "Leg.R",
"radius": 0.06
},
{
"type": "hurt",
"bone": "LowerLeg.L",
"radius": 0.06
},
{
"type": "hurt",
"bone": "LowerLeg.R",
"radius": 0.06
},
{
"type": "hurt",
"bone": "Neck",
"radius": 0.06
},
{
"type": "hurt",
"bone": "Head",
"radius": 0.07,
"offset": [0.0,0.13,0.0]
}
],
"tokens" : [
"ATTACKER",
"GRAVITY",
"TARGETABLE",
"CAN_EQUIP",
"INVENTORY",
"OUTLINE",
"PLAYABLE",
"UNIT_CONTROLS"
],
"visualAttributes" : [
],
"movementSystems" : [
{
"type" : "GROUND",
"acceleration" : 4000.0,
"maxVelocity" : 20.5,
"strafeMultiplier" : 1.0,
"backpedalMultiplier" : 0.5,
"footstepFirstAudioOffset" : 0.2,
"footstepSecondAudioOffset" : 0.6,
"animationStartup" : {
"nameThirdPerson" : "Jog",
"priorityCategory" : "CORE_MOVEMENT"
},
"animationLoop" : {
"nameThirdPerson" : "Jog",
"priorityCategory" : "CORE_MOVEMENT"
},
"animationWindDown" : {
"nameThirdPerson" : "Jog",
"priorityCategory" : "CORE_MOVEMENT"
},
"sprintSystem" : {
"modifier" : 1.4,
"staminaMax" : 500,
"animationStartUp" : {
"nameThirdPerson" : "Sprint",
"priorityCategory" : "MOVEMENT_MODIFIER"
},
"animationMain" : {
"nameThirdPerson" : "Sprint",
"priorityCategory" : "MOVEMENT_MODIFIER"
}
}
},
{
"type" : "JUMP",
"jumpFrames" : 3,
"jumpForce" : 1.3,
"animationJump" : {
"nameThirdPerson" : "Jump",
"nameFirstPerson" : "Jump",
"priorityCategory" : "MOVEMENT_MODIFIER"
}
},
{
"type" : "FALL",
"fallState" : {
"animation" : {
"nameThirdPerson" : "Fall",
"nameFirstPerson" : "Fall",
"priorityCategory" : "MOVEMENT_MODIFIER"
}
},
"landState" : {
"animation" : {
"nameThirdPerson" : "Land",
"nameFirstPerson" : "Land",
"priorityCategory" : "MOVEMENT_MODIFIER"
}
}
},
{
"type" : "WALK",
"modifier": 0.3
}
],
"rotatorSystem" : {
},
"equipPoints" : [
{
"equipPointId" : "handLeft",
"bone" : "Hand.L",
"firstPersonBone" : "hand.L",
"offsetVectorFirstPerson" : [0,0,0],
"offsetVectorThirdPerson" : [0,0,0],
"offsetRotationFirstPerson" : [0,0,0,1],
"offsetRotationThirdPerson" : [0,0,0,1],
"equipClassWhitelist" : [
"tool",
"shield",
"item"
]
},
{
"equipPointId" : "handRight",
"bone" : "Hand.R",
"firstPersonBone" : "hand.R",
"offsetVectorFirstPerson" : [-0.01,-0.05,-0.10],
"offsetVectorThirdPerson" : [0.02,-0.06,0],
"offsetRotationThirdPerson" : [-0.334,0.145,-0.28,0.89],
"offsetRotationFirstPerson" : [0.02,-0.977,-0.211,-0.005],
"canBlock" : true,
"equipClassWhitelist" : [
"tool",
"weapon",
"item"
],
"equippedAnimation" : {
"nameThirdPerson" : "Idle1",
"nameFirstPerson" : "Idle",
"priorityCategory" : "MODIFIER_HIGH",
"boneGroups" : ["handRight"]
}
},
{
"equipPointId" : "handsCombined",
"bone" : "Hand.R",
"firstPersonBone" : "hand.R",
"offsetVectorThirdPerson" : [0.02,-0.06,0],
"offsetVectorFirstPerson" : [0.04,-0.08,0.016],
"offsetRotationThirdPerson" : [0.665,-0.462,0.176,-0.56],
"offsetRotationFirstPerson" : [0.35,-0.775,-0.012,-0.53],
"canBlock" : true,
"equipClassWhitelist" : [
"tool",
"weapon2H",
"item"
],
"equippedAnimation" : {
"nameThirdPerson" : "HoldItemR2H",
"nameFirstPerson" : "HoldItemR2H",
"priorityCategory" : "MODIFIER_HIGH",
"boneGroups" : ["armLeft", "armRight", "handLeft", "handRight"]
},
"isCombinedPoint": true,
"subPoints" : ["handLeft","handRight"]
},
{
"equipPointId" : "Torso",
"bone" : "Bone",
"offsetVectorFirstPerson" : [0,0,0],
"offsetVectorThirdPerson" : [0,0,0],
"offsetRotationFirstPerson" : [0,0,0,1],
"offsetRotationThirdPerson" : [0,0,0,1],
"equipClassWhitelist" : [
"armor",
"clothing"
]
},
{
"equipPointId" : "Legs",
"bone" : "Bone",
"offsetVectorFirstPerson" : [0,0,0],
"offsetVectorThirdPerson" : [0,0,0],
"offsetRotationFirstPerson" : [0,0,0,1],
"offsetRotationThirdPerson" : [0,0,0,1],
"equipClassWhitelist" : [
"armor",
"clothing"
]
}
],
"blockSystem" : {
"variants": [
{
"variantId": "block2H",
"windUpAnimation" : {
"nameThirdPerson": "HoldItemR2HBlockStart",
"nameFirstPerson": "HoldItemR2HBlockWindUp",
"priorityCategory": "MOVEMENT_MODIFIER",
"boneGroups" : ["armLeft", "armRight", "handLeft", "handRight"]
},
"mainAnimation" : {
"nameThirdPerson": "HoldItemR2HBlock",
"nameFirstPerson": "HoldItemR2HBlock",
"priorityCategory": "MOVEMENT_MODIFIER",
"boneGroups" : ["armLeft", "armRight", "handLeft", "handRight"]
},
"cooldownAnimation" : {
"nameThirdPerson": "HoldItemR2HBlockCooldown",
"nameFirstPerson": "HoldItemR2HBlockCooldown",
"priorityCategory": "MOVEMENT_MODIFIER",
"boneGroups" : ["armLeft", "armRight", "handLeft", "handRight"]
},
"defaults" : [
{
"equipPoint" : "handsCombined",
"itemClassEquipped" : "weapon2H"
}
]
}
]
},
"collidable" : {
"type" : "CYLINDER",
"dimension1" : 0.2,
"dimension2" : 1.6,
"dimension3" : 0.2,
"mass": 0.3,
"rotX": 0,
"rotY": 0,
"rotZ": 0,
"rotW": 1,
"offsetX" : 0,
"offsetY" : 0.8,
"offsetZ" : 0,
"angularlyStatic" : true
},
"attackMoves" : [
{
"attackMoveId" : "Sword1HSlash1",
"type" : "MELEE_WEAPON_SWING_ONE_HAND",
"windupFrames" : 5,
"attackFrames" : 5,
"cooldownFrames" : 25,
"firesProjectile" : false,
"nextMoveId" : "Sword1HSlash2",
"nextAttackMoveWindowStart" : 0,
"nextAttackMoveWindowEnd" : 1,
"moveChainWindowStart" : 12,
"moveChainWindowEnd" : 18,
"driftGoal" : 0.02,
"driftFrameStart" : 7,
"driftFrameEnd" : 15,
"initialMove" : true,
"windupState" : {
"animation" : {
"nameFirstPerson" : "Sword1HSlash1",
"nameThirdPerson" : "Sword1HSlash1",
"priorityCategory" : "MOVEMENT_MODIFIER"
}
},
"holdState" : {
"animation" : {
"nameFirstPerson" : "Sword1HSlash1",
"nameThirdPerson" : "Sword1HSlash1",
"priorityCategory" : "MOVEMENT_MODIFIER"
}
},
"attackState" : {
"animation" : {
"nameFirstPerson" : "Sword1HSlash1",
"nameThirdPerson" : "Sword1HSlash1",
"priorityCategory" : "MOVEMENT_MODIFIER"
}
}
},
{
"attackMoveId" : "Sword1HSlash2",
"type" : "MELEE_WEAPON_SWING_ONE_HAND",
"windupFrames" : 2,
"attackFrames" : 5,
"cooldownFrames" : 28,
"firesProjectile" : false,
"nextMoveId" : "Sword1HSlash1",
"nextAttackMoveWindowStart" : 10,
"nextAttackMoveWindowEnd" : 18,
"driftGoal" : 0.03,
"driftFrameStart" : 1,
"driftFrameEnd" : 10,
"initialMove" : false,
"windupState" : {
"animation" : {
"nameFirstPerson" : "Jump",
"nameThirdPerson" : "Jump",
"priorityCategory" : "MOVEMENT_MODIFIER"
}
},
"holdState" : {
"animation" : {
"nameFirstPerson" : "Jump",
"nameThirdPerson" : "Jump",
"priorityCategory" : "MOVEMENT_MODIFIER"
}
},
"attackState" : {
"animation" : {
"nameFirstPerson" : "Sword1HSlash2",
"nameThirdPerson" : "Sword1HSlash2",
"priorityCategory" : "MOVEMENT_MODIFIER"
}
}
},
{
"attackMoveId" : "SwordR2HSlash1",
"type" : "MELEE_WEAPON_SWING_TWO_HAND",
"windupFrames" : 2,
"attackFrames" : 5,
"cooldownFrames" : 28,
"firesProjectile" : false,
"nextAttackMoveWindowStart" : 10,
"nextAttackMoveWindowEnd" : 18,
"driftGoal" : 0.03,
"driftFrameStart" : 1,
"driftFrameEnd" : 10,
"initialMove" : true,
"attackState" : {
"animation" : {
"nameFirstPerson" : "SwordR2HSlash1",
"nameThirdPerson" : "SwordR2HSlash1",
"priorityCategory" : "MOVEMENT_MODIFIER",
"boneGroups" : ["armLeft", "armRight", "handLeft", "handRight"]
},
"audioData" : {
"audioPath" : "Audio/weapons/swoosh-03.ogg"
}
},
"blockRecoilState" : {
"animation" : {
"nameFirstPerson" : "SwordR2HSlash1Recoil",
"nameThirdPerson" : "SwordR2HSlash1Recoil",
"priorityCategory" : "MOVEMENT_MODIFIER",
"boneGroups" : ["armLeft", "armRight", "handLeft", "handRight"]
}
}
},
{
"attackMoveId" : "Bow2HFire",
"type" : "RANGED_WEAPON_BOW_TWO_HAND",
"damageStartFrame" : 30,
"damageEndFrame" : 60,
"firesProjectile" : true,
"nextMoveId" : "",
"nextAttackMoveWindowStart" : 0,
"nextAttackMoveWindowEnd" : 1,
"movementStart" : 0,
"movementEnd" : 0,
"movementGoal" : 0,
"initialMove" : true,
"windupState" : {
"animation" : {
"nameFirstPerson" : "Jump",
"nameThirdPerson" : "HoldBowString",
"priorityCategory" : "MOVEMENT_MODIFIER"
}
},
"holdState" : {
"animation" : {
"nameFirstPerson" : "Jump",
"nameThirdPerson" : "HoldBow",
"priorityCategory" : "MOVEMENT_MODIFIER"
}
},
"attackState" : {
"animation" : {
"nameFirstPerson" : "Sword1HSlash2",
"nameThirdPerson" : "HoldBowString",
"priorityCategory" : "MOVEMENT_MODIFIER"
}
}
}
],
"healthSystem" : {
"maxHealth" : 60,
"onDamageIFrames" : 30
},
"idleData": {
"animation": {
"nameFirstPerson" : "Idle",
"nameThirdPerson" : "DefaultPose",
"priorityCategory" : "IDLE"
}
},
"modelPath" : "Models/creatures/skeleton/skeleton1.glb",
"viewModelData" : {
"heightFromOrigin" : 1.3,
"cameraViewDirOffsetY" : -0.3,
"cameraViewDirOffsetZ" : 0.0,
"firstPersonModelPath" : "Models/creatures/viewmodel.glb"
},
"aiTrees" : [
{
"name" : "Attacker",
"aggroRange" : 10,
"attackRange" : 0.8
}
],
"boneGroups" : [
{
"id" : "torso",
"boneNamesThirdPerson" : [
"Bone", "UpperTorso", "Shoulder.R", "Shoulder.L", "Breast.R", "Breast.L", "Butt.L", "Butt.R"
]
},
{
"id" : "head",
"boneNamesThirdPerson" : [
"Neck", "Head", "Ear.L", "Ear.R", "Eye.L", "Eye.R", "Jaw", "Nose", "MouthCorner.R", "MouthCorner.L", "JawTop", "Iris.L", "Iris.R"
]
},
{
"id" : "armRight",
"boneNamesThirdPerson" : [
"Bicep.R", "Forearm.R"
],
"boneNamesFirstPerson" : [
"clavicle.R", "deltoid.R", "upper_arm.R", "forearm.R"
]
},
{
"id" : "handRight",
"boneNamesThirdPerson" : [
"Hand.R", "MiddleUpper.R", "ThumbUpper.R"
],
"boneNamesFirstPerson" : [
"hand.R",
"palm_pinky.R",
"f_pinky.01.R",
"f_pinky.02.R",
"f_pinky.03.R",
"palm_middle.R",
"f_middle.01.R",
"f_middle.02.R",
"f_middle.03.R",
"palm_ring.R",
"f_ring.01.R",
"f_ring.02.R",
"f_ring.03.R",
"thumb.01.R",
"thumb.02.R",
"thumb.03.R",
"palm_index.R",
"f_index.01.R",
"f_index.02.R",
"f_index.03.R"
]
},
{
"id" : "armLeft",
"boneNamesThirdPerson" : [
"Bicep.L", "Forearm.L"
],
"boneNamesFirstPerson" : [
"clavicle.L", "deltoid.L", "upper_arm.L", "forearm.L"
]
},
{
"id" : "handLeft",
"boneNamesThirdPerson" : [
"Hand.L", "MiddleUpper.L", "ThumbUpper.L"
]
},
{
"id" : "legLeft",
"boneNamesThirdPerson" : [
"Leg.L", "LowerLeg.L", "Foot.L"
]
},
{
"id" : "legRight",
"boneNamesThirdPerson" : [
"Leg.R", "LowerLeg.R", "Foot.R"
]
}
]
}
],
"files" : []
}

Binary file not shown.

View File

@ -0,0 +1,11 @@
{
"textureMap": {
"Models/creatures/skeleton/skeleton1.glb": [
{
"meshName" : "hands",
"diffuse" : "/Textures/w1.png",
"isDefault" : true
}
]
}
}

View File

@ -0,0 +1,43 @@
@page creatureanimations Creature Animations
A list of different sets of animations that creatures have. Also see
- Common
- Idle
- Walk
- Jog
- WalkStrafeLeft
- WalkStrafeRight
- Sprint
- Jump
- Fall
- Land
- Swim
- Interact
- InteractChannel
- Eat
- Humanoid
- Crouch
- Crouch walk
- Crouch jump
- Sit (Ground)
- Sit (Chair)
- HoldItemRH
- HoldItemR2H
- HoldItemLH
- HoldItemRHOpenPalm
- HoldItemLHOpenPalm
- Combat
- AttackUnarmedReady
- AttackUnarmed1
- AttackUnarmed1Recoil
- AttackUnarmed2
- AttackUnarmed2Recoil
- AttackUnarmed3
- AttackUnarmed3Recoil
- Weapons
- [See Weapon Types Page](@ref weapontypes)
- Vehicles
- Ride Horse
- Ride Wagon
- Ride Glider

View File

@ -1,5 +1,7 @@
@page creaturesindex Creatures
[TOC]
- @subpage creaturetodo
- @subpage creatureanimations
- @subpage creatureideas
- @subpage creaturemechanicsideas

View File

@ -0,0 +1,146 @@
@page creaturetodo Creature TODO
A list of all creatures that are targets for the game, and what their status of creation is.
## Human
- @subpage humanprogress
- [X] 3d Model
- [X] Viewmodel
- [X] Data
## Skeleton
- @subpage skeletonprogress
- [X] 3d Model
- [ ] Viewmodel
- [X] Data
## Rat Man
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Deer
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Bird
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Bat
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Wolf
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Goblin
- [X] 3d Model
- Meshed
- Textured
- [ ] Viewmodel
- [ ] Data
## Elf
- [X] Copy of Human
- [ ] Attributes 0/?
- [ ] Data
## Dwarf
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Frog Man
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Chicken
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Slime
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Rat
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Boar
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Spider
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Ghoul
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Lizard Man
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Bird Man
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Wolf Man
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Demon
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Troll
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data
## Raptor
- [ ] 3d Model
- [ ] Viewmodel
- [ ] Data

View File

@ -0,0 +1,192 @@
@page humanprogress Human
Progress on the human creature
## Third Person Model
- [X] Meshed
- [X] Textured
- [X] Rigged
- Animations
- Common
- [X] Idle
- [X] Walk
- [X] WalkStrafeLeft
- [X] WalkStrafeRight
- [X] Jog
- [X] Sprint
- [X] Jump
- [X] Fall
- [X] Land
- [ ] Swim
- [X] Interact
- [X] InteractChannel
- [ ] Eat
- Humanoid
- [X] CrouchIdle
- [ ] CrouchStart
- [ ] CrouchGetup
- [ ] CrouchWalk
- [ ] CrouchStrafeLeft
- [ ] CrouchStrafeRight
- [ ] CrouchJump
- [X] Sit (Ground)
- [ ] Sit (Chair)
- [X] HoldItemRH
- [X] HoldItemLH
- [X] HoldItemR2H
- [X] HoldItemRHOpenPalm
- [X] HoldItemLHOpenPalm
- Combat
- [X] AttackUnarmedReady
- [X] AttackUnarmed1
- [X] AttackUnarmed1Recoil
- [X] AttackUnarmed2
- [X] AttackUnarmed2Recoil
- Weapons
- SwordStraight
- [X] SwordRHSlash1
- [X] SwordRHSlash1Recoil
- [X] SwordRHSlash2
- [X] SwordRHSlash2Recoil
- [X] SwordRHSprintAttack
- [X] SwordRHSprintAttackRecoil
- SwordStab
- [X] StabSwordRHSlash1
- [X] StabSwordRHSlash1Recoil
- [X] StabSwordRHSlash2
- [X] StabSwordRHSlash2Recoil
- [X] StabSwordRHSprintAttack
- [X] StabSwordRHSprintAttackRecoil
- Sword2H
- [X] SwordR2HSlash1
- [X] SwordR2HSlash1Recoil
- [X] SwordR2HSlash2
- [X] SwordR2HSlash2Recoil
- [X] SwordR2HSprintAttack
- [X] SwordR2HSprintAttackRecoil
- [X] HoldItemR2HBlock
- Dagger
- [X] DaggerStab1
- [X] DaggerStab1Recoil
- [X] DaggerStab2
- [X] DaggerStab2Recoil
- [X] DaggerStab3
- [X] DaggerStab3Recoil
- [X] DaggerSprintAttack
- [X] DaggerSprintAttackRecoil
- Bow
- [X] BowDraw
- [X] HoldBowDraw
- [X] BowRelease
- Shield
- [X] HoldItemLH
- [X] ShieldLHRaise
- [X] ShieldLHBlock
- [X] ShieldLHLower
- Vehicles
- [ ] Ride Horse
- [ ] Ride Wagon
- [ ] Ride Glider
- Attributes 0/?
## First Person Model
- [X] Meshed
- [X] Textured
- [X] Rigged
- Animations
- Common
- [X] Idle
- [ ] Walk
- [ ] WalkStrafeLeft
- [ ] WalkStrafeRight
- [ ] Jog
- [X] Sprint
- [X] Jump
- [X] Fall
- [X] Land
- [ ] Swim
- [ ] Interact
- [ ] InteractChannel
- [ ] Eat
- Humanoid
- [ ] Crouch
- [ ] Crouch walk
- [ ] Crouch jump
- [ ] Sit (Ground)
- [ ] Sit (Chair)
- [X] HoldItemRH
- [ ] HoldItemLH
- [X] HoldItemR2H
- [ ] HoldItemRHOpenPalm
- [ ] HoldItemLHOpenPalm
- Combat
- [ ] AttackUnarmedReady
- [ ] AttackUnarmed1
- [ ] AttackUnarmed1Recoil
- [ ] AttackUnarmed2
- [ ] AttackUnarmed2Recoil
- Weapons
- SwordStraight
- [ ] SwordRHSlash1
- [ ] SwordRHSlash1Recoil
- [ ] SwordRHSlash2
- [ ] SwordRHSlash2Recoil
- [ ] SwordRHSprintAttack
- [ ] SwordRHSprintAttackRecoil
- SwordStab
- [ ] StabSwordRHSlash1
- [ ] StabSwordRHSlash1Recoil
- [ ] StabSwordRHSlash2
- [ ] StabSwordRHSlash2Recoil
- [ ] StabSwordRHSprintAttack
- [ ] StabSwordRHSprintAttackRecoil
- Sword2H
- [X] SwordR2HSlash1
- [X] SwordR2HSlash1Recoil
- [ ] SwordR2HSlash2
- [ ] SwordR2HSlash2Recoil
- [ ] SwordR2HSprintAttack
- [ ] SwordR2HSprintAttackRecoil
- [X] HoldItemR2HBlock
- Dagger
- [ ] DaggerStab1
- [ ] DaggerStab1Recoil
- [ ] DaggerStab2
- [ ] DaggerStab2Recoil
- [ ] DaggerStab3
- [ ] DaggerStab3Recoil
- [ ] DaggerSprintAttack
- [ ] DaggerSprintAttackRecoil
- Bow
- [ ] HoldBow
- [ ] BowDraw
- [ ] BowHold
- [ ] BowRelease
- [ ] Bow Reload
- Shield
- [ ] HoldItemLH
- [ ] ShieldLHRaise
- [ ] ShieldLHBlock
- [ ] ShieldLHLower
- Vehicles
- [ ] Ride Horse
- [ ] Ride Wagon
- [ ] Ride Glider
- Attributes 0/0
## Data
- [X] Bone Groups
- [X] Physics
- [ ] Visual Attributes
- Movement
- [X] Ground Movement
- [X] Sprinting
- [X] Jumping
- [X] Falling
- [X] Walking
- [ ] Swimming
- [X] Equip Data
- [X] Hitboxes
- Combat
- [X] Health
- [X] Block System
- [X] Attack Moves
- [X] AI

View File

@ -0,0 +1,192 @@
@page humanprogress Human
Progress on the human creature
## Third Person Model
- [X] Meshed
- [ ] Textured
- [X] Rigged
- Animations
- Common
- [X] Idle
- [X] Walk
- [X] WalkStrafeLeft
- [X] WalkStrafeRight
- [X] Jog
- [X] Sprint
- [X] Jump
- [X] Fall
- [X] Land
- [ ] Swim
- [X] Interact
- [X] InteractChannel
- [ ] Eat
- Humanoid
- [X] CrouchIdle
- [ ] CrouchStart
- [ ] CrouchGetup
- [ ] CrouchWalk
- [ ] CrouchStrafeLeft
- [ ] CrouchStrafeRight
- [ ] CrouchJump
- [X] Sit (Ground)
- [ ] Sit (Chair)
- [X] HoldItemRH
- [X] HoldItemLH
- [X] HoldItemR2H
- [X] HoldItemRHOpenPalm
- [X] HoldItemLHOpenPalm
- Combat
- [X] AttackUnarmedReady
- [X] AttackUnarmed1
- [X] AttackUnarmed1Recoil
- [X] AttackUnarmed2
- [X] AttackUnarmed2Recoil
- Weapons
- SwordStraight
- [X] SwordRHSlash1
- [X] SwordRHSlash1Recoil
- [X] SwordRHSlash2
- [X] SwordRHSlash2Recoil
- [X] SwordRHSprintAttack
- [X] SwordRHSprintAttackRecoil
- SwordStab
- [X] StabSwordRHSlash1
- [X] StabSwordRHSlash1Recoil
- [X] StabSwordRHSlash2
- [X] StabSwordRHSlash2Recoil
- [X] StabSwordRHSprintAttack
- [X] StabSwordRHSprintAttackRecoil
- Sword2H
- [X] SwordR2HSlash1
- [X] SwordR2HSlash1Recoil
- [X] SwordR2HSlash2
- [X] SwordR2HSlash2Recoil
- [X] SwordR2HSprintAttack
- [X] SwordR2HSprintAttackRecoil
- [X] HoldItemR2HBlock
- Dagger
- [X] DaggerStab1
- [X] DaggerStab1Recoil
- [X] DaggerStab2
- [X] DaggerStab2Recoil
- [X] DaggerStab3
- [X] DaggerStab3Recoil
- [X] DaggerSprintAttack
- [X] DaggerSprintAttackRecoil
- Bow
- [X] BowDraw
- [X] HoldBowDraw
- [X] BowRelease
- Shield
- [X] HoldItemLH
- [X] ShieldLHRaise
- [X] ShieldLHBlock
- [X] ShieldLHLower
- Vehicles
- [ ] Ride Horse
- [ ] Ride Wagon
- [ ] Ride Glider
- Attributes 0/?
## First Person Model
- [ ] Meshed
- [ ] Textured
- [ ] Rigged
- Animations
- Common
- [ ] Idle
- [ ] Walk
- [ ] WalkStrafeLeft
- [ ] WalkStrafeRight
- [ ] Jog
- [ ] Sprint
- [ ] Jump
- [ ] Fall
- [ ] Land
- [ ] Swim
- [ ] Interact
- [ ] InteractChannel
- [ ] Eat
- Humanoid
- [ ] Crouch
- [ ] Crouch walk
- [ ] Crouch jump
- [ ] Sit (Ground)
- [ ] Sit (Chair)
- [ ] HoldItemRH
- [ ] HoldItemLH
- [ ] HoldItemR2H
- [ ] HoldItemRHOpenPalm
- [ ] HoldItemLHOpenPalm
- Combat
- [ ] AttackUnarmedReady
- [ ] AttackUnarmed1
- [ ] AttackUnarmed1Recoil
- [ ] AttackUnarmed2
- [ ] AttackUnarmed2Recoil
- Weapons
- SwordStraight
- [ ] SwordRHSlash1
- [ ] SwordRHSlash1Recoil
- [ ] SwordRHSlash2
- [ ] SwordRHSlash2Recoil
- [ ] SwordRHSprintAttack
- [ ] SwordRHSprintAttackRecoil
- SwordStab
- [ ] StabSwordRHSlash1
- [ ] StabSwordRHSlash1Recoil
- [ ] StabSwordRHSlash2
- [ ] StabSwordRHSlash2Recoil
- [ ] StabSwordRHSprintAttack
- [ ] StabSwordRHSprintAttackRecoil
- Sword2H
- [ ] SwordR2HSlash1
- [ ] SwordR2HSlash1Recoil
- [ ] SwordR2HSlash2
- [ ] SwordR2HSlash2Recoil
- [ ] SwordR2HSprintAttack
- [ ] SwordR2HSprintAttackRecoil
- [ ] HoldItemR2HBlock
- Dagger
- [ ] DaggerStab1
- [ ] DaggerStab1Recoil
- [ ] DaggerStab2
- [ ] DaggerStab2Recoil
- [ ] DaggerStab3
- [ ] DaggerStab3Recoil
- [ ] DaggerSprintAttack
- [ ] DaggerSprintAttackRecoil
- Bow
- [ ] HoldBow
- [ ] BowDraw
- [ ] BowHold
- [ ] BowRelease
- [ ] Bow Reload
- Shield
- [ ] HoldItemLH
- [ ] ShieldLHRaise
- [ ] ShieldLHBlock
- [ ] ShieldLHLower
- Vehicles
- [ ] Ride Horse
- [ ] Ride Wagon
- [ ] Ride Glider
- Attributes 0/0
## Data
- [ ] Bone Groups
- [ ] Physics
- [ ] Visual Attributes
- Movement
- [ ] Ground Movement
- [ ] Sprinting
- [ ] Jumping
- [ ] Falling
- [ ] Walking
- [ ] Swimming
- [ ] Equip Data
- [ ] Hitboxes
- Combat
- [ ] Health
- [ ] Block System
- [ ] Attack Moves
- [ ] AI

View File

@ -3,4 +3,5 @@
Everything about items
[TOC]
- @subpage itemcategories
- @subpage itemcategories
- @subpage weapontypes

View File

@ -0,0 +1,214 @@
@page weapontypes Weapon Types
# Weapon Type Designs
## One hand straight sword
### Animations (3rd Person)
- [X] HoldItemR1H
- [X] SwordRHSlash1
- [X] SwordRHSlash1Recoil
- [X] SwordRHSlash2
- [X] SwordRHSlash2Recoil
- [X] SwordRHSprintAttack
- [X] SwordRHSprintAttackRecoil
### Animations (1st Person)
- [ ] HoldItemR1H
- [ ] StraightSwordR1HSlash1
- [ ] StraightSwordR1HSlash1Recoil
- [ ] StraightSwordR1HSlash2
- [ ] StraightSwordR1HSlash2Recoil
- [ ] StraightSwordR1HSprintAttack
- [ ] StraightSwordR1HSprintAttackRecoil
## One hand rapier
### Animations (3rd Person)
- [X] HoldItemRH
- [X] StabSwordRHSlash1
- [X] StabSwordRHSlash1Recoil
- [X] StabSwordRHSlash2
- [X] StabSwordRHSlash2Recoil
- [X] StabSwordRHSprintAttack
- [X] StabSwordRHSprintAttackRecoil
### Animations (1st Person)
- [ ] HoldItemRH
- [ ] StabSwordRHSlash1
- [ ] StabSwordRHSlash1Recoil
- [ ] StabSwordRHSlash2
- [ ] StabSwordRHSlash2Recoil
- [ ] StabSwordRHSprintAttack
- [ ] StabSwordRHSprintAttackRecoil
## Two hand sword/hammer
### Animations (3rd Person)
- [X] HoldItemR2H
- [X] SwordR2HSlash1
- [X] SwordR2HSlash1Recoil
- [X] SwordR2HSlash2
- [X] SwordR2HSlash2Recoil
- [ ] SwordR2HSprintAttack
- [ ] SwordR2HSprintAttackRecoil
### Animations (1st Person)
- [X] HoldItemR2H
- [X] SwordR2HSlash1
- [ ] SwordR2HSlash1Recoil
- [ ] SwordR2HSlash2
- [ ] SwordR2HSlash2Recoil
- [ ] SwordR2HSprintAttack
- [ ] SwordR2HSprintAttackRecoil
## Dagger (Stab)
### Animations (3rd Person)
- [X] HoldItemRH
- [X] DaggerStab1
- [X] DaggerStab1Recoil
- [X] DaggerStab2
- [X] DaggerStab2Recoil
- [ ] DaggerStab3
- [ ] DaggerStab3Recoil
- [X] DaggerSprintAttack
- [X] DaggerSprintAttackRecoil
### Animations (1st Person)
- [ ] HoldItemRH
- [ ] DaggerStab1
- [ ] DaggerStab1Recoil
- [ ] DaggerStab2
- [ ] DaggerStab2Recoil
- [ ] DaggerStab3
- [ ] DaggerStab3Recoil
- [ ] DaggerSprintAttack
- [ ] DaggerSprintAttackRecoil
## Bow
### Animations (3rd Person)
- [ ] HoldBow
- [ ] BowDraw
- [ ] BowHold
- [ ] BowRelease
- [ ] Bow Reload
### Animations (1st Person)
- [ ] HoldBow
- [ ] BowDraw
- [ ] BowHold
- [ ] BowRelease
- [ ] Bow Reload
## Shield
### Animations (3rd Person)
- [X] HoldItemLH
- [X] ShieldLHRaise
- [X] ShieldLHBlock
- [X] ShieldLHLower
### Animations (1st Person)
- [ ] HoldItemLH
- [ ] ShieldLHRaise
- [ ] ShieldLHBlock
- [ ] ShieldLHLower

View File

@ -3,5 +3,6 @@
[TOC]
- @subpage renderertodo
- @subpage currenttarget
- @subpage creaturetodo
- @subpage bigthings
- @subpage indexdebug

View File

@ -749,6 +749,15 @@ Physics work
(09/13/2024)
Physics debugging
Fix terrain physics updating on server
Lots of animations
Organization and documentation around creatures
(09/14/2024)
More animations
Skeleton 3rd person model
NPE fixes in hitbox collection state + commonentityutils
Debug menu ability to play animation locally or on server
# TODO

View File

@ -77,6 +77,13 @@ public class CollisionEngine {
* Default max angular speed
*/
public static final double DEFAULT_MAX_ANGULAR_SPEED = 100;
/**
* The number of times the physics engine should be simulated per frame of main game.
* IE, if this value is 3, every main game engine frame, the physics simulation will run 3 frames.
* This keeps the physics simulation much more stable than it would be otherwise.
*/
public static final int PHYSICS_SIMULATION_RESOLUTION = 5;
//world data that the collision engine leverages for position correction and the like
CollisionWorldData collisionWorldData;
@ -271,7 +278,7 @@ public class CollisionEngine {
public void simulatePhysics(float time){
Globals.profiler.beginCpuSample("physics");
spaceLock.acquireUninterruptibly();
for(int i = 0; i < 5; i++){
for(int i = 0; i < PHYSICS_SIMULATION_RESOLUTION; i++){
Globals.profiler.beginCpuSample("collide");
OdeHelper.spaceCollide(space, 0, nearCallback);
Globals.profiler.endCpuSample();

View File

@ -413,6 +413,8 @@ public class Main {
//need to explicitly kill the vm if you want to see the stack trace
if(Globals.ENGINE_DEBUG){
System.exit(1);
} else {
throw new Error("NPE!");
}
}

View File

@ -3,6 +3,8 @@ package electrosphere.engine.loadingthreads;
import java.io.IOException;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.util.List;
import java.util.Random;
import org.joml.Vector3d;
import org.joml.Vector3f;
@ -157,7 +159,8 @@ public class LoadingUtils {
//Create entity
//
//send default template back
String race = Globals.gameConfigCurrent.getCreatureTypeLoader().getPlayableRaces().get(0);
List<String> races = Globals.gameConfigCurrent.getCreatureTypeLoader().getPlayableRaces();
String race = races.get(new Random().nextInt(races.size()));
CreatureData type = Globals.gameConfigCurrent.getCreatureTypeLoader().getType(race);
CreatureTemplate template = CreatureTemplate.create(race);
for(VisualAttribute attribute : type.getVisualAttributes()){

View File

@ -244,19 +244,21 @@ public class HitboxCollectionState {
Vector3d entityPosition = EntityUtils.getPosition(parent);
this.body.setPosition(PhysicsUtils.jomlVecToOdeVec(entityPosition));
for(String boneName : this.boneHitboxMap.keySet()){
Vector3f bonePosition = EntityUtils.getActor(parent).getBonePosition(boneName);
for(HitboxState state : this.boneHitboxMap.get(boneName)){
DGeom geom = this.stateGeomMap.get(state);
HitboxState shapeStatus = this.geomStateMap.get(geom);
switch(shapeStatus.shapeType){
case SPHERE: {
this.updateSphereShapePosition(collisionEngine,boneName,shapeStatus,bonePosition);
} break;
case CAPSULE: {
this.updateCapsuleShapePosition(collisionEngine,boneName,shapeStatus,bonePosition);
} break;
case STATIC_CAPSULE: {
} break;
if(EntityUtils.getActor(parent).containsBone(boneName)){
Vector3f bonePosition = EntityUtils.getActor(parent).getBonePosition(boneName);
for(HitboxState state : this.boneHitboxMap.get(boneName)){
DGeom geom = this.stateGeomMap.get(state);
HitboxState shapeStatus = this.geomStateMap.get(geom);
switch(shapeStatus.shapeType){
case SPHERE: {
this.updateSphereShapePosition(collisionEngine,boneName,shapeStatus,bonePosition);
} break;
case CAPSULE: {
this.updateCapsuleShapePosition(collisionEngine,boneName,shapeStatus,bonePosition);
} break;
case STATIC_CAPSULE: {
} break;
}
}
}
}
@ -275,22 +277,24 @@ public class HitboxCollectionState {
this.body.setPosition(PhysicsUtils.jomlVecToOdeVec(entityPosition));
//
for(String boneName : this.boneHitboxMap.keySet()){
Vector3f bonePosition = EntityUtils.getPoseActor(parent).getBonePosition(boneName);
//
for(HitboxState state : this.boneHitboxMap.get(boneName)){
if(state == null){
throw new IllegalStateException("Geometry not assigned to a hitbox state!");
}
if(EntityUtils.getPoseActor(parent).containsBone(boneName)){
Vector3f bonePosition = EntityUtils.getPoseActor(parent).getBonePosition(boneName);
//
switch(state.shapeType){
case SPHERE: {
this.updateSphereShapePosition(collisionEngine,boneName,state,bonePosition);
} break;
case CAPSULE: {
this.updateCapsuleShapePosition(collisionEngine,boneName,state,bonePosition);
} break;
case STATIC_CAPSULE: {
} break;
for(HitboxState state : this.boneHitboxMap.get(boneName)){
if(state == null){
throw new IllegalStateException("Geometry not assigned to a hitbox state!");
}
//
switch(state.shapeType){
case SPHERE: {
this.updateSphereShapePosition(collisionEngine,boneName,state,bonePosition);
} break;
case CAPSULE: {
this.updateCapsuleShapePosition(collisionEngine,boneName,state,bonePosition);
} break;
case STATIC_CAPSULE: {
} break;
}
}
}
}

View File

@ -90,7 +90,7 @@ public class CommonEntityUtils {
* @param template The type of entity
* @return The entity
*/
public static Entity clientSpawnBasicCreature(Entity entity, CommonEntityType rawType){
public static Entity clientApplyCommonEntityTransforms(Entity entity, CommonEntityType rawType){
//
//Set typing stuff
@ -313,7 +313,7 @@ public class CommonEntityUtils {
}
}
//rotator system
if(rawType.getRotatorSystem() != null){
if(rawType.getRotatorSystem() != null && rawType.getRotatorSystem().getRotatorItems() != null){
RotatorSystem system = rawType.getRotatorSystem();
RotatorTree rotatorTree = new RotatorTree(entity);
for(RotatorItem item : system.getRotatorItems()){
@ -359,7 +359,7 @@ public class CommonEntityUtils {
* @param template The creature template to use
* @return The creature entity
*/
public static Entity serverSpawnBasicCreature(Realm realm, Vector3d position, Entity entity, CommonEntityType rawType){
public static Entity serverApplyCommonEntityTransforms(Realm realm, Vector3d position, Entity entity, CommonEntityType rawType){
//
//Set typing stuff
@ -598,7 +598,7 @@ public class CommonEntityUtils {
}
//rotator system
if(rawType.getRotatorSystem() != null){
if(rawType.getRotatorSystem() != null && rawType.getRotatorSystem().getRotatorItems() != null){
RotatorSystem system = rawType.getRotatorSystem();
ServerRotatorTree rotatorTree = new ServerRotatorTree(entity);
for(RotatorItem item : system.getRotatorItems()){
@ -658,7 +658,7 @@ public class CommonEntityUtils {
//Common entity transforms
//
//
CommonEntityUtils.clientSpawnBasicCreature(rVal, rawType);
CommonEntityUtils.clientApplyCommonEntityTransforms(rVal, rawType);
//
//
@ -685,7 +685,7 @@ public class CommonEntityUtils {
//Common entity transforms
//
//
CommonEntityUtils.serverSpawnBasicCreature(realm, position, rVal, rawType);
CommonEntityUtils.serverApplyCommonEntityTransforms(realm, position, rVal, rawType);
//
//

View File

@ -55,7 +55,7 @@ public class CreatureUtils {
//
//perform common transforms
//
CommonEntityUtils.clientSpawnBasicCreature(rVal, rawType);
CommonEntityUtils.clientApplyCommonEntityTransforms(rVal, rawType);
//
//Perform creature-specific transforms
@ -155,7 +155,7 @@ public class CreatureUtils {
//Common transforms
//
//
CommonEntityUtils.serverSpawnBasicCreature(realm, position, rVal, rawType);
CommonEntityUtils.serverApplyCommonEntityTransforms(realm, position, rVal, rawType);
//
//

View File

@ -32,7 +32,7 @@ public class FoliageUtils {
* @param type The type of foliage object
* @return The entity for the foliage
*/
public static Entity spawnBasicFoliage(String type, long seed){
public static Entity clientSpawnBasicFoliage(String type, long seed){
FoliageType rawType = Globals.gameConfigCurrent.getFoliageMap().getFoliage(type);
Entity rVal;
if(rawType.getTreeModel()!=null){
@ -46,7 +46,7 @@ public class FoliageUtils {
//Common entity transforms
//
//
CommonEntityUtils.clientSpawnBasicCreature(rVal, rawType);
CommonEntityUtils.clientApplyCommonEntityTransforms(rVal, rawType);
//
//
@ -74,14 +74,19 @@ public class FoliageUtils {
*/
public static Entity serverSpawnTreeFoliage(Realm realm, Vector3d position, String type, long seed){
FoliageType rawType = Globals.gameConfigCurrent.getFoliageMap().getFoliage(type);
Entity rVal = ProceduralTree.serverGenerateProceduralTree(realm, position, rawType, seed);
Entity rVal;
if(rawType.getTreeModel()!=null){
rVal = ProceduralTree.serverGenerateProceduralTree(realm, position, rawType, seed);
} else {
rVal = EntityCreationUtils.createServerEntity(realm, position);
}
//
//
//Common entity transforms
//
//
CommonEntityUtils.serverSpawnBasicCreature(realm, position, rVal, rawType);
CommonEntityUtils.serverApplyCommonEntityTransforms(realm, position, rVal, rawType);
//
//

View File

@ -51,7 +51,7 @@ public class ItemUtils {
//Common entity transforms
//
//
CommonEntityUtils.clientSpawnBasicCreature(rVal, item);
CommonEntityUtils.clientApplyCommonEntityTransforms(rVal, item);
//
//
@ -115,7 +115,7 @@ public class ItemUtils {
//Common entity transforms
//
//
CommonEntityUtils.serverSpawnBasicCreature(realm, position, rVal, item);
CommonEntityUtils.serverApplyCommonEntityTransforms(realm, position, rVal, item);
//
//

View File

@ -65,7 +65,7 @@ public class TerrainChunk {
if(data.vertices.size() > 0){
PhysicsEntityUtils.serverAttachTerrainChunkRigidBody(rVal, data);
rVal.putData(EntityDataStrings.TERRAIN_IS_TERRAIN, true);
ServerEntityUtils.initiallyPositionEntity(realm, rVal, position);
// ServerEntityUtils.initiallyPositionEntity(realm, rVal, position);
// physicsObject = PhysicsUtils.attachTerrainRigidBody(physicsEntity,heightmap,true);
// Realm realm = Globals.realmManager.getEntityRealm(physicsEntity);
// realm.getCollisionEngine().registerPhysicsEntity(physicsEntity);

View File

@ -13,6 +13,7 @@ import electrosphere.collision.PhysicsEntityUtils;
import electrosphere.engine.Globals;
import electrosphere.entity.Entity;
import electrosphere.entity.EntityUtils;
import electrosphere.entity.state.AnimationPriorities;
import electrosphere.entity.state.attach.AttachUtils;
import electrosphere.entity.state.client.firstPerson.FirstPersonTree;
import electrosphere.entity.state.equip.ClientEquipState;
@ -230,6 +231,9 @@ public class ImGuiEntityMacros {
ImGui.indent();
for(Animation animation : model.getAnimations()){
if(ImGui.collapsingHeader(animation.name)){
if(ImGui.button("Play")){
actor.playAnimation(animation.name, AnimationPriorities.getValue(AnimationPriorities.MODIFIER_MAX));
}
for(AnimChannel channel : animation.channels){
ImGui.pushID(channel.getNodeID());
if(ImGui.button("Fully describe")){
@ -306,6 +310,9 @@ public class ImGuiEntityMacros {
ImGui.indent();
for(Animation animation : model.getAnimations()){
if(ImGui.collapsingHeader(animation.name)){
if(ImGui.button("Play")){
poseActor.playAnimation(animation.name, AnimationPriorities.getValue(AnimationPriorities.MODIFIER_MAX));
}
for(AnimChannel channel : animation.channels){
ImGui.pushID(channel.getNodeID());
if(ImGui.button("Fully describe")){

View File

@ -262,7 +262,7 @@ public class EntityProtocol implements ClientProtocolTemplate<EntityMessage> {
static Entity spawnFoliage(EntityMessage message){
LoggerInterface.loggerNetworking.DEBUG("[CLIENT] Spawn foliage " + message.getentityID() + " at " + message.getpositionX() + " " + message.getpositionY() + " " + message.getpositionZ());
String type = message.getentitySubtype();
Entity newlySpawnedEntity = FoliageUtils.spawnBasicFoliage(type,Long.parseLong(message.getcreatureTemplate()));
Entity newlySpawnedEntity = FoliageUtils.clientSpawnBasicFoliage(type,Long.parseLong(message.getcreatureTemplate()));
ClientEntityUtils.initiallyPositionEntity(
newlySpawnedEntity,
new Vector3d(message.getpositionX(),message.getpositionY(),message.getpositionZ()),

View File

@ -572,6 +572,19 @@ public class Actor {
return null;
}
/**
* Checks if the actor contains a bone
* @param boneName The name of the bone
* @return true if it exists, false otherwise
*/
public boolean containsBone(String boneName){
Model model = Globals.assetManager.fetchModel(modelPath);
if(model != null){
return model.getBoneMap().containsKey(boneName);
}
return false;
}
public boolean modelIsLoaded(){
Model model = Globals.assetManager.fetchModel(modelPath);
if(model != null){

View File

@ -70,6 +70,11 @@ public class GriddedDataCellManager implements DataCellManager, VoxelCellManager
Semaphore terrainEditLock = new Semaphore(1);
//manager for getting entities to fill in a cell
ServerContentManager serverContentManager;
/**
* Map of world position key -> physics cell
*/
Map<String,PhysicsDataCell> posPhysicsMap = new HashMap<String,PhysicsDataCell>();
/**
* Constructor
@ -231,8 +236,16 @@ public class GriddedDataCellManager implements DataCellManager, VoxelCellManager
* Creates physics entities when new data cell being created
*/
private void createTerrainPhysicsEntities(Vector3i worldPos){
PhysicsDataCell cell = PhysicsDataCell.createPhysicsCell(parent, worldPos);
cell.generatePhysics();
String key = this.getServerDataCellKey(worldPos);
if(posPhysicsMap.containsKey(key)){
PhysicsDataCell cell = posPhysicsMap.get(key);
cell.retireCell();
cell.generatePhysics();
} else {
PhysicsDataCell cell = PhysicsDataCell.createPhysicsCell(parent, worldPos);
cell.generatePhysics();
posPhysicsMap.put(key, cell);
}
}
/**
@ -511,6 +524,7 @@ public class GriddedDataCellManager implements DataCellManager, VoxelCellManager
terrainEditLock.acquireUninterruptibly();
//update terrain
serverTerrainManager.deformTerrainAtLocationToValue(worldPosition, voxelPosition, weight, type);
this.createTerrainPhysicsEntities(worldPosition);
//broadcast update to terrain
ServerDataCell cell = groundDataCells.get(getServerDataCellKey(worldPosition));
if(cell != null){

View File

@ -4,7 +4,7 @@ import electrosphere.client.terrain.cache.ChunkData;
import electrosphere.engine.Globals;
import electrosphere.entity.Entity;
import electrosphere.entity.EntityDataStrings;
import electrosphere.entity.EntityUtils;
import electrosphere.entity.ServerEntityUtils;
import electrosphere.entity.types.terrain.TerrainChunk;
import electrosphere.server.datacell.Realm;
import electrosphere.server.terrain.manager.ServerTerrainChunk;
@ -57,7 +57,8 @@ public class PhysicsDataCell {
* Retires a physics data cell
*/
public void retireCell(){
EntityUtils.cleanUpEntity(physicsEntity);
ServerEntityUtils.destroyEntity(physicsEntity);
this.physicsEntity = null;
}
/**

View File

@ -423,6 +423,19 @@ public class PoseActor {
return rVal;
}
/**
* Checks if the bone exists on the actor
* @param boneName The name of the bone
* @return true if it exists, false otherwise
*/
public boolean containsBone(String boneName){
PoseModel model = Globals.assetManager.fetchPoseModel(modelPath);
if(model != null){
return model.boneMap.containsKey(boneName);
}
return false;
}
/**
* Gets the model path associated with the pose actor
* @return The model path

View File

@ -0,0 +1,62 @@
package electrosphere.entity;
import static org.junit.jupiter.api.Assertions.*;
import org.joml.Vector3d;
import org.junit.jupiter.api.Disabled;
import electrosphere.engine.Globals;
import electrosphere.entity.types.common.CommonEntityUtils;
import electrosphere.entity.types.creature.CreatureTemplate;
import electrosphere.entity.types.creature.CreatureUtils;
import electrosphere.entity.types.foliage.FoliageUtils;
import electrosphere.entity.types.item.ItemUtils;
import electrosphere.game.data.common.CommonEntityMap;
import electrosphere.game.data.common.CommonEntityType;
import electrosphere.game.data.creature.type.CreatureData;
import electrosphere.game.data.creature.type.CreatureTypeLoader;
import electrosphere.game.data.foliage.type.FoliageType;
import electrosphere.game.data.foliage.type.model.FoliageTypeMap;
import electrosphere.game.data.item.type.Item;
import electrosphere.game.data.item.type.model.ItemTypeMap;
import electrosphere.test.annotations.IntegrationTest;
import electrosphere.test.template.EntityTestTemplate;
import electrosphere.test.testutils.TestEngineUtils;
/**
* Tests for spawning entities
*/
public class SpawnAllEntitiesTests extends EntityTestTemplate {
@Disabled
@IntegrationTest
public void spawnAllEntities(){
Globals.ENGINE_DEBUG = false;
assertDoesNotThrow(() -> {
CreatureTypeLoader creatureLoader = Globals.gameConfigCurrent.getCreatureTypeLoader();
for(CreatureData creature : creatureLoader.getTypes()){
CreatureUtils.serverSpawnBasicCreature(Globals.realmManager.first(), new Vector3d(0.1,0.1,0.1), creature.getId(), CreatureTemplate.createDefault(creature.getId()));
}
ItemTypeMap itemMap = Globals.gameConfigCurrent.getItemMap();
for(Item item : itemMap.getItems()){
ItemUtils.serverSpawnBasicItem(Globals.realmManager.first(), new Vector3d(0.1,0.1,0.1), item.getId());
}
FoliageTypeMap foliageTypeMap = Globals.gameConfigCurrent.getFoliageMap();
for(FoliageType foliage : foliageTypeMap.getFoliageList()){
FoliageUtils.serverSpawnTreeFoliage(Globals.realmManager.first(), new Vector3d(0.1,0.1,0.1), foliage.getId(), 0);
}
CommonEntityMap commonEntityMap = Globals.gameConfigCurrent.getObjectTypeMap();
for(CommonEntityType entity : commonEntityMap.getTypes()){
CommonEntityUtils.serverSpawnBasicObject(Globals.realmManager.first(), new Vector3d(0.1,0.1,0.1), entity.getId());
}
//wait for entities to propagate across network
TestEngineUtils.simulateFrames(100);
});
}
}