attack bugfixes
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2024-08-16 15:55:21 -04:00
parent 51e028d9bb
commit 1314ceac06
6 changed files with 5 additions and 101 deletions

View File

@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
#Fri Aug 16 15:43:29 EDT 2024
buildNumber=252
#Fri Aug 16 15:53:57 EDT 2024
buildNumber=253

View File

@ -22,8 +22,6 @@
Fix physics freakout for vertically aligned entities
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 AI tracking deleted entity
Fix AI components not resetting on turning off ai manager

View File

@ -592,6 +592,8 @@ Launcher fixes
Fix inventory control state suggestions not working correctly
Fix unequipping item hard crashing engine
Fix terrain editing hard crashing engine
Fix attack animation mayyybe caching on non-local clients ??
Fix sword double-swing
# TODO

View File

@ -4,7 +4,6 @@ package electrosphere.entity.state.attack;
import electrosphere.engine.Globals;
import electrosphere.entity.Entity;
import electrosphere.entity.EntityDataStrings;
import electrosphere.entity.EntityUtils;
import electrosphere.entity.btree.BehaviorTree;
import electrosphere.entity.btree.StateTransitionUtil;
import electrosphere.entity.btree.StateTransitionUtil.StateTransitionUtilItem;
@ -27,7 +26,6 @@ import electrosphere.net.synchronization.annotation.SynchronizedBehaviorTree;
import electrosphere.net.synchronization.enums.BehaviorTreeIdEnums;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.joml.Vector3d;
@ -69,9 +67,6 @@ public class ClientAttackTree implements BehaviorTree {
//the parent entity of this attack tree
Entity parent;
//the queue of network messages to process
CopyOnWriteArrayList<EntityMessage> networkMessageQueue = new CopyOnWriteArrayList<EntityMessage>();
//the last time this tree was updated by server
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
switch(driftState){
case DRIFT:
@ -393,10 +346,6 @@ public class ClientAttackTree implements BehaviorTree {
}
}
public void addNetworkMessage(EntityMessage networkMessage) {
networkMessageQueue.add(networkMessage);
}
/**
* Gets the current attack type
* @return The current attack type

View File

@ -263,8 +263,6 @@ public class ServerAttackTree implements BehaviorTree {
@Override
public void simulate(float deltaTime){
frameCurrent = frameCurrent + (float)Globals.timekeeper.getDeltaFrames();
float velocity = CreatureUtils.getVelocity(parent);
Vector3d position = EntityUtils.getPosition(parent);
Vector3d movementVector = CreatureUtils.getFacingVector(parent);
//parse attached network messages
@ -314,20 +312,6 @@ public class ServerAttackTree implements BehaviorTree {
ServerRotatorTree.getServerRotatorTree(parent).setActive(true);
}
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;
case 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);
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;
case COOLDOWN: {
this.stateTransitionUtil.simulate(AttackTreeState.COOLDOWN);
@ -413,20 +383,6 @@ public class ServerAttackTree implements BehaviorTree {
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;
case IDLE: {
currentMove = null;

View File

@ -10,7 +10,6 @@ import electrosphere.engine.Globals;
import electrosphere.entity.ClientEntityUtils;
import electrosphere.entity.Entity;
import electrosphere.entity.EntityUtils;
import electrosphere.entity.state.attack.ClientAttackTree;
import electrosphere.entity.state.equip.ClientEquipState;
import electrosphere.entity.state.inventory.InventoryUtils;
import electrosphere.entity.state.physicssync.ClientPhysicsSyncTree;
@ -179,7 +178,7 @@ public class EntityProtocol implements ClientProtocolTemplate<EntityMessage> {
CreatureUtils.clientAttachEntityMessageToMovementTree(Globals.clientSceneWrapper.getEntityFromServerId(message.getentityID()),message);
} break;
case ATTACKUPDATE: {
ClientAttackTree.getClientAttackTree(Globals.clientSceneWrapper.getEntityFromServerId(message.getentityID())).addNetworkMessage(message);
LoggerInterface.loggerNetworking.WARNING("Received deprecated attack update message!");
} break;
case SYNCPHYSICS: {