Compare commits

..

No commits in common. "b9f0eef20e11198d6867b9512e49801c00b63205" and "db043eda43e6a51497915ab3ec50f7122a6e339e" have entirely different histories.

19 changed files with 60 additions and 78 deletions

View File

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

View File

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

View File

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

View File

@ -34,6 +34,7 @@
- Decoy (creates a decoy)
- Torch
- Throwable potions
Fix ui scaling on abnormal monitors
Crouching
Model clothing, hair for the human
particles, light on sword collision
@ -43,13 +44,11 @@
- Spawn player in a town with a quest to complete a nearby dungeon
+ bug fixes
Fix idle animations
Fix light cluster mapping for foliage shader
Fix foliage placement
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
Fix block tree preventing initiating an attack
Fix equipping sword on toolbar
Fix return to title menu synchronization bug
Fix particles not spawning in correct positions
+ unreproducible bugs

View File

@ -870,20 +870,6 @@ Camera offset definitions in entity files
Non-Lsystem pine tree
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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,12 @@
package electrosphere.entity.scene;
import electrosphere.game.server.world.ServerWorldData;
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)
@ -21,6 +27,17 @@ public class SceneGenerator {
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
//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;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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