This commit is contained in:
austin 2022-02-08 00:31:51 -05:00
parent 26a999de28
commit c919d5c8ce
12 changed files with 231 additions and 104 deletions

View File

@ -90,6 +90,35 @@
] ]
} }
] ]
},
{
"itemId" : "hairshort1",
"modelPath": "Models/itemEntityShorts.fbx",
"tokens" : [
"GRAVITY",
"ARMOR",
"TARGETABLE"
],
"collidable": {
"type" : "CUBE",
"dimension1" : 0.1,
"dimension2" : 0.1,
"dimension3" : 0.35,
"offsetX" : 0,
"offsetY" : 0.05,
"offsetZ" : 0
},
"equipWhitelist" : [
{
"creatureId" : "human",
"model" : "Models/hairshort1.fbx",
"meshList" : [
"Hair"
],
"meshMaskList" : []
}
]
} }

Binary file not shown.

Binary file not shown.

View File

@ -68,12 +68,88 @@
"/Textures/GoblinEyes.png" "/Textures/GoblinEyes.png"
] ]
}, },
"Models/person1animpass2.fbx" : { "Models/baseman.fbx" : {
"makehuman1" : [ "Torso" : [
"/Textures/skin1.png", "/Textures/skin1.png",
"/Textures/skin1.png" "/Textures/skin1.png"
], ],
"high-poly" : [ "HandLeft" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"ForearmLeft" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"BicepLeft" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"HandRight" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"ForearmRight" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"BicepRight" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"FootLeft" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"FootRight" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"LowerLegLeft" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"LowerLegRight" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"UpperLegLeft" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"UpperLegRight" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"Shorts" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"ShoulderLeft" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"ShoulderRight" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"Head" : [
"/Textures/skin1.png",
"/Textures/skin1.png"
],
"EyebrowRight" : [
"/Textures/b1.png",
"/Textures/b1.png"
],
"EyebrowLeft" : [
"/Textures/b1.png",
"/Textures/b1.png"
],
"EyeRight" : [
"/Textures/w1.png",
"/Textures/w1.png"
],
"EyeLeft" : [
"/Textures/w1.png", "/Textures/w1.png",
"/Textures/w1.png" "/Textures/w1.png"
] ]
@ -131,6 +207,18 @@
"/Textures/w1.png", "/Textures/w1.png",
"/Textures/w1.png" "/Textures/w1.png"
] ]
},
"Models/shorts1.fbx" : {
"ClothingItem" : [
"/Textures/b1.png",
"/Textures/b1.png"
]
},
"Models/hairshort1.fbx" : {
"Hair" : [
"/Textures/b1.png",
"/Textures/b1.png"
]
} }
} }
} }

171
pom.xml
View File

@ -198,91 +198,90 @@
</includes> </includes>
</resource> </resource>
</resources> </resources>
<pluginManagement> <plugins>
<plugins> <plugin>
<plugin> <artifactId>maven-assembly-plugin</artifactId>
<artifactId>maven-assembly-plugin</artifactId> <configuration>
<configuration> <archive>
<archive> <manifest>
<manifest> <addClasspath>true</addClasspath>
<addClasspath>true</addClasspath> <mainClass>electrosphere.main.Main</mainClass>
<mainClass>electrosphere.main.Main</mainClass> </manifest>
</manifest> </archive>
</archive> <descriptorRefs>
<descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef>
<descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs>
</descriptorRefs> </configuration>
</configuration> <executions>
<executions> <execution>
<execution> <id>assemble-all</id>
<id>assemble-all</id> <phase>package</phase>
<phase>package</phase> <goals>
<goals> <goal>single</goal>
<goal>single</goal> </goals>
</goals> </execution>
</execution> </executions>
</executions> </plugin>
</plugin> <plugin>
<plugin> <groupId>org.apache.maven.plugins</groupId>
<groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId>
<artifactId>maven-shade-plugin</artifactId> <version>3.2.4</version>
<version>3.2.4</version> <executions>
<executions> <execution>
<execution> <phase>package</phase>
<phase>package</phase> <goals>
<goals> <goal>shade</goal>
<goal>shade</goal> </goals>
</goals> <configuration>
<configuration> <transformers>
<transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>electrosphere.main.Main</mainClass>
<mainClass>electrosphere.main.Main</mainClass> </transformer>
</transformer> </transformers>
</transformers> </configuration>
</configuration> </execution>
</execution> </executions>
</executions> </plugin>
</plugin> <plugin>
<plugin> <groupId>org.codehaus.mojo</groupId>
<groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId>
<artifactId>exec-maven-plugin</artifactId> <version>3.0.0</version>
<version>3.0.0</version> <executions>
<executions> <execution>
<execution> <goals>
<goals> <goal>exec</goal>
<goal>exec</goal> </goals>
</goals>
<configuration> </execution>
<executable>java</executable> <!-- <execution>
<includeProjectDependencies>false</includeProjectDependencies> <id>Telephone</id>
<includePluginDependencies>true</includePluginDependencies> <phase>generate-sources</phase>
<mainClass>electrosphere.main.Main</mainClass> <goals>
<!-- <classpathScope>compile</classpathScope> --> <goal>java</goal>
<arguments> </goals>
<argument>-cp</argument> <configuration>
<argument>target/classes;target/Renderer-0.1-jar-with-dependencies.jar</argument> <executable>java</executable>
<argument>electrosphere.main.Main</argument> <arguments>
</arguments> <argument>-jar</argument>
<!-- <classesDirectory>${project.basedir}/target/classes</classesDirectory> --> <argument>Telephone-0.2.1.jar</argument>
</configuration> </arguments>
</execution> </configuration>
<execution> </execution> -->
<id>Telephone</id> </executions>
<phase>generate-sources</phase> <configuration>
<goals> <executable>java</executable>
<goal>java</goal> <includeProjectDependencies>false</includeProjectDependencies>
</goals> <includePluginDependencies>true</includePluginDependencies>
<configuration> <mainClass>electrosphere.main.Main</mainClass>
<executable>java</executable> <!-- <classpathScope>compile</classpathScope> -->
<arguments> <arguments>
<argument>-jar</argument> <argument>-cp</argument>
<argument>Telephone-0.2.1.jar</argument> <argument>target/classes;target/Renderer-0.1-jar-with-dependencies.jar</argument>
</arguments> <argument>electrosphere.main.Main</argument>
</configuration> </arguments>
</execution> <!-- <classesDirectory>${project.basedir}/target/classes</classesDirectory> -->
</executions> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement>
</build> </build>
</project> </project>

View File

@ -35,8 +35,8 @@ public class AudioEngine {
public AudioEngine() { public AudioEngine() {
soundBufferList = new ArrayList(); soundBufferList = new ArrayList<AudioBuffer>();
soundSourceMap = new HashMap(); soundSourceMap = new HashMap<String,AudioSource>();
} }
public void init() { public void init() {

View File

@ -624,7 +624,12 @@ public class LoadingThread extends Thread {
//attach ai to evil goblin //attach ai to evil goblin
// MindlessAttacker.attachToCreature(goblin); // MindlessAttacker.attachToCreature(goblin);
OpportunisticAttacker.attachToCreature(goblin); OpportunisticAttacker.attachToCreature(goblin);
Entity shorts = ItemUtils.spawnBasicItem("shorts1");
EntityUtils.getPosition(shorts).set(new Vector3f(2,1,1));
Entity hair = ItemUtils.spawnBasicItem("hairshort1");
EntityUtils.getPosition(hair).set(new Vector3f(1,1,1));
// goblin = CreatureUtils.spawnBasicCreature("Goblin"); // goblin = CreatureUtils.spawnBasicCreature("Goblin");
// CollisionObjUtils.positionCharacter(goblin, new Vector3f(3, 0, 4)); // CollisionObjUtils.positionCharacter(goblin, new Vector3f(3, 0, 4));
// EntityUtils.getScale(goblin).set(0.005f); // EntityUtils.getScale(goblin).set(0.005f);

View File

@ -1,5 +1,6 @@
package electrosphere.game.config; package electrosphere.game.config;
import electrosphere.logger.LoggerInterface;
import electrosphere.main.Globals; import electrosphere.main.Globals;
import electrosphere.util.FileUtils; import electrosphere.util.FileUtils;
@ -132,6 +133,7 @@ public class UserSettings {
public static void loadUserSettings(){ public static void loadUserSettings(){
LoggerInterface.loggerStartup.INFO("Load user settings");
Globals.userSettings = FileUtils.loadObjectFromAssetPath("/Config/settings.json", UserSettings.class); Globals.userSettings = FileUtils.loadObjectFromAssetPath("/Config/settings.json", UserSettings.class);
if(Globals.userSettings == null){ if(Globals.userSettings == null){
Globals.userSettings = getDefault(); Globals.userSettings = getDefault();

View File

@ -15,12 +15,15 @@ public class LoggerInterface {
public static Logger loggerGameLogic; public static Logger loggerGameLogic;
public static Logger loggerRenderer; public static Logger loggerRenderer;
public static Logger loggerEngine; public static Logger loggerEngine;
public static Logger loggerStartup;
public static void initLoggers(){ public static void initLoggers(){
loggerStartup = new Logger(LogLevel.WARNING);
loggerNetworking = new Logger(LogLevel.WARNING); loggerNetworking = new Logger(LogLevel.WARNING);
loggerFileIO = new Logger(LogLevel.WARNING); loggerFileIO = new Logger(LogLevel.WARNING);
loggerGameLogic = new Logger(LogLevel.WARNING); loggerGameLogic = new Logger(LogLevel.WARNING);
loggerRenderer = new Logger(LogLevel.WARNING); loggerRenderer = new Logger(LogLevel.WARNING);
loggerEngine = new Logger(LogLevel.WARNING); loggerEngine = new Logger(LogLevel.WARNING);
loggerStartup.INFO("Initialized loggers");
} }
} }

View File

@ -36,6 +36,7 @@ import electrosphere.game.server.world.ServerWorldData;
import electrosphere.game.server.world.MacroData; import electrosphere.game.server.world.MacroData;
import electrosphere.game.server.datacell.DataCellManager; import electrosphere.game.server.datacell.DataCellManager;
import electrosphere.game.simulation.MicroSimulation; import electrosphere.game.simulation.MicroSimulation;
import electrosphere.logger.LoggerInterface;
import electrosphere.menu.Menu; import electrosphere.menu.Menu;
import electrosphere.net.client.ClientNetworking; import electrosphere.net.client.ClientNetworking;
import electrosphere.net.server.Player; import electrosphere.net.server.Player;
@ -319,15 +320,9 @@ public class Globals {
public static void initGlobals(){ public static void initGlobals(){
LoggerInterface.loggerStartup.INFO("Initialize global variables");
//load in default texture map //load in default texture map
Gson gson = new Gson(); textureMapDefault = FileUtils.loadObjectFromAssetPath("Textures/default_texture_map.json", TextureMap.class);
// try {
//deserializes the texture map from its default path using gson
//also done in one line
textureMapDefault = FileUtils.loadObjectFromAssetPath("Textures/default_texture_map.json", TextureMap.class);
// textureMapDefault = gson.fromJson(Files.newBufferedReader(new File(Thread.currentThread().getContextClassLoader().getResource("Textures/default_texture_map.json").getFile()).toPath()), TextureMap.class); //only the best of coding practices :)
// } catch (IOException ex) { ex.printStackTrace(); } //TODO: handle better :tm:
//create entity manager //create entity manager
entityManager = new EntityManager(); entityManager = new EntityManager();
//temporary hold for skybox colors //temporary hold for skybox colors
@ -352,6 +347,7 @@ public class Globals {
} }
public static void initDefaultAudioResources(){ public static void initDefaultAudioResources(){
LoggerInterface.loggerStartup.INFO("Loading default audio resources");
Globals.assetManager.addAudioPathToQueue("/Audio/MenuBackspace.ogg"); Globals.assetManager.addAudioPathToQueue("/Audio/MenuBackspace.ogg");
Globals.assetManager.addAudioPathToQueue("/Audio/MenuBadOption.ogg"); Globals.assetManager.addAudioPathToQueue("/Audio/MenuBadOption.ogg");
Globals.assetManager.addAudioPathToQueue("/Audio/MenuChangeOption.ogg"); Globals.assetManager.addAudioPathToQueue("/Audio/MenuChangeOption.ogg");
@ -359,6 +355,7 @@ public class Globals {
} }
public static void initDefaultGraphicalResources(){ public static void initDefaultGraphicalResources(){
LoggerInterface.loggerStartup.INFO("Loading default graphical resources");
//create default textures //create default textures
Globals.assetManager.addTexturePathtoQueue("Textures/default_diffuse.png"); Globals.assetManager.addTexturePathtoQueue("Textures/default_diffuse.png");
Globals.assetManager.addTexturePathtoQueue("Textures/default_specular.png"); Globals.assetManager.addTexturePathtoQueue("Textures/default_specular.png");

View File

@ -112,12 +112,12 @@ public class Main {
// I N I T I A L I Z A T I O N // I N I T I A L I Z A T I O N
// //
// //
//load user settings
UserSettings.loadUserSettings();
//initialize logging interfaces //initialize logging interfaces
LoggerInterface.initLoggers(); LoggerInterface.initLoggers();
//load user settings
UserSettings.loadUserSettings();
//controls //controls
initControlHandler(); initControlHandler();
@ -191,10 +191,12 @@ public class Main {
Globals.initDefaultAudioResources(); Globals.initDefaultAudioResources();
//fire off a loading thread for the title menus/screen //fire off a loading thread for the title menus/screen
LoggerInterface.loggerStartup.INFO("Fire off loading thread");
Globals.loadingThread = new LoadingThread(LoadingThread.LOAD_TITLE_MENU); Globals.loadingThread = new LoadingThread(LoadingThread.LOAD_TITLE_MENU);
Globals.loadingThread.start(); Globals.loadingThread.start();
//recapture the screen for rendering //recapture the screen for rendering
LoggerInterface.loggerStartup.INFO("Recapture screen");
RenderUtils.recaptureScreen(); RenderUtils.recaptureScreen();
/// ///
@ -399,6 +401,7 @@ public class Main {
public static void initControlHandler(){ public static void initControlHandler(){
LoggerInterface.loggerStartup.INFO("Initialize control handler");
Globals.controlHandler = ControlHandler.generateExampleControlsMap(); Globals.controlHandler = ControlHandler.generateExampleControlsMap();
// Globals.controlHandler = FileLoadingUtils.loadModelObjectFromBakedJsonFile("/Config/keybinds.json",ControlHandler.class); // Globals.controlHandler = FileLoadingUtils.loadModelObjectFromBakedJsonFile("/Config/keybinds.json",ControlHandler.class);
} }

View File

@ -116,6 +116,7 @@ public class RenderingEngine {
public void createOpenglContext(){ public void createOpenglContext(){
LoggerInterface.loggerRenderer.INFO("Create OpenGL Context");
//Initializes opengl //Initializes opengl
glfwInit(); glfwInit();
//Gives hints to glfw to control how opengl will be used //Gives hints to glfw to control how opengl will be used