Compare commits

...

6 Commits

Author SHA1 Message Date
austin
b9f0eef20e fix katana idle animations
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
2024-10-21 10:40:58 -04:00
austin
496172680f fix movement audio service when no audio engine 2024-10-21 09:53:58 -04:00
austin
ef724d3832 fix inventory message for undefined id on client 2024-10-21 09:44:43 -04:00
austin
ad1f65aca6 null check 2024-10-20 17:06:47 -04:00
austin
35aec8affe fix virtual scrollable on higher resolutions 2024-10-20 16:25:30 -04:00
austin
1cb93b04f6 fix debug sp launcher 2024-10-20 12:01:50 -04:00
19 changed files with 78 additions and 60 deletions

View File

@ -2,8 +2,8 @@
"gameplayGenerateWorld" : false, "gameplayGenerateWorld" : false,
"gameplayPhysicsCellRadius" : 2, "gameplayPhysicsCellRadius" : 2,
"displayWidth" : 1920, "displayWidth" : 2560,
"displayHeight" : 1080, "displayHeight" : 1600,
"displayFullscreen" : false, "displayFullscreen" : false,
"graphicsFOV" : 100.0, "graphicsFOV" : 100.0,
@ -15,8 +15,8 @@
"graphicsPerformanceOIT" : true, "graphicsPerformanceOIT" : true,
"graphicsViewRange" : 20000.0, "graphicsViewRange" : 20000.0,
"renderResolutionX": 1920, "renderResolutionX": 2560,
"renderResolutionY": 1080, "renderResolutionY": 1600,
"graphicsDebugDrawCollisionSpheresClient" : false, "graphicsDebugDrawCollisionSpheresClient" : false,
"graphicsDebugDrawCollisionSpheresServer" : false, "graphicsDebugDrawCollisionSpheresServer" : false,

View File

@ -117,6 +117,7 @@
"model": { "model": {
"idleData": { "idleData": {
"animation": { "animation": {
"nameFirstPerson" : "Idle",
"nameThirdPerson" : "Idle", "nameThirdPerson" : "Idle",
"priorityCategory" : "IDLE" "priorityCategory" : "IDLE"
} }

View File

@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file #maven.buildNumber.plugin properties file
#Fri Sep 20 15:37:40 EDT 2024 #Mon Oct 21 09:58:24 EDT 2024
buildNumber=359 buildNumber=363

View File

@ -34,7 +34,6 @@
- Decoy (creates a decoy) - Decoy (creates a decoy)
- Torch - Torch
- Throwable potions - Throwable potions
Fix ui scaling on abnormal monitors
Crouching Crouching
Model clothing, hair for the human Model clothing, hair for the human
particles, light on sword collision particles, light on sword collision
@ -44,11 +43,13 @@
- Spawn player in a town with a quest to complete a nearby dungeon - Spawn player in a town with a quest to complete a nearby dungeon
+ bug fixes + bug fixes
Fix idle animations
Fix light cluster mapping for foliage shader Fix light cluster mapping for foliage shader
Fix foliage placement
Fix lights not being deleted Fix lights not being deleted
- Not sending a "light count" var to light calculations, so the data stays in buffer even though it is not being updated - Not sending a "light count" var to light calculations, so the data stays in buffer even though it is not being updated
Fix block tree preventing initiating an attack Fix block tree preventing initiating an attack
Fix equipping sword on toolbar
Fix return to title menu synchronization bug Fix return to title menu synchronization bug
Fix particles not spawning in correct positions
+ unreproducible bugs + unreproducible bugs

View File

@ -870,6 +870,20 @@ Camera offset definitions in entity files
Non-Lsystem pine tree Non-Lsystem pine tree
Potential fix for ground audio bug Potential fix for ground audio bug
(10/20/2024)
Fix SP debug launcher actually entering world
Fix virtual scrollable clipping logic
Fix ui scaling on abnormal monitors
- This is literally just a function of the settings file not being updated for different resolutions
Fix inventory null pointer check on virtualaudiomanager
(10/21/2024)
Fix inventory message for undefined id on client
Fix movement audio service when audio engine disabled
Fix idle animations (for katana)
# TODO # TODO

View File

@ -153,9 +153,11 @@ public class MovementAudioService {
* @param type The interaction type * @param type The interaction type
*/ */
public void playAudio(int voxelType, InteractionType type){ public void playAudio(int voxelType, InteractionType type){
String audioPath = this.getAudioPath(voxelType, type); if(Globals.RUN_AUDIO){
if(audioPath != null){ String audioPath = this.getAudioPath(voxelType, type);
Globals.virtualAudioSourceManager.createVirtualAudioSource(audioPath, VirtualAudioSourceType.CREATURE, false); if(audioPath != null){
Globals.virtualAudioSourceManager.createVirtualAudioSource(audioPath, VirtualAudioSourceType.CREATURE, false);
}
} }
} }
@ -166,9 +168,11 @@ public class MovementAudioService {
* @param position The position of the audio * @param position The position of the audio
*/ */
public void playAudioPositional(int voxelType, InteractionType type, Vector3d position){ public void playAudioPositional(int voxelType, InteractionType type, Vector3d position){
String audioPath = this.getAudioPath(voxelType, type); if(Globals.RUN_AUDIO){
if(audioPath != null){ String audioPath = this.getAudioPath(voxelType, type);
Globals.virtualAudioSourceManager.createVirtualAudioSource(audioPath, VirtualAudioSourceType.CREATURE, false, position); if(audioPath != null){
Globals.virtualAudioSourceManager.createVirtualAudioSource(audioPath, VirtualAudioSourceType.CREATURE, false, position);
}
} }
} }

View File

@ -161,7 +161,7 @@ public class Globals {
public static boolean RUN_DEMO = false; public static boolean RUN_DEMO = false;
public static boolean RUN_CLIENT = true; public static boolean RUN_CLIENT = true;
public static boolean RUN_HIDDEN = false; //glfw session will be created with hidden window public static boolean RUN_HIDDEN = false; //glfw session will be created with hidden window
public static boolean RUN_AUDIO = true; public static boolean RUN_AUDIO = false;
public static boolean RUN_SCRIPTS = true; public static boolean RUN_SCRIPTS = true;
public static int clientCharacterID; public static int clientCharacterID;
public static NetConfig netConfig = null; public static NetConfig netConfig = null;

View File

@ -192,10 +192,10 @@ public class LoadingUtils {
} }
static void initMacroSimulation(){ static void initMacroSimulation(){
Globals.macroData = MacroData.generateWorld(0); // Globals.macroData = MacroData.generateWorld(0);
// Globals.macroData.describeWorld(); // Globals.macroData.describeWorld();
Globals.macroSimulation = new MacroSimulation(); // Globals.macroSimulation = new MacroSimulation();
Globals.macroSimulation.simulate(); // Globals.macroSimulation.simulate();
// Town startTown = Globals.macroData.getTowns().get(0); // Town startTown = Globals.macroData.getTowns().get(0);
// Vector2i firstPos = startTown.getPositions().get(0); // Vector2i firstPos = startTown.getPositions().get(0);
// double startX = firstPos.x * Globals.serverTerrainManager.getChunkWidth(); // double startX = firstPos.x * Globals.serverTerrainManager.getChunkWidth();

View File

@ -1,12 +1,6 @@
package electrosphere.entity.scene; package electrosphere.entity.scene;
import electrosphere.game.server.world.ServerWorldData;
import electrosphere.server.datacell.GriddedDataCellManager; import electrosphere.server.datacell.GriddedDataCellManager;
import electrosphere.server.fluid.generation.DefaultFluidGenerator;
import electrosphere.server.fluid.manager.ServerFluidManager;
import electrosphere.server.terrain.generation.OverworldChunkGenerator;
import electrosphere.server.terrain.manager.ServerTerrainManager;
import electrosphere.util.FileUtils;
/** /**
* Generates scene files where appropriate (ie, if playing the procedurally generated level) * Generates scene files where appropriate (ie, if playing the procedurally generated level)
@ -26,17 +20,6 @@ public class SceneGenerator {
file.realmDescriptor.griddedRealmSize = GriddedDataCellManager.MAX_GRID_SIZE; file.realmDescriptor.griddedRealmSize = GriddedDataCellManager.MAX_GRID_SIZE;
file.createSaveInstance = true; //won't have a predefined scene to load, so must create one in the save file.createSaveInstance = true; //won't have a predefined scene to load, so must create one in the save
file.loadAllCells = false; // do not load all cells on init file.loadAllCells = false; // do not load all cells on init
//create terrain
ServerWorldData serverWorldData = ServerWorldData.createGriddedRealmWorldData(2000);
ServerTerrainManager serverTerrainManager = new ServerTerrainManager(serverWorldData, 0, new OverworldChunkGenerator());
serverTerrainManager.generate();
serverTerrainManager.save(saveName);
//create world.json
FileUtils.serializeObjectToSavePath(saveName, "./world.json", serverWorldData);
//create mock fluid sim manager
ServerFluidManager serverFluidManager = new ServerFluidManager(serverWorldData, serverTerrainManager, 0, new DefaultFluidGenerator());
serverFluidManager.save(saveName);
return file; return file;
} }

View File

@ -78,8 +78,11 @@ public class SceneLoader {
} }
} break; } break;
case RealmDescriptor.REALM_DESCRIPTOR_PROCEDURAL: { case RealmDescriptor.REALM_DESCRIPTOR_PROCEDURAL: {
realm = Globals.realmManager.createRealm(); realm = Globals.realmManager.createGriddedRealm(serverWorldData,serverContentManager);
} break; } break;
default: {
throw new Error("Unhandled case! " + file.realmDescriptor.getType());
}
} }
//spawn initial entities //spawn initial entities
for(EntityDescriptor descriptor : file.getEntities()){ for(EntityDescriptor descriptor : file.getEntities()){

View File

@ -113,6 +113,7 @@ public class ClientParticleEmitterComponent implements BehaviorTree {
Globals.clientSceneWrapper.getScene().registerBehaviorTree(rVal); Globals.clientSceneWrapper.getScene().registerBehaviorTree(rVal);
return rVal; return rVal;
} }
/** /**
* <p> * <p>
* Detatches this tree from the entity. * Detatches this tree from the entity.
@ -122,6 +123,7 @@ public class ClientParticleEmitterComponent implements BehaviorTree {
*/ */
public static void detachTree(Entity entity, BehaviorTree tree){ public static void detachTree(Entity entity, BehaviorTree tree){
} }
/** /**
* <p> * <p>
* Gets the ClientEquipState of the entity * Gets the ClientEquipState of the entity
@ -132,4 +134,5 @@ public class ClientParticleEmitterComponent implements BehaviorTree {
public static ClientEquipState getClientEquipState(Entity entity){ public static ClientEquipState getClientEquipState(Entity entity){
return (ClientEquipState)entity.getData(EntityDataStrings.TREE_CLIENTPARTICLEEMITTERSTATE); return (ClientEquipState)entity.getData(EntityDataStrings.TREE_CLIENTPARTICLEEMITTERSTATE);
} }
} }

View File

@ -10,7 +10,6 @@ import electrosphere.entity.EntityDataStrings;
import electrosphere.entity.EntityUtils; import electrosphere.entity.EntityUtils;
import electrosphere.entity.btree.BehaviorTree; import electrosphere.entity.btree.BehaviorTree;
import electrosphere.entity.types.creature.CreatureUtils; import electrosphere.entity.types.creature.CreatureUtils;
import electrosphere.game.data.creature.type.CreatureData;
import electrosphere.game.data.creature.type.IdleData; import electrosphere.game.data.creature.type.IdleData;
import electrosphere.net.synchronization.annotation.SyncedField; import electrosphere.net.synchronization.annotation.SyncedField;
import electrosphere.net.synchronization.annotation.SynchronizableEnum; import electrosphere.net.synchronization.annotation.SynchronizableEnum;
@ -42,15 +41,12 @@ public class ClientIdleTree implements BehaviorTree {
* Creates an idle tree * Creates an idle tree
* @param e the entity to attach the tree to * @param e the entity to attach the tree to
*/ */
public ClientIdleTree(Entity e, Object ... params){ private ClientIdleTree(Entity e, Object ... params){
state = IdleTreeState.IDLE; state = IdleTreeState.IDLE;
parent = e; parent = e;
//check if this is a creature, if so add its idle data if(params.length > 0 && params[0] instanceof IdleData){
CreatureData creatureType = Globals.gameConfigCurrent.getCreatureTypeLoader().getType(CreatureUtils.getType(parent)); idleData = (IdleData)params[0];
if(creatureType != null){
idleData = creatureType.getGraphicsTemplate().getModel().getIdleData();
} }
//TODO: if object, check if object has idle data and add accordingly
} }
/** /**
@ -112,6 +108,8 @@ public class ClientIdleTree implements BehaviorTree {
rVal = true; rVal = true;
} }
} }
} else {
rVal = true;
} }
return rVal; return rVal;
} }

View File

@ -150,6 +150,8 @@ public class ServerIdleTree implements BehaviorTree {
rVal = true; rVal = true;
} }
} }
} else {
rVal = true;
} }
return rVal; return rVal;
} }

View File

@ -1,5 +1,7 @@
package electrosphere.entity.state.inventory; package electrosphere.entity.state.inventory;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import electrosphere.client.ui.menu.WindowUtils; import electrosphere.client.ui.menu.WindowUtils;
@ -35,6 +37,7 @@ public class ClientInventoryState implements BehaviorTree {
@Override @Override
public void simulate(float deltaTime) { public void simulate(float deltaTime) {
List<InventoryMessage> bouncedMessages = new LinkedList<InventoryMessage>();
for(InventoryMessage message : networkMessageQueue){ for(InventoryMessage message : networkMessageQueue){
networkMessageQueue.remove(message); networkMessageQueue.remove(message);
switch(message.getMessageSubtype()){ switch(message.getMessageSubtype()){
@ -153,10 +156,10 @@ public class ClientInventoryState implements BehaviorTree {
//translate id //translate id
Globals.clientSceneWrapper.mapIdToId(inWorldEntity.getId(), message.getentityId()); Globals.clientSceneWrapper.mapIdToId(inWorldEntity.getId(), message.getentityId());
switch(message.getcontainerType()){ switch(message.getcontainerType()){
case electrosphere.net.server.protocol.InventoryProtocol.INVENTORY_TYPE_NATURAL: { case InventoryProtocol.INVENTORY_TYPE_NATURAL: {
throw new UnsupportedOperationException("unsupported!"); throw new UnsupportedOperationException("unsupported!");
} }
case electrosphere.net.server.protocol.InventoryProtocol.INVENTORY_TYPE_EQUIP: { case InventoryProtocol.INVENTORY_TYPE_EQUIP: {
//grab equip state //grab equip state
ClientEquipState equipState = ClientEquipState.getEquipState(equipper); ClientEquipState equipState = ClientEquipState.getEquipState(equipper);
//create entity from template in message //create entity from template in message
@ -165,16 +168,17 @@ public class ClientInventoryState implements BehaviorTree {
EquipPoint equipPoint = equipState.getEquipPoint(equipPointName); EquipPoint equipPoint = equipState.getEquipPoint(equipPointName);
//attach //attach
equipState.attemptEquip(inWorldEntity, equipPoint); equipState.attemptEquip(inWorldEntity, equipPoint);
} } break;
case electrosphere.net.server.protocol.InventoryProtocol.INVENTORY_TYPE_TOOLBAR: { case InventoryProtocol.INVENTORY_TYPE_TOOLBAR: {
//grab toolbar state //grab toolbar state
ClientToolbarState toolbarState = ClientToolbarState.getClientToolbarState(equipper); ClientToolbarState toolbarState = ClientToolbarState.getClientToolbarState(equipper);
//attach //attach
toolbarState.attemptEquip(inWorldEntity); toolbarState.attemptEquip(inWorldEntity);
} } break;
} }
} else { } else {
throw new UnsupportedOperationException("todo"); bouncedMessages.add(message);
// throw new UnsupportedOperationException("TODO: in world item is null");
} }
} break; } break;
case CLIENTUPDATETOOLBAR: case CLIENTUPDATETOOLBAR:
@ -186,6 +190,7 @@ public class ClientInventoryState implements BehaviorTree {
break; break;
} }
} }
this.networkMessageQueue.addAll(bouncedMessages);
} }
public void addNetworkMessage(InventoryMessage networkMessage) { public void addNetworkMessage(InventoryMessage networkMessage) {

View File

@ -152,9 +152,10 @@ public class CommonEntityUtils {
} }
//idle tree & generic stuff all creatures have //idle tree & generic stuff all creatures have
if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getIdleData() != null){ if(graphicsTemplate.getModel() != null && graphicsTemplate.getModel().getIdleData() != null){
ClientIdleTree idleTree = new ClientIdleTree(entity); ClientIdleTree.attachTree(entity, graphicsTemplate.getModel().getIdleData());
entity.putData(EntityDataStrings.TREE_IDLE, idleTree); // ClientIdleTree idleTree = new ClientIdleTree(entity);
Globals.clientScene.registerBehaviorTree(idleTree); // entity.putData(EntityDataStrings.TREE_IDLE, idleTree);
// Globals.clientScene.registerBehaviorTree(idleTree);
} }
} }
Actor creatureActor = EntityUtils.getActor(entity); Actor creatureActor = EntityUtils.getActor(entity);

View File

@ -152,10 +152,10 @@ public class Actor {
return false; return false;
} }
for(ActorAnimationMask mask : animationQueue){ for(ActorAnimationMask mask : animationQueue){
if(mask.getAnimationName().contains(animationData.getNameFirstPerson())){ if(animationData.getNameFirstPerson() != null && mask.getAnimationName().contains(animationData.getNameFirstPerson())){
return true; return true;
} }
if(mask.getAnimationName().contains(animationData.getNameThirdPerson())){ if(animationData.getNameThirdPerson() != null && mask.getAnimationName().contains(animationData.getNameThirdPerson())){
return true; return true;
} }
} }

View File

@ -200,10 +200,12 @@ public class ToolbarInventoryPanel {
} }
} }
Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(ItemUtils.getType(Globals.draggedItem)); Item itemData = Globals.gameConfigCurrent.getItemMap().getItem(ItemUtils.getType(Globals.draggedItem));
if(itemData.getItemAudio() != null && itemData.getItemAudio().getUIReleaseAudio() != null){ if(Globals.virtualAudioSourceManager != null){
Globals.virtualAudioSourceManager.createVirtualAudioSource(itemData.getItemAudio().getUIReleaseAudio(), VirtualAudioSourceType.UI, false); if(itemData.getItemAudio() != null && itemData.getItemAudio().getUIReleaseAudio() != null){
} else { Globals.virtualAudioSourceManager.createVirtualAudioSource(itemData.getItemAudio().getUIReleaseAudio(), VirtualAudioSourceType.UI, false);
Globals.virtualAudioSourceManager.createVirtualAudioSource(AssetDataStrings.UI_SFX_ITEM_RELEASE, VirtualAudioSourceType.UI, false); } else {
Globals.virtualAudioSourceManager.createVirtualAudioSource(AssetDataStrings.UI_SFX_ITEM_RELEASE, VirtualAudioSourceType.UI, false);
}
} }
//update ui //update ui
Globals.dragSourceInventory = null; Globals.dragSourceInventory = null;

View File

@ -66,8 +66,8 @@ public class VirtualScrollable extends StandardContainerElement implements Drawa
*/ */
private boolean childIsInBounds(DrawableElement element){ private boolean childIsInBounds(DrawableElement element){
boolean rVal = true; boolean rVal = true;
if(element.getAbsoluteX() + scroll < 0 ||element.getAbsoluteY() + scroll > this.getHeight()){ if(element.getAbsoluteY() + scroll < this.getAbsoluteY() || element.getAbsoluteY() + scroll > this.getHeight() + this.getAbsoluteY()){
return false; return false;
} }
return rVal; return rVal;
} }

View File

@ -99,6 +99,7 @@ public class SaveUtils {
//create save file //create save file
Save save = new Save(saveName); Save save = new Save(saveName);
Globals.currentSave = save; //chunk map saving requires global save to be set
FileUtils.serializeObjectToSavePath(saveName, "/save.json", save); FileUtils.serializeObjectToSavePath(saveName, "/save.json", save);
//write scene file //write scene file