ground move refactor
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2024-03-21 18:47:07 -04:00
parent 742231a5de
commit ba5537bcf7
18 changed files with 62 additions and 32 deletions

View File

@ -39,6 +39,8 @@
- Overgrown Mountain - Overgrown Mountain
- Magnetic Mountain - Magnetic Mountain
## Hot Springs
## Ruins ## Ruins
## Light Valley ## Light Valley
@ -306,3 +308,9 @@ Full of kelp dangling from island, lots of sea-themed flying creatures
## Ghost Water in the Sky ## Ghost Water in the Sky
Idk what this means but I just came up with it and it sounds cool Idk what this means but I just came up with it and it sounds cool
## Resort Island
Extremely pretty and serene nature island perfect for building a resort
## Fleshy Horror Island
A living sky island full of demons

View File

@ -88,11 +88,11 @@ import electrosphere.entity.state.equip.EquipState;
import electrosphere.entity.state.inventory.InventoryUtils; import electrosphere.entity.state.inventory.InventoryUtils;
import electrosphere.entity.state.inventory.UnrelationalInventoryState; import electrosphere.entity.state.inventory.UnrelationalInventoryState;
import electrosphere.entity.state.ironsight.IronSightTree; import electrosphere.entity.state.ironsight.IronSightTree;
import electrosphere.entity.state.movement.GroundMovementTree;
import electrosphere.entity.state.movement.JumpTree; import electrosphere.entity.state.movement.JumpTree;
import electrosphere.entity.state.movement.GroundMovementTree.MovementRelativeFacing;
import electrosphere.entity.state.movement.GroundMovementTree.MovementTreeState;
import electrosphere.entity.state.movement.SprintTree; import electrosphere.entity.state.movement.SprintTree;
import electrosphere.entity.state.movement.groundmove.GroundMovementTree;
import electrosphere.entity.state.movement.groundmove.GroundMovementTree.MovementRelativeFacing;
import electrosphere.entity.state.movement.groundmove.GroundMovementTree.MovementTreeState;
import electrosphere.entity.types.camera.CameraEntityUtils; import electrosphere.entity.types.camera.CameraEntityUtils;
import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.creature.CreatureUtils;
import electrosphere.logger.LoggerInterface; import electrosphere.logger.LoggerInterface;

View File

@ -6,7 +6,7 @@
package electrosphere.entity; package electrosphere.entity;
import electrosphere.engine.Globals; import electrosphere.engine.Globals;
import electrosphere.entity.state.movement.GroundMovementTree; import electrosphere.entity.state.movement.groundmove.GroundMovementTree;
import electrosphere.entity.types.collision.CollisionObjUtils; import electrosphere.entity.types.collision.CollisionObjUtils;
import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.creature.CreatureUtils;
import electrosphere.entity.types.item.ItemUtils; import electrosphere.entity.types.item.ItemUtils;

View File

@ -10,7 +10,7 @@ import electrosphere.entity.ServerEntityUtils;
import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.state.BehaviorTree;
import electrosphere.entity.state.collidable.Impulse; import electrosphere.entity.state.collidable.Impulse;
import electrosphere.entity.state.equip.EquipState; import electrosphere.entity.state.equip.EquipState;
import electrosphere.entity.state.movement.GroundMovementTree; import electrosphere.entity.state.movement.groundmove.GroundMovementTree;
import electrosphere.entity.state.rotator.RotatorTree; import electrosphere.entity.state.rotator.RotatorTree;
import electrosphere.entity.types.attach.AttachUtils; import electrosphere.entity.types.attach.AttachUtils;
import electrosphere.entity.types.collision.CollisionObjUtils; import electrosphere.entity.types.collision.CollisionObjUtils;

View File

@ -10,8 +10,8 @@ import electrosphere.entity.ServerEntityUtils;
import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.state.BehaviorTree;
import electrosphere.entity.state.collidable.Impulse; import electrosphere.entity.state.collidable.Impulse;
import electrosphere.entity.state.equip.EquipState; import electrosphere.entity.state.equip.EquipState;
import electrosphere.entity.state.movement.GroundMovementTree; import electrosphere.entity.state.movement.groundmove.GroundMovementTree;
import electrosphere.entity.state.movement.ServerGroundMovementTree; import electrosphere.entity.state.movement.groundmove.ServerGroundMovementTree;
import electrosphere.entity.state.rotator.RotatorTree; import electrosphere.entity.state.rotator.RotatorTree;
import electrosphere.entity.state.rotator.ServerRotatorTree; import electrosphere.entity.state.rotator.ServerRotatorTree;
import electrosphere.entity.types.attach.AttachUtils; import electrosphere.entity.types.attach.AttachUtils;

View File

@ -6,12 +6,12 @@ import electrosphere.net.synchronization.BehaviorTreeIdEnums;
import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.state.BehaviorTree;
import electrosphere.entity.state.attack.AttackTree; import electrosphere.entity.state.attack.AttackTree;
import electrosphere.entity.state.movement.AirplaneMovementTree; import electrosphere.entity.state.movement.AirplaneMovementTree;
import electrosphere.entity.state.movement.GroundMovementTree; import electrosphere.entity.state.movement.groundmove.GroundMovementTree;
import electrosphere.entity.state.movement.groundmove.GroundMovementTree.MovementTreeState;
import electrosphere.engine.Globals; import electrosphere.engine.Globals;
import electrosphere.entity.Entity; import electrosphere.entity.Entity;
import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityDataStrings;
import electrosphere.entity.EntityUtils; import electrosphere.entity.EntityUtils;
import electrosphere.entity.state.movement.GroundMovementTree.MovementTreeState;
import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.creature.CreatureUtils;
import electrosphere.net.synchronization.annotation.SyncedField; import electrosphere.net.synchronization.annotation.SyncedField;
import electrosphere.net.synchronization.annotation.SynchronizableEnum; import electrosphere.net.synchronization.annotation.SynchronizableEnum;

View File

@ -5,12 +5,12 @@ import electrosphere.entity.state.attack.ServerAttackTree;
import electrosphere.entity.state.attack.ServerAttackTree.AttackTreeState; import electrosphere.entity.state.attack.ServerAttackTree.AttackTreeState;
import electrosphere.entity.state.idle.IdleTree.IdleTreeState; import electrosphere.entity.state.idle.IdleTree.IdleTreeState;
import electrosphere.entity.state.movement.AirplaneMovementTree; import electrosphere.entity.state.movement.AirplaneMovementTree;
import electrosphere.entity.state.movement.ServerGroundMovementTree; import electrosphere.entity.state.movement.groundmove.ServerGroundMovementTree;
import electrosphere.entity.state.movement.groundmove.ServerGroundMovementTree.MovementTreeState;
import electrosphere.engine.Globals; import electrosphere.engine.Globals;
import electrosphere.entity.Entity; import electrosphere.entity.Entity;
import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityDataStrings;
import electrosphere.entity.EntityUtils; import electrosphere.entity.EntityUtils;
import electrosphere.entity.state.movement.ServerGroundMovementTree.MovementTreeState;
import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.creature.CreatureUtils;
import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.net.parser.net.message.EntityMessage;
import electrosphere.net.parser.net.message.SynchronizationMessage; import electrosphere.net.parser.net.message.SynchronizationMessage;

View File

@ -3,7 +3,8 @@ package electrosphere.entity.state.movement;
import electrosphere.engine.Main; import electrosphere.engine.Main;
import electrosphere.entity.Entity; import electrosphere.entity.Entity;
import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.state.BehaviorTree;
import electrosphere.entity.state.movement.ServerGroundMovementTree.MovementTreeState; import electrosphere.entity.state.movement.groundmove.ServerGroundMovementTree;
import electrosphere.entity.state.movement.groundmove.ServerGroundMovementTree.MovementTreeState;
/** /**
* *
@ -72,5 +73,12 @@ public class ServerSprintTree implements BehaviorTree {
public void setServerGroundMovementTree(ServerGroundMovementTree groundMovementTree){ public void setServerGroundMovementTree(ServerGroundMovementTree groundMovementTree){
this.groundMovementTree = groundMovementTree; this.groundMovementTree = groundMovementTree;
} }
//get max velocity
public float getMaxVelocity() {
return maxVelocity;
}
} }

View File

@ -3,7 +3,8 @@ package electrosphere.entity.state.movement;
import electrosphere.engine.Main; import electrosphere.engine.Main;
import electrosphere.entity.Entity; import electrosphere.entity.Entity;
import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.state.BehaviorTree;
import electrosphere.entity.state.movement.GroundMovementTree.MovementTreeState; import electrosphere.entity.state.movement.groundmove.GroundMovementTree;
import electrosphere.entity.state.movement.groundmove.GroundMovementTree.MovementTreeState;
/** /**
* *
@ -72,5 +73,12 @@ public class SprintTree implements BehaviorTree {
public void setGroundMovementTree(GroundMovementTree groundMovementTree){ public void setGroundMovementTree(GroundMovementTree groundMovementTree){
this.groundMovementTree = groundMovementTree; this.groundMovementTree = groundMovementTree;
} }
//get max velocity
public float getMaxVelocity() {
return maxVelocity;
}
} }

View File

@ -1,4 +1,4 @@
package electrosphere.entity.state.movement; package electrosphere.entity.state.movement.groundmove;
import electrosphere.entity.state.collidable.Impulse; import electrosphere.entity.state.collidable.Impulse;
import electrosphere.entity.state.gravity.ClientGravityTree; import electrosphere.entity.state.gravity.ClientGravityTree;
@ -16,6 +16,9 @@ import electrosphere.entity.EntityUtils;
import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.state.BehaviorTree;
import electrosphere.entity.state.attack.AttackTree; import electrosphere.entity.state.attack.AttackTree;
import electrosphere.entity.state.attack.AttackTree.AttackTreeState; import electrosphere.entity.state.attack.AttackTree.AttackTreeState;
import electrosphere.entity.state.movement.FallTree;
import electrosphere.entity.state.movement.JumpTree;
import electrosphere.entity.state.movement.SprintTree;
import electrosphere.entity.state.movement.SprintTree.SprintTreeState; import electrosphere.entity.state.movement.SprintTree.SprintTreeState;
import electrosphere.net.NetUtils; import electrosphere.net.NetUtils;
import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.net.parser.net.message.EntityMessage;
@ -153,7 +156,7 @@ public class GroundMovementTree implements BehaviorTree {
public void simulate(float deltaTime){ public void simulate(float deltaTime){
float velocity = CreatureUtils.getVelocity(parent); float velocity = CreatureUtils.getVelocity(parent);
float acceleration = CreatureUtils.getAcceleration(parent); float acceleration = CreatureUtils.getAcceleration(parent);
float maxNaturalVelocity = sprintTree != null && sprintTree.state == SprintTreeState.SPRINTING ? sprintTree.maxVelocity : CreatureUtils.getMaxNaturalVelocity(parent); float maxNaturalVelocity = sprintTree != null && sprintTree.getState() == SprintTreeState.SPRINTING ? sprintTree.getMaxVelocity() : CreatureUtils.getMaxNaturalVelocity(parent);
Actor entityActor = EntityUtils.getActor(parent); Actor entityActor = EntityUtils.getActor(parent);
// Model entityModel = Globals.assetManager.fetchModel(EntityUtils.getEntityModelPath(parent)); // Model entityModel = Globals.assetManager.fetchModel(EntityUtils.getEntityModelPath(parent));
Vector3d position = EntityUtils.getPosition(parent); Vector3d position = EntityUtils.getPosition(parent);
@ -396,7 +399,7 @@ public class GroundMovementTree implements BehaviorTree {
public String determineCorrectAnimation(){ public String determineCorrectAnimation(){
String rVal = ""; String rVal = "";
if(sprintTree != null){ if(sprintTree != null){
switch(sprintTree.state){ switch(sprintTree.getState()){
case SPRINTING: case SPRINTING:
switch(state){ switch(state){
case IDLE: case IDLE:

View File

@ -1,4 +1,4 @@
package electrosphere.entity.state.movement; package electrosphere.entity.state.movement.groundmove;
import electrosphere.entity.state.collidable.Impulse; import electrosphere.entity.state.collidable.Impulse;
import electrosphere.entity.state.gravity.GravityUtils; import electrosphere.entity.state.gravity.GravityUtils;
@ -15,6 +15,9 @@ import electrosphere.entity.EntityUtils;
import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.state.BehaviorTree;
import electrosphere.entity.state.attack.ServerAttackTree; import electrosphere.entity.state.attack.ServerAttackTree;
import electrosphere.entity.state.attack.ServerAttackTree.AttackTreeState; import electrosphere.entity.state.attack.ServerAttackTree.AttackTreeState;
import electrosphere.entity.state.movement.ServerFallTree;
import electrosphere.entity.state.movement.ServerJumpTree;
import electrosphere.entity.state.movement.ServerSprintTree;
import electrosphere.entity.state.movement.ServerSprintTree.SprintTreeState; import electrosphere.entity.state.movement.ServerSprintTree.SprintTreeState;
import electrosphere.net.NetUtils; import electrosphere.net.NetUtils;
import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.net.parser.net.message.EntityMessage;
@ -153,7 +156,7 @@ public class ServerGroundMovementTree implements BehaviorTree {
public void simulate(float deltaTime){ public void simulate(float deltaTime){
float velocity = CreatureUtils.getVelocity(parent); float velocity = CreatureUtils.getVelocity(parent);
float acceleration = CreatureUtils.getAcceleration(parent); float acceleration = CreatureUtils.getAcceleration(parent);
float maxNaturalVelocity = sprintTree != null && sprintTree.state == SprintTreeState.SPRINTING ? sprintTree.maxVelocity : CreatureUtils.getMaxNaturalVelocity(parent); float maxNaturalVelocity = sprintTree != null && sprintTree.getState() == SprintTreeState.SPRINTING ? sprintTree.getMaxVelocity() : CreatureUtils.getMaxNaturalVelocity(parent);
PoseActor entityPoseActor = EntityUtils.getPoseActor(parent); PoseActor entityPoseActor = EntityUtils.getPoseActor(parent);
// Model entityModel = Globals.assetManager.fetchModel(EntityUtils.getEntityModelPath(parent)); // Model entityModel = Globals.assetManager.fetchModel(EntityUtils.getEntityModelPath(parent));
Vector3d position = EntityUtils.getPosition(parent); Vector3d position = EntityUtils.getPosition(parent);
@ -432,7 +435,7 @@ public class ServerGroundMovementTree implements BehaviorTree {
public String determineCorrectAnimation(){ public String determineCorrectAnimation(){
String rVal = ""; String rVal = "";
if(sprintTree != null){ if(sprintTree != null){
switch(sprintTree.state){ switch(sprintTree.getState()){
case SPRINTING: case SPRINTING:
switch(state){ switch(state){
case IDLE: case IDLE:

View File

@ -37,13 +37,13 @@ import electrosphere.entity.state.inventory.UnrelationalInventoryState;
import electrosphere.entity.state.life.LifeState; import electrosphere.entity.state.life.LifeState;
import electrosphere.entity.state.movement.AirplaneMovementTree; import electrosphere.entity.state.movement.AirplaneMovementTree;
import electrosphere.entity.state.movement.FallTree; import electrosphere.entity.state.movement.FallTree;
import electrosphere.entity.state.movement.GroundMovementTree;
import electrosphere.entity.state.movement.JumpTree; import electrosphere.entity.state.movement.JumpTree;
import electrosphere.entity.state.movement.ServerFallTree; import electrosphere.entity.state.movement.ServerFallTree;
import electrosphere.entity.state.movement.ServerGroundMovementTree;
import electrosphere.entity.state.movement.ServerJumpTree; import electrosphere.entity.state.movement.ServerJumpTree;
import electrosphere.entity.state.movement.ServerSprintTree; import electrosphere.entity.state.movement.ServerSprintTree;
import electrosphere.entity.state.movement.SprintTree; import electrosphere.entity.state.movement.SprintTree;
import electrosphere.entity.state.movement.groundmove.GroundMovementTree;
import electrosphere.entity.state.movement.groundmove.ServerGroundMovementTree;
import electrosphere.entity.state.rotator.RotatorHierarchyNode; import electrosphere.entity.state.rotator.RotatorHierarchyNode;
import electrosphere.entity.state.rotator.RotatorTree; import electrosphere.entity.state.rotator.RotatorTree;
import electrosphere.entity.state.rotator.ServerRotatorTree; import electrosphere.entity.state.rotator.ServerRotatorTree;

View File

@ -3,8 +3,8 @@ package electrosphere.server.ai.creature;
import electrosphere.engine.Globals; import electrosphere.engine.Globals;
import electrosphere.entity.Entity; import electrosphere.entity.Entity;
import electrosphere.entity.EntityUtils; import electrosphere.entity.EntityUtils;
import electrosphere.entity.state.movement.GroundMovementTree; import electrosphere.entity.state.movement.groundmove.GroundMovementTree;
import electrosphere.entity.state.movement.GroundMovementTree.MovementRelativeFacing; import electrosphere.entity.state.movement.groundmove.GroundMovementTree.MovementRelativeFacing;
import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.creature.CreatureUtils;
import electrosphere.server.ai.AI; import electrosphere.server.ai.AI;

View File

@ -7,8 +7,8 @@ import electrosphere.entity.EntityTags;
import electrosphere.entity.EntityUtils; import electrosphere.entity.EntityUtils;
import electrosphere.entity.state.attack.AttackTree; import electrosphere.entity.state.attack.AttackTree;
import electrosphere.entity.state.attack.ServerAttackTree; import electrosphere.entity.state.attack.ServerAttackTree;
import electrosphere.entity.state.movement.GroundMovementTree; import electrosphere.entity.state.movement.groundmove.GroundMovementTree;
import electrosphere.entity.state.movement.GroundMovementTree.MovementRelativeFacing; import electrosphere.entity.state.movement.groundmove.GroundMovementTree.MovementRelativeFacing;
import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.creature.CreatureUtils;
import electrosphere.server.ai.AI; import electrosphere.server.ai.AI;
import electrosphere.server.datacell.Realm; import electrosphere.server.datacell.Realm;

View File

@ -8,8 +8,8 @@ import electrosphere.entity.EntityUtils;
import electrosphere.entity.state.attack.AttackTree; import electrosphere.entity.state.attack.AttackTree;
import electrosphere.entity.state.attack.ServerAttackTree; import electrosphere.entity.state.attack.ServerAttackTree;
import electrosphere.entity.state.equip.EquipState; import electrosphere.entity.state.equip.EquipState;
import electrosphere.entity.state.movement.GroundMovementTree; import electrosphere.entity.state.movement.groundmove.GroundMovementTree;
import electrosphere.entity.state.movement.GroundMovementTree.MovementRelativeFacing; import electrosphere.entity.state.movement.groundmove.GroundMovementTree.MovementRelativeFacing;
import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.creature.CreatureUtils;
import electrosphere.entity.types.item.ItemUtils; import electrosphere.entity.types.item.ItemUtils;
import electrosphere.server.ai.AI; import electrosphere.server.ai.AI;

View File

@ -5,8 +5,8 @@ import org.joml.Vector3d;
import electrosphere.engine.Globals; import electrosphere.engine.Globals;
import electrosphere.entity.Entity; import electrosphere.entity.Entity;
import electrosphere.entity.EntityUtils; import electrosphere.entity.EntityUtils;
import electrosphere.entity.state.movement.GroundMovementTree; import electrosphere.entity.state.movement.groundmove.GroundMovementTree;
import electrosphere.entity.state.movement.GroundMovementTree.MovementRelativeFacing; import electrosphere.entity.state.movement.groundmove.GroundMovementTree.MovementRelativeFacing;
import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.creature.CreatureUtils;
import electrosphere.game.server.town.Town; import electrosphere.game.server.town.Town;
import electrosphere.server.ai.AI; import electrosphere.server.ai.AI;

View File

@ -5,8 +5,8 @@ import org.joml.Vector3d;
import electrosphere.engine.Globals; import electrosphere.engine.Globals;
import electrosphere.entity.Entity; import electrosphere.entity.Entity;
import electrosphere.entity.EntityUtils; import electrosphere.entity.EntityUtils;
import electrosphere.entity.state.movement.GroundMovementTree; import electrosphere.entity.state.movement.groundmove.GroundMovementTree;
import electrosphere.entity.state.movement.GroundMovementTree.MovementRelativeFacing; import electrosphere.entity.state.movement.groundmove.GroundMovementTree.MovementRelativeFacing;
import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.creature.CreatureUtils;
import electrosphere.server.ai.AI; import electrosphere.server.ai.AI;

View File

@ -10,7 +10,6 @@ import electrosphere.entity.EntityTags;
import electrosphere.entity.EntityUtils; import electrosphere.entity.EntityUtils;
import electrosphere.entity.scene.EntityDescriptor; import electrosphere.entity.scene.EntityDescriptor;
import electrosphere.entity.state.BehaviorTree; import electrosphere.entity.state.BehaviorTree;
import electrosphere.entity.state.movement.GroundMovementTree;
import electrosphere.entity.state.ParticleTree; import electrosphere.entity.state.ParticleTree;
import electrosphere.entity.state.attack.AttackTree; import electrosphere.entity.state.attack.AttackTree;
import electrosphere.entity.state.collidable.ClientCollidableTree; import electrosphere.entity.state.collidable.ClientCollidableTree;
@ -23,6 +22,7 @@ import electrosphere.entity.types.item.ItemUtils;
import electrosphere.entity.state.life.LifeState; import electrosphere.entity.state.life.LifeState;
import electrosphere.entity.state.life.LifeUtils; import electrosphere.entity.state.life.LifeUtils;
import electrosphere.entity.state.movement.SprintTree; import electrosphere.entity.state.movement.SprintTree;
import electrosphere.entity.state.movement.groundmove.GroundMovementTree;
import electrosphere.entity.types.particle.ParticleUtils; import electrosphere.entity.types.particle.ParticleUtils;
import electrosphere.net.parser.net.message.EntityMessage; import electrosphere.net.parser.net.message.EntityMessage;
import electrosphere.renderer.actor.Actor; import electrosphere.renderer.actor.Actor;