attack bugfixes
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
51e028d9bb
commit
1314ceac06
@ -1,3 +1,3 @@
|
|||||||
#maven.buildNumber.plugin properties file
|
#maven.buildNumber.plugin properties file
|
||||||
#Fri Aug 16 15:43:29 EDT 2024
|
#Fri Aug 16 15:53:57 EDT 2024
|
||||||
buildNumber=252
|
buildNumber=253
|
||||||
|
|||||||
@ -22,8 +22,6 @@
|
|||||||
Fix physics freakout for vertically aligned entities
|
Fix physics freakout for vertically aligned entities
|
||||||
Fix entities running to edge of map causing audio engine to break
|
Fix entities running to edge of map causing audio engine to break
|
||||||
|
|
||||||
Fix attack animation mayyybe caching on non-local clients ??
|
|
||||||
Fix sword double-swing
|
|
||||||
Fix broken rendering pipeline when creating new level
|
Fix broken rendering pipeline when creating new level
|
||||||
Fix AI tracking deleted entity
|
Fix AI tracking deleted entity
|
||||||
Fix AI components not resetting on turning off ai manager
|
Fix AI components not resetting on turning off ai manager
|
||||||
|
|||||||
@ -592,6 +592,8 @@ Launcher fixes
|
|||||||
Fix inventory control state suggestions not working correctly
|
Fix inventory control state suggestions not working correctly
|
||||||
Fix unequipping item hard crashing engine
|
Fix unequipping item hard crashing engine
|
||||||
Fix terrain editing hard crashing engine
|
Fix terrain editing hard crashing engine
|
||||||
|
Fix attack animation mayyybe caching on non-local clients ??
|
||||||
|
Fix sword double-swing
|
||||||
|
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|||||||
@ -4,7 +4,6 @@ package electrosphere.entity.state.attack;
|
|||||||
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.btree.BehaviorTree;
|
import electrosphere.entity.btree.BehaviorTree;
|
||||||
import electrosphere.entity.btree.StateTransitionUtil;
|
import electrosphere.entity.btree.StateTransitionUtil;
|
||||||
import electrosphere.entity.btree.StateTransitionUtil.StateTransitionUtilItem;
|
import electrosphere.entity.btree.StateTransitionUtil.StateTransitionUtilItem;
|
||||||
@ -27,7 +26,6 @@ import electrosphere.net.synchronization.annotation.SynchronizedBehaviorTree;
|
|||||||
import electrosphere.net.synchronization.enums.BehaviorTreeIdEnums;
|
import electrosphere.net.synchronization.enums.BehaviorTreeIdEnums;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
|
||||||
|
|
||||||
import org.joml.Vector3d;
|
import org.joml.Vector3d;
|
||||||
|
|
||||||
@ -69,9 +67,6 @@ public class ClientAttackTree implements BehaviorTree {
|
|||||||
//the parent entity of this attack tree
|
//the parent entity of this attack tree
|
||||||
Entity parent;
|
Entity parent;
|
||||||
|
|
||||||
//the queue of network messages to process
|
|
||||||
CopyOnWriteArrayList<EntityMessage> networkMessageQueue = new CopyOnWriteArrayList<EntityMessage>();
|
|
||||||
|
|
||||||
//the last time this tree was updated by server
|
//the last time this tree was updated by server
|
||||||
long lastUpdateTime = 0;
|
long lastUpdateTime = 0;
|
||||||
|
|
||||||
@ -281,48 +276,6 @@ public class ClientAttackTree implements BehaviorTree {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
//parse attached network messages
|
|
||||||
for(EntityMessage message : networkMessageQueue){
|
|
||||||
networkMessageQueue.remove(message);
|
|
||||||
// System.out.println("MOVE to " + message.getX() + " " + message.getY() + " " + message.getZ());
|
|
||||||
long updateTime = message.gettime();
|
|
||||||
switch(message.getMessageSubtype()){
|
|
||||||
case ATTACKUPDATE:
|
|
||||||
if(updateTime > lastUpdateTime){
|
|
||||||
lastUpdateTime = updateTime;
|
|
||||||
switch(message.gettreeState()){
|
|
||||||
case 0:
|
|
||||||
setState(AttackTreeState.WINDUP);
|
|
||||||
frameCurrent = 0;
|
|
||||||
// System.out.println("Set state STARTUP");
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
frameCurrent = currentMove.getWindupFrames()+1;
|
|
||||||
setState(AttackTreeState.ATTACK);
|
|
||||||
// System.out.println("Set state MOVE");
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
frameCurrent = currentMove.getWindupFrames()+currentMove.getAttackFrames()+1;
|
|
||||||
setState(AttackTreeState.COOLDOWN);
|
|
||||||
// System.out.println("Set state SLOWDOWN");
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
frameCurrent = 60;
|
|
||||||
setState(AttackTreeState.IDLE);
|
|
||||||
// System.out.println("Set state IDLE");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EntityUtils.getPosition(parent).set(message.getpositionX(),message.getpositionY(),message.getpositionZ());
|
|
||||||
CreatureUtils.setFacingVector(parent, new Vector3d(message.getrotationX(),message.getrotationY(),message.getrotationZ()));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
//silently ignore
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//handle the drifting if we're supposed to currently
|
//handle the drifting if we're supposed to currently
|
||||||
switch(driftState){
|
switch(driftState){
|
||||||
case DRIFT:
|
case DRIFT:
|
||||||
@ -393,10 +346,6 @@ public class ClientAttackTree implements BehaviorTree {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addNetworkMessage(EntityMessage networkMessage) {
|
|
||||||
networkMessageQueue.add(networkMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current attack type
|
* Gets the current attack type
|
||||||
* @return The current attack type
|
* @return The current attack type
|
||||||
|
|||||||
@ -263,8 +263,6 @@ public class ServerAttackTree implements BehaviorTree {
|
|||||||
@Override
|
@Override
|
||||||
public void simulate(float deltaTime){
|
public void simulate(float deltaTime){
|
||||||
frameCurrent = frameCurrent + (float)Globals.timekeeper.getDeltaFrames();
|
frameCurrent = frameCurrent + (float)Globals.timekeeper.getDeltaFrames();
|
||||||
float velocity = CreatureUtils.getVelocity(parent);
|
|
||||||
Vector3d position = EntityUtils.getPosition(parent);
|
|
||||||
Vector3d movementVector = CreatureUtils.getFacingVector(parent);
|
Vector3d movementVector = CreatureUtils.getFacingVector(parent);
|
||||||
|
|
||||||
//parse attached network messages
|
//parse attached network messages
|
||||||
@ -314,20 +312,6 @@ public class ServerAttackTree implements BehaviorTree {
|
|||||||
ServerRotatorTree.getServerRotatorTree(parent).setActive(true);
|
ServerRotatorTree.getServerRotatorTree(parent).setActive(true);
|
||||||
}
|
}
|
||||||
this.stateTransitionUtil.simulate(AttackTreeState.WINDUP);
|
this.stateTransitionUtil.simulate(AttackTreeState.WINDUP);
|
||||||
Globals.server.broadcastMessage(
|
|
||||||
EntityMessage.constructattackUpdateMessage(
|
|
||||||
parent.getId(),
|
|
||||||
System.currentTimeMillis(),
|
|
||||||
(float)position.x,
|
|
||||||
(float)position.y,
|
|
||||||
(float)position.z,
|
|
||||||
movementVector.x,
|
|
||||||
movementVector.y,
|
|
||||||
movementVector.z,
|
|
||||||
velocity,
|
|
||||||
0
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} break;
|
} break;
|
||||||
case HOLD: {
|
case HOLD: {
|
||||||
this.stateTransitionUtil.simulate(AttackTreeState.HOLD);
|
this.stateTransitionUtil.simulate(AttackTreeState.HOLD);
|
||||||
@ -380,20 +364,6 @@ public class ServerAttackTree implements BehaviorTree {
|
|||||||
ProjectileUtils.serverSpawnBasicProjectile(parentRealm, projectileToFire, spawnPosition, arrowRotation, 750, initialVector, 0.03f);
|
ProjectileUtils.serverSpawnBasicProjectile(parentRealm, projectileToFire, spawnPosition, arrowRotation, 750, initialVector, 0.03f);
|
||||||
projectileToFire = null;
|
projectileToFire = null;
|
||||||
}
|
}
|
||||||
Globals.server.broadcastMessage(
|
|
||||||
EntityMessage.constructattackUpdateMessage(
|
|
||||||
parent.getId(),
|
|
||||||
System.currentTimeMillis(),
|
|
||||||
(float)position.x,
|
|
||||||
(float)position.y,
|
|
||||||
(float)position.z,
|
|
||||||
movementVector.x,
|
|
||||||
movementVector.y,
|
|
||||||
movementVector.z,
|
|
||||||
velocity,
|
|
||||||
1
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} break;
|
} break;
|
||||||
case COOLDOWN: {
|
case COOLDOWN: {
|
||||||
this.stateTransitionUtil.simulate(AttackTreeState.COOLDOWN);
|
this.stateTransitionUtil.simulate(AttackTreeState.COOLDOWN);
|
||||||
@ -413,20 +383,6 @@ public class ServerAttackTree implements BehaviorTree {
|
|||||||
ServerRotatorTree.getServerRotatorTree(parent).setActive(false);
|
ServerRotatorTree.getServerRotatorTree(parent).setActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Globals.server.broadcastMessage(
|
|
||||||
EntityMessage.constructattackUpdateMessage(
|
|
||||||
parent.getId(),
|
|
||||||
System.currentTimeMillis(),
|
|
||||||
(float)position.x,
|
|
||||||
(float)position.y,
|
|
||||||
(float)position.z,
|
|
||||||
movementVector.x,
|
|
||||||
movementVector.y,
|
|
||||||
movementVector.z,
|
|
||||||
velocity,
|
|
||||||
2
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} break;
|
} break;
|
||||||
case IDLE: {
|
case IDLE: {
|
||||||
currentMove = null;
|
currentMove = null;
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import electrosphere.engine.Globals;
|
|||||||
import electrosphere.entity.ClientEntityUtils;
|
import electrosphere.entity.ClientEntityUtils;
|
||||||
import electrosphere.entity.Entity;
|
import electrosphere.entity.Entity;
|
||||||
import electrosphere.entity.EntityUtils;
|
import electrosphere.entity.EntityUtils;
|
||||||
import electrosphere.entity.state.attack.ClientAttackTree;
|
|
||||||
import electrosphere.entity.state.equip.ClientEquipState;
|
import electrosphere.entity.state.equip.ClientEquipState;
|
||||||
import electrosphere.entity.state.inventory.InventoryUtils;
|
import electrosphere.entity.state.inventory.InventoryUtils;
|
||||||
import electrosphere.entity.state.physicssync.ClientPhysicsSyncTree;
|
import electrosphere.entity.state.physicssync.ClientPhysicsSyncTree;
|
||||||
@ -179,7 +178,7 @@ public class EntityProtocol implements ClientProtocolTemplate<EntityMessage> {
|
|||||||
CreatureUtils.clientAttachEntityMessageToMovementTree(Globals.clientSceneWrapper.getEntityFromServerId(message.getentityID()),message);
|
CreatureUtils.clientAttachEntityMessageToMovementTree(Globals.clientSceneWrapper.getEntityFromServerId(message.getentityID()),message);
|
||||||
} break;
|
} break;
|
||||||
case ATTACKUPDATE: {
|
case ATTACKUPDATE: {
|
||||||
ClientAttackTree.getClientAttackTree(Globals.clientSceneWrapper.getEntityFromServerId(message.getentityID())).addNetworkMessage(message);
|
LoggerInterface.loggerNetworking.WARNING("Received deprecated attack update message!");
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case SYNCPHYSICS: {
|
case SYNCPHYSICS: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user