enable ai for low-lod entities
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-05-30 22:15:44 -04:00
parent 414707f6d5
commit 4a17a757ed
3 changed files with 10 additions and 15 deletions

View File

@ -2087,6 +2087,7 @@ Standardize data sourcing in MacroTemporalData
Macro pathfinding scaffolding Macro pathfinding scaffolding
Macro pathfinding work Macro pathfinding work
Actual macro pathfinding implementation Actual macro pathfinding implementation
Enable AI for low-lod entities

View File

@ -8,7 +8,6 @@ import electrosphere.data.entity.creature.ai.BlockerTreeData;
import electrosphere.data.entity.creature.ai.StandardCharacterTreeData; import electrosphere.data.entity.creature.ai.StandardCharacterTreeData;
import electrosphere.entity.Entity; import electrosphere.entity.Entity;
import electrosphere.entity.EntityDataStrings; import electrosphere.entity.EntityDataStrings;
import electrosphere.entity.state.lod.ServerLODComponent;
import electrosphere.entity.state.movement.groundmove.ServerGroundMovementTree; import electrosphere.entity.state.movement.groundmove.ServerGroundMovementTree;
import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.creature.CreatureUtils;
import electrosphere.logger.LoggerInterface; import electrosphere.logger.LoggerInterface;
@ -141,11 +140,6 @@ public class AI {
* @return true if should simulate, false otherwise * @return true if should simulate, false otherwise
*/ */
public boolean shouldExecute(){ public boolean shouldExecute(){
if(ServerLODComponent.hasServerLODComponent(this.parent)){
if(ServerLODComponent.getServerLODComponent(this.parent).getLodLevel() == ServerLODComponent.LOW_RES){
return false;
}
}
return this.applyToPlayer || !CreatureUtils.hasControllerPlayerId(this.parent); return this.applyToPlayer || !CreatureUtils.hasControllerPlayerId(this.parent);
} }

View File

@ -24,47 +24,47 @@ public class AIManager {
/** /**
* Lock for thread-safeing the manager * Lock for thread-safeing the manager
*/ */
ReentrantLock lock = new ReentrantLock(); private ReentrantLock lock = new ReentrantLock();
/** /**
* The list of ais * The list of ais
*/ */
List<AI> aiList = new LinkedList<AI>(); private List<AI> aiList = new LinkedList<AI>();
/** /**
* The map of ai to associated entity * The map of ai to associated entity
*/ */
Map<AI,Entity> aiEntityMap = new HashMap<AI,Entity>(); private Map<AI,Entity> aiEntityMap = new HashMap<AI,Entity>();
/** /**
* The map of entity to associated ai * The map of entity to associated ai
*/ */
Map<Entity,AI> entityAIMap = new HashMap<Entity,AI>(); private Map<Entity,AI> entityAIMap = new HashMap<Entity,AI>();
/** /**
* Controls whether the ai manager should simulate each frame or not * Controls whether the ai manager should simulate each frame or not
*/ */
boolean active = true; private boolean active = true;
/** /**
* The timer service * The timer service
*/ */
TimerService timerService = new TimerService(); private TimerService timerService = new TimerService();
/** /**
* The nearby entity service * The nearby entity service
*/ */
NearbyEntityService nearbyEntityService = new NearbyEntityService(); private NearbyEntityService nearbyEntityService = new NearbyEntityService();
/** /**
* Service for performing pathfinding * Service for performing pathfinding
*/ */
PathfindingService pathfindingService = new PathfindingService(); private PathfindingService pathfindingService = new PathfindingService();
/** /**
* The random of the ai * The random of the ai
*/ */
Random random = null; private Random random = null;
/** /**
* Constructor * Constructor