Work towards simplifying netcode for btrees

This commit is contained in:
austin 2023-04-22 19:20:32 -04:00
parent 2fd8e77a2a
commit ec9203b8d2
8 changed files with 515 additions and 23 deletions

View File

@ -84,6 +84,30 @@
{
"name" : "targetID",
"type" : "FIXED_INT"
},
{
"name" : "bTreeID",
"type" : "FIXED_INT"
},
{
"name" : "propertyID",
"type" : "FIXED_INT"
},
{
"name" : "propertyValueInt",
"type" : "FIXED_INT"
},
{
"name" : "propertyValueFloat",
"type" : "FIXED_FLOAT"
},
{
"name" : "propertyValueDouble",
"type" : "FIXED_DOUBLE"
},
{
"name" : "propertyValueString",
"type" : "VAR_STRING"
}
],
"messageTypes" : [
@ -210,6 +234,56 @@
"propertyValue"
]
},
{
"messageName": "setBTreePropertyInt",
"data" : [
"entityID",
"time",
"bTreeID",
"propertyID",
"propertyValueInt"
]
},
{
"messageName": "setBTreePropertyFloat",
"data" : [
"entityID",
"time",
"bTreeID",
"propertyID",
"propertyValueFloat"
]
},
{
"messageName": "setBTreePropertyDouble",
"data" : [
"entityID",
"time",
"bTreeID",
"propertyID",
"propertyValueDouble"
]
},
{
"messageName": "setBTreePropertyString",
"data" : [
"entityID",
"time",
"bTreeID",
"propertyID",
"propertyValueString"
]
},
{
"messageName": "setBTreePropertyEnum",
"data" : [
"entityID",
"time",
"bTreeID",
"propertyID",
"propertyValueInt"
]
},
{
"messageName" : "attachEntityToEntity",
"data" : [

View File

@ -15,60 +15,61 @@ import electrosphere.renderer.actor.Actor;
import electrosphere.renderer.anim.Animation;
import java.util.concurrent.CopyOnWriteArrayList;
import org.joml.Vector3d;
import org.joml.Vector3f;
@BehaviorTreeAnnotation(name="idle")
public class IdleTree {
public static enum IdleTreeState {
IDLE,
NOT_IDLE,
}
@SyncedField(isEnum = true)
IdleTreeState state;
Entity parent;
CopyOnWriteArrayList<EntityMessage> networkMessageQueue = new CopyOnWriteArrayList<EntityMessage>();
int frameCurrent;
int maxFrame = 60;
public IdleTree(Entity e){
state = IdleTreeState.IDLE;
parent = e;
}
public IdleTreeState getState(){
return state;
}
return state;
}
public void start(){
//TODO: check if can start moving
state = IdleTreeState.IDLE;
frameCurrent = 0;
}
public void interrupt(){
state = IdleTreeState.NOT_IDLE;
}
public void stop(){
state = IdleTreeState.NOT_IDLE;
}
public void simulate(float deltaTime){
Actor entityActor = EntityUtils.getActor(parent);
boolean movementTreeIsIdle = movementTreeIsIdle();
boolean hasAttackTree = parent.containsKey(EntityDataStrings.ATTACK_TREE);
AttackTree attackTree = null;
if(hasAttackTree){
attackTree = CreatureUtils.getAttackTree(parent);
}
//parse attached network messages
for(EntityMessage message : networkMessageQueue){
networkMessageQueue.remove(message);
@ -102,16 +103,17 @@ public class IdleTree {
break;
}
}
boolean isIdle;
//state machine
switch(state){
case IDLE:
if(entityActor != null){
if(
(!entityActor.isPlayingAnimation() || !entityActor.isPlayingAnimation(Animation.ANIMATION_IDLE_1)) &&
(Globals.assetManager.fetchModel(entityActor.getModelPath()) != null && Globals.assetManager.fetchModel(entityActor.getModelPath()).getAnimation(Animation.ANIMATION_IDLE_1) != null)
(Globals.assetManager.fetchModel(entityActor.getModelPath()) != null && Globals.assetManager.fetchModel(entityActor.getModelPath()).getAnimation(Animation.ANIMATION_IDLE_1) != null)
){
entityActor.playAnimation(Animation.ANIMATION_IDLE_1,3);
entityActor.incrementAnimationTime(0.0001);
@ -166,5 +168,5 @@ public class IdleTree {
public void addNetworkMessage(EntityMessage networkMessage) {
networkMessageQueue.add(networkMessage);
}
}

View File

@ -0,0 +1,14 @@
package electrosphere.entity.state;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface SyncedField {
boolean isEnum() default false;
}

View File

@ -1,5 +1,6 @@
package electrosphere.entity.state.movement;
import electrosphere.engine.Main;
import electrosphere.entity.Entity;
import electrosphere.entity.state.BehaviorTree;
import electrosphere.entity.state.movement.GroundMovementTree.MovementTreeState;

View File

@ -19,6 +19,11 @@ public class EntityMessage extends NetworkMessage {
DESTROY,
SETBEHAVIORTREE,
SETPROPERTY,
SETBTREEPROPERTYINT,
SETBTREEPROPERTYFLOAT,
SETBTREEPROPERTYDOUBLE,
SETBTREEPROPERTYSTRING,
SETBTREEPROPERTYENUM,
ATTACHENTITYTOENTITY,
}
@ -43,6 +48,12 @@ public class EntityMessage extends NetworkMessage {
long time;
String bone;
int targetID;
int bTreeID;
int propertyID;
int propertyValueInt;
float propertyValueFloat;
double propertyValueDouble;
String propertyValueString;
EntityMessage(EntityMessageType messageType){
this.type = MessageType.ENTITY_MESSAGE;
@ -213,6 +224,54 @@ public class EntityMessage extends NetworkMessage {
this.targetID = targetID;
}
public int getbTreeID() {
return bTreeID;
}
public void setbTreeID(int bTreeID) {
this.bTreeID = bTreeID;
}
public int getpropertyID() {
return propertyID;
}
public void setpropertyID(int propertyID) {
this.propertyID = propertyID;
}
public int getpropertyValueInt() {
return propertyValueInt;
}
public void setpropertyValueInt(int propertyValueInt) {
this.propertyValueInt = propertyValueInt;
}
public float getpropertyValueFloat() {
return propertyValueFloat;
}
public void setpropertyValueFloat(float propertyValueFloat) {
this.propertyValueFloat = propertyValueFloat;
}
public double getpropertyValueDouble() {
return propertyValueDouble;
}
public void setpropertyValueDouble(double propertyValueDouble) {
this.propertyValueDouble = propertyValueDouble;
}
public String getpropertyValueString() {
return propertyValueString;
}
public void setpropertyValueString(String propertyValueString) {
this.propertyValueString = propertyValueString;
}
static void stripPacketHeader(List<Byte> byteStream){
byteStream.remove(0);
byteStream.remove(0);
@ -280,6 +339,32 @@ public class EntityMessage extends NetworkMessage {
} else {
return false;
}
case TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYINT:
if(byteStream.size() >= TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYINT_SIZE){
return true;
} else {
return false;
}
case TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYFLOAT:
if(byteStream.size() >= TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYFLOAT_SIZE){
return true;
} else {
return false;
}
case TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYDOUBLE:
if(byteStream.size() >= TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYDOUBLE_SIZE){
return true;
} else {
return false;
}
case TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYSTRING:
return EntityMessage.canParsesetBTreePropertyStringMessage(byteStream);
case TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYENUM:
if(byteStream.size() >= TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYENUM_SIZE){
return true;
} else {
return false;
}
case TypeBytes.ENTITY_MESSAGE_TYPE_ATTACHENTITYTOENTITY:
return EntityMessage.canParseattachEntityToEntityMessage(byteStream);
}
@ -652,6 +737,147 @@ public class EntityMessage extends NetworkMessage {
return rVal;
}
public static EntityMessage parsesetBTreePropertyIntMessage(List<Byte> byteStream){
EntityMessage rVal = new EntityMessage(EntityMessageType.SETBTREEPROPERTYINT);
stripPacketHeader(byteStream);
rVal.setentityID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.settime(ByteStreamUtils.popLongFromByteQueue(byteStream));
rVal.setbTreeID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.setpropertyID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.setpropertyValueInt(ByteStreamUtils.popIntFromByteQueue(byteStream));
return rVal;
}
public static EntityMessage constructsetBTreePropertyIntMessage(int entityID,long time,int bTreeID,int propertyID,int propertyValueInt){
EntityMessage rVal = new EntityMessage(EntityMessageType.SETBTREEPROPERTYINT);
rVal.setentityID(entityID);
rVal.settime(time);
rVal.setbTreeID(bTreeID);
rVal.setpropertyID(propertyID);
rVal.setpropertyValueInt(propertyValueInt);
rVal.serialize();
return rVal;
}
public static EntityMessage parsesetBTreePropertyFloatMessage(List<Byte> byteStream){
EntityMessage rVal = new EntityMessage(EntityMessageType.SETBTREEPROPERTYFLOAT);
stripPacketHeader(byteStream);
rVal.setentityID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.settime(ByteStreamUtils.popLongFromByteQueue(byteStream));
rVal.setbTreeID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.setpropertyID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.setpropertyValueFloat(ByteStreamUtils.popFloatFromByteQueue(byteStream));
return rVal;
}
public static EntityMessage constructsetBTreePropertyFloatMessage(int entityID,long time,int bTreeID,int propertyID,float propertyValueFloat){
EntityMessage rVal = new EntityMessage(EntityMessageType.SETBTREEPROPERTYFLOAT);
rVal.setentityID(entityID);
rVal.settime(time);
rVal.setbTreeID(bTreeID);
rVal.setpropertyID(propertyID);
rVal.setpropertyValueFloat(propertyValueFloat);
rVal.serialize();
return rVal;
}
public static EntityMessage parsesetBTreePropertyDoubleMessage(List<Byte> byteStream){
EntityMessage rVal = new EntityMessage(EntityMessageType.SETBTREEPROPERTYDOUBLE);
stripPacketHeader(byteStream);
rVal.setentityID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.settime(ByteStreamUtils.popLongFromByteQueue(byteStream));
rVal.setbTreeID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.setpropertyID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.setpropertyValueDouble(ByteStreamUtils.popDoubleFromByteQueue(byteStream));
return rVal;
}
public static EntityMessage constructsetBTreePropertyDoubleMessage(int entityID,long time,int bTreeID,int propertyID,double propertyValueDouble){
EntityMessage rVal = new EntityMessage(EntityMessageType.SETBTREEPROPERTYDOUBLE);
rVal.setentityID(entityID);
rVal.settime(time);
rVal.setbTreeID(bTreeID);
rVal.setpropertyID(propertyID);
rVal.setpropertyValueDouble(propertyValueDouble);
rVal.serialize();
return rVal;
}
public static boolean canParsesetBTreePropertyStringMessage(List<Byte> byteStream){
int currentStreamLength = byteStream.size();
List<Byte> temporaryByteQueue = new LinkedList();
if(currentStreamLength < 6){
return false;
}
if(currentStreamLength < 14){
return false;
}
if(currentStreamLength < 18){
return false;
}
if(currentStreamLength < 22){
return false;
}
int propertyValueStringSize = 0;
if(currentStreamLength < 26){
return false;
} else {
temporaryByteQueue.add(byteStream.get(22 + 0));
temporaryByteQueue.add(byteStream.get(22 + 1));
temporaryByteQueue.add(byteStream.get(22 + 2));
temporaryByteQueue.add(byteStream.get(22 + 3));
propertyValueStringSize = ByteStreamUtils.popIntFromByteQueue(temporaryByteQueue);
}
if(currentStreamLength < 26 + propertyValueStringSize){
return false;
}
return true;
}
public static EntityMessage parsesetBTreePropertyStringMessage(List<Byte> byteStream){
EntityMessage rVal = new EntityMessage(EntityMessageType.SETBTREEPROPERTYSTRING);
stripPacketHeader(byteStream);
rVal.setentityID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.settime(ByteStreamUtils.popLongFromByteQueue(byteStream));
rVal.setbTreeID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.setpropertyID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.setpropertyValueString(ByteStreamUtils.popStringFromByteQueue(byteStream));
return rVal;
}
public static EntityMessage constructsetBTreePropertyStringMessage(int entityID,long time,int bTreeID,int propertyID,String propertyValueString){
EntityMessage rVal = new EntityMessage(EntityMessageType.SETBTREEPROPERTYSTRING);
rVal.setentityID(entityID);
rVal.settime(time);
rVal.setbTreeID(bTreeID);
rVal.setpropertyID(propertyID);
rVal.setpropertyValueString(propertyValueString);
rVal.serialize();
return rVal;
}
public static EntityMessage parsesetBTreePropertyEnumMessage(List<Byte> byteStream){
EntityMessage rVal = new EntityMessage(EntityMessageType.SETBTREEPROPERTYENUM);
stripPacketHeader(byteStream);
rVal.setentityID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.settime(ByteStreamUtils.popLongFromByteQueue(byteStream));
rVal.setbTreeID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.setpropertyID(ByteStreamUtils.popIntFromByteQueue(byteStream));
rVal.setpropertyValueInt(ByteStreamUtils.popIntFromByteQueue(byteStream));
return rVal;
}
public static EntityMessage constructsetBTreePropertyEnumMessage(int entityID,long time,int bTreeID,int propertyID,int propertyValueInt){
EntityMessage rVal = new EntityMessage(EntityMessageType.SETBTREEPROPERTYENUM);
rVal.setentityID(entityID);
rVal.settime(time);
rVal.setbTreeID(bTreeID);
rVal.setpropertyID(propertyID);
rVal.setpropertyValueInt(propertyValueInt);
rVal.serialize();
return rVal;
}
public static boolean canParseattachEntityToEntityMessage(List<Byte> byteStream){
int currentStreamLength = byteStream.size();
List<Byte> temporaryByteQueue = new LinkedList();
@ -1048,6 +1274,144 @@ public class EntityMessage extends NetworkMessage {
rawBytes[18+i] = intValues[i];
}
break;
case SETBTREEPROPERTYINT:
rawBytes = new byte[2+4+8+4+4+4];
//message header
rawBytes[0] = TypeBytes.MESSAGE_TYPE_ENTITY;
//entity messaage header
rawBytes[1] = TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYINT;
intValues = ByteStreamUtils.serializeIntToBytes(entityID);
for(int i = 0; i < 4; i++){
rawBytes[2+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeLongToBytes(time);
for(int i = 0; i < 8; i++){
rawBytes[6+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeIntToBytes(bTreeID);
for(int i = 0; i < 4; i++){
rawBytes[14+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeIntToBytes(propertyID);
for(int i = 0; i < 4; i++){
rawBytes[18+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeIntToBytes(propertyValueInt);
for(int i = 0; i < 4; i++){
rawBytes[22+i] = intValues[i];
}
break;
case SETBTREEPROPERTYFLOAT:
rawBytes = new byte[2+4+8+4+4+4];
//message header
rawBytes[0] = TypeBytes.MESSAGE_TYPE_ENTITY;
//entity messaage header
rawBytes[1] = TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYFLOAT;
intValues = ByteStreamUtils.serializeIntToBytes(entityID);
for(int i = 0; i < 4; i++){
rawBytes[2+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeLongToBytes(time);
for(int i = 0; i < 8; i++){
rawBytes[6+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeIntToBytes(bTreeID);
for(int i = 0; i < 4; i++){
rawBytes[14+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeIntToBytes(propertyID);
for(int i = 0; i < 4; i++){
rawBytes[18+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeFloatToBytes(propertyValueFloat);
for(int i = 0; i < 4; i++){
rawBytes[22+i] = intValues[i];
} break;
case SETBTREEPROPERTYDOUBLE:
rawBytes = new byte[2+4+8+4+4+8];
//message header
rawBytes[0] = TypeBytes.MESSAGE_TYPE_ENTITY;
//entity messaage header
rawBytes[1] = TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYDOUBLE;
intValues = ByteStreamUtils.serializeIntToBytes(entityID);
for(int i = 0; i < 4; i++){
rawBytes[2+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeLongToBytes(time);
for(int i = 0; i < 8; i++){
rawBytes[6+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeIntToBytes(bTreeID);
for(int i = 0; i < 4; i++){
rawBytes[14+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeIntToBytes(propertyID);
for(int i = 0; i < 4; i++){
rawBytes[18+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeDoubleToBytes(propertyValueDouble);
for(int i = 0; i < 8; i++){
rawBytes[22+i] = intValues[i];
}
break;
case SETBTREEPROPERTYSTRING:
rawBytes = new byte[2+4+8+4+4+4+propertyValueString.length()];
//message header
rawBytes[0] = TypeBytes.MESSAGE_TYPE_ENTITY;
//entity messaage header
rawBytes[1] = TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYSTRING;
intValues = ByteStreamUtils.serializeIntToBytes(entityID);
for(int i = 0; i < 4; i++){
rawBytes[2+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeLongToBytes(time);
for(int i = 0; i < 8; i++){
rawBytes[6+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeIntToBytes(bTreeID);
for(int i = 0; i < 4; i++){
rawBytes[14+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeIntToBytes(propertyID);
for(int i = 0; i < 4; i++){
rawBytes[18+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeIntToBytes(propertyValueString.length());
for(int i = 0; i < 4; i++){
rawBytes[22+i] = intValues[i];
}
stringBytes = propertyValueString.getBytes();
for(int i = 0; i < propertyValueString.length(); i++){
rawBytes[26+i] = stringBytes[i];
}
break;
case SETBTREEPROPERTYENUM:
rawBytes = new byte[2+4+8+4+4+4];
//message header
rawBytes[0] = TypeBytes.MESSAGE_TYPE_ENTITY;
//entity messaage header
rawBytes[1] = TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYENUM;
intValues = ByteStreamUtils.serializeIntToBytes(entityID);
for(int i = 0; i < 4; i++){
rawBytes[2+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeLongToBytes(time);
for(int i = 0; i < 8; i++){
rawBytes[6+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeIntToBytes(bTreeID);
for(int i = 0; i < 4; i++){
rawBytes[14+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeIntToBytes(propertyID);
for(int i = 0; i < 4; i++){
rawBytes[18+i] = intValues[i];
}
intValues = ByteStreamUtils.serializeIntToBytes(propertyValueInt);
for(int i = 0; i < 4; i++){
rawBytes[22+i] = intValues[i];
}
break;
case ATTACHENTITYTOENTITY:
rawBytes = new byte[2+4+4+bone.length()+4];
//message header

View File

@ -98,6 +98,31 @@ INVENTORY_MESSAGE,
rVal = EntityMessage.parsesetPropertyMessage(byteStream);
}
break;
case TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYINT:
if(EntityMessage.canParseMessage(byteStream,secondByte)){
rVal = EntityMessage.parsesetBTreePropertyIntMessage(byteStream);
}
break;
case TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYFLOAT:
if(EntityMessage.canParseMessage(byteStream,secondByte)){
rVal = EntityMessage.parsesetBTreePropertyFloatMessage(byteStream);
}
break;
case TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYDOUBLE:
if(EntityMessage.canParseMessage(byteStream,secondByte)){
rVal = EntityMessage.parsesetBTreePropertyDoubleMessage(byteStream);
}
break;
case TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYSTRING:
if(EntityMessage.canParseMessage(byteStream,secondByte)){
rVal = EntityMessage.parsesetBTreePropertyStringMessage(byteStream);
}
break;
case TypeBytes.ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYENUM:
if(EntityMessage.canParseMessage(byteStream,secondByte)){
rVal = EntityMessage.parsesetBTreePropertyEnumMessage(byteStream);
}
break;
case TypeBytes.ENTITY_MESSAGE_TYPE_ATTACHENTITYTOENTITY:
if(EntityMessage.canParseMessage(byteStream,secondByte)){
rVal = EntityMessage.parseattachEntityToEntityMessage(byteStream);

View File

@ -28,7 +28,12 @@ Message categories
public static final byte ENTITY_MESSAGE_TYPE_DESTROY = 9;
public static final byte ENTITY_MESSAGE_TYPE_SETBEHAVIORTREE = 10;
public static final byte ENTITY_MESSAGE_TYPE_SETPROPERTY = 11;
public static final byte ENTITY_MESSAGE_TYPE_ATTACHENTITYTOENTITY = 12;
public static final byte ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYINT = 12;
public static final byte ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYFLOAT = 13;
public static final byte ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYDOUBLE = 14;
public static final byte ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYSTRING = 15;
public static final byte ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYENUM = 16;
public static final byte ENTITY_MESSAGE_TYPE_ATTACHENTITYTOENTITY = 17;
/*
Entity packet sizes
*/
@ -41,6 +46,10 @@ Message categories
public static final byte ENTITY_MESSAGE_TYPE_DESTROY_SIZE = 6;
public static final byte ENTITY_MESSAGE_TYPE_SETBEHAVIORTREE_SIZE = 22;
public static final byte ENTITY_MESSAGE_TYPE_SETPROPERTY_SIZE = 22;
public static final byte ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYINT_SIZE = 26;
public static final byte ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYFLOAT_SIZE = 26;
public static final byte ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYDOUBLE_SIZE = 30;
public static final byte ENTITY_MESSAGE_TYPE_SETBTREEPROPERTYENUM_SIZE = 26;
/*
Lore subcategories
*/

View File

@ -7,6 +7,7 @@ import electrosphere.entity.Entity;
import electrosphere.entity.EntityDataStrings;
import electrosphere.entity.EntityTags;
import electrosphere.entity.EntityUtils;
import electrosphere.entity.scene.EntityDescriptor;
import electrosphere.entity.state.BehaviorTree;
import electrosphere.entity.state.IdleTree;
import electrosphere.entity.state.movement.GroundMovementTree;
@ -22,8 +23,10 @@ import electrosphere.entity.state.life.LifeUtils;
import electrosphere.entity.state.movement.SprintTree;
import electrosphere.entity.types.particle.ParticleUtils;
import electrosphere.game.client.targeting.crosshair.Crosshair;
import electrosphere.net.parser.net.message.EntityMessage;
import electrosphere.renderer.actor.Actor;
import java.sql.Time;
import org.joml.Vector3d;
import org.joml.Vector3f;