Git Product home page Git Product logo

silenceengine's Introduction

logo

What is SilenceEngine?

SilenceEngine is a 2D/3D game engine that takes care of low level aspects of game development like graphics, input handling, asset loading and collision detection for you, meaning you only need to make your game. It lets you focus on the game play and game design, by doing most of the hard work for you.

Features

The main feature of SilenceEngine is it's simplicity, and it greatly reduces the amount of code you need to write by taking care of almost everything automatically for you. Though it is meant to take care of everything automatically, it is also completely customizable. Here are a list of features of it.

  • Truly Cross Platform:

    SilenceEngine games are truly cross platform, it lets you compile to Desktop (Windows / Linux / MacOS), Android and also HTML5, all from a single code base. You can chose which platform(s) to target, and also extend it with platform specific code easily.

  • State Based Games:

    SilenceEngine supports separating the game logic into different states, like intro state, story state, play state, high score state, game over state, and any other state that you are going to create. This allows you to keep stuff separate and your code base clean and easy to read.

  • Completely Customizable:

    SilenceEngine is designed to be completely customizable. You can change everything from the ResourceLoader to the Game Loop, and you can also change the entity parameters. It is totally flexible and also easy to use. It is finally up to you whether you want to extend the components, or to re-implement them in your way.

  • Automatic Collision Detection:

    SilenceEngine features with automatic collision detection. All you need to do is give your entities a collision shape, and register the classes in the collider, and the collisions, along with collision response is done for you, in both 2D and 3D. The CollisionEngine uses SAT (Separating Axis Theorem) to determine collisions, and hence you get your collision response with good accuracy.

  • Tiled MAP Editor Support:

    SilenceEngine has support for loading and rendering maps made with the Tiled Map Editor. Currently supports automatically rendering of Orthogonal and Isometric maps, but the support will soon increase to all other map formats. The parser can parse any TMX format (not compressed, and XML only) though.

  • Object Oriented Wrappers for OpenGL and OpenAL:

    If you think that all the above features are not useful for you, and you want more performance and you love going low level, SilenceEngine provides object oriented wrapper classes for OpenGL and OpenAL. It is up to you how to use them, and other parts of the SilenceEngine cooperates with you.

The above list is only half what SilenceEngine offers to you. It is currently in heavy development, and more features are yet to arrive. In the meanwhile, take a look at the source code, and the example games to get an idea of how to use this engine.

Is it only for games?

Perhaps not, you can create any form of OpenGL application using SilenceEngine. It provides you with OpenGL classes in the com.shc.silenceengine.graphics.opengl package, which cleanly wraps the OpenGL functions into Java classes, making them more easy to use. All you have to take care of is that you must call the dispose() on those objects when you no longer need them.

It is also easier to use in development mode as we will check for OpenGL errors after every call to the OpenGL functions and report you the errors, if any exist, in the form of GLException allowing you to get rid of the errors quickly and easily. By the way, everything in SilenceEngine is modern, and there is no deprecated stuff. I'm proud to say that this engine only uses OpenGL 3.3 (no deprecated OpenGL).

Licence

  • The engine, and all the backends in this repo are licenced under MIT licence, which you can find here.
  • This desktop backend uses LWJGL 3. You can find it's licence here.
  • The GWT backend uses WebGL4J, GWT-AL and GwtOpentype libraries which operate on MIT licence.
  • The Android backend uses AndroidOpenAL library which uses LGPL v3 licence.
  • The engine uses EasyJSON and EasyXML libraries which are released under MIT licence.

Links

silenceengine's People

Contributors

0energy avatar bluechaos0 avatar darkhax avatar gamefreak0 avatar minuskelvin avatar shadowchild avatar shadowfacts avatar shadowlordalpha avatar silvertiger avatar sriharshachilakapati avatar zifiv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

silenceengine's Issues

OpenAL Binding changes

Not relevent at the moment but the OpenAL bindings have changed in the newer nightly versions of LWJGL 3 where the ALContext and ALDevice classes are now gone.

Suggestion: Entity3DScale

You have ways of setting the Scale in the Transform class however there is no way to set a Entity3D's scale. Using the Transform matrix its possable to render a Model at the scale you wish however there is no method to pass a Transform into a Entity3D nor is there a way to scale is built in to the class like Entity3D.scale(sx, sy, sz); or Entity3D.scale(s); Though it is possable to force a scale by modifing the local transform or setting a default parent and scaling that (not tested . . . yet)

Suggestion: Add and Remove from Resource Loader Maps

Just two things that could help the Resource Loader be easier to use and better in general

  1. Adding and removing
    The ability to add and remove resources to the maps that store the actual objects after they have been loaded. Bigger projects have a ton of resources and the default Resource Loader can not add and remove objects dynamically. It can load them up at the beginning but after that its just a static list. Adding Items to the list will also let these items be cleaned up at the end if they are forgotten about as well

  2. Asynchronous Loading
    After the Splash Screen has been displayed and the primary loading is done a way to load the resources without it taking over the main thread. Not really needed as it is very easy for someone to do in their own code however they won't be able to use the default loader easily in this way unless suggestion 1 is also added

Frustum intersects AAB

Hi Sri,
I had some more intensive tests and it turned out that the algorithm I used for Frustum-AAB-intersection did not really work out in some frequent cases.
I switched to an own implementation of "2.4 Basic intersection test" from this 'paper': http://www.cescg.org/CESCG-2002/DSykoraJJelinek/
Just wanted to let you know, since I saw that you were basically doing the same as I before there.

Nifty Renderer for Silence engine

Just putting it here so we can add it as a milestone.

A Nifty GUI Renderer for Silence Engine as LWJGL3 does not yet have a renderer int Nifty or TWL as of yet.

Use a common logging framework

Instead of using SilenceEngine's built in Logger, it may be better to use a popular logging framework. Otherwise people who want to use a logging framework will either use it, thus making 2 different logging systems being used in the same project, or will have to use a SilenceEngine's younger and incomplete version.

The most common logging systems I know of are SLF4J, Log4J, and Logback.

A Circle is not an Ellipsis (strictly speaking)

Hi Sri,

just wanted to tell you about the "Liskov substitution principle". It's not a severe issue with two classes in SilenceEngine, just one thing you might want to be aware of. You can ignore it. :)

I just had a very interesting read on the "Liskov substitution principle". A very good video by the famous Robert C. Martin is here: https://www.youtube.com/watch?v=QHnLmvDxGTY&t=1h13m50s

Applied to your Circle and Ellipsis classes, it says that an Ellipsis should not be used instead of a Circle (and therefore Circle should not be a subclass of Ellipsis) because it would possibly violate the assumption of a user that statically an Ellipsis always has two radii, that may be different.
So upon seeing a Circle (object with runtime-type Circle), it is possible to still set it to two different radii when using the Ellipsis interface.

Examples of this would be a "draw" method which, upon seeing an Ellipsis, drew an ellipsis with two different radi.
In order to draw a circle now, we would then need to have type-specific switch-cases for the Circle derivative of Ellipsis in order to handle the case of a circle actually being an ellipsis with two equal radii, hence only taking the radiusX into account. This would couple a client to all of the derivatives of Ellipsis and would increase rigidity of the code.
Also, it is possible for a Circle to have two different radii (through its Ellipsis interface) and therefore any draw method must know whether the runtime type is actually an Ellipsis or a Circle.

Again, this is just one thing that came to my mind right now when somewhere in the past I was going over SilenceEngine's code, and it might not be a problem depending on the assumptions made by clients using it.

EDIT: this problem is actually known and given a name: https://en.m.wikipedia.org/wiki/Circle-ellipse_problem

MathUtils.fract should be the 'real' fractional part

Hi,
I have just seen in your MathUtils class that the method fract() does not return what is the common understanding of the "decimal fractional part".

It instead returns the fractional part interpreted as an integer, which also depends on the formatting that the JVM uses to print that value, since you convert it to string and truncate everything before the decimal point.

Usually, the fractional part of a decimal number is the same decimal number except with a zero before the decimal separator.
So 1.523 becomes 0.523 and 235.10 becomes 0.1.

Why is that so?
Because the fractional part is usually being used in operations that require modulo arithmetics, such as with noise functions, where you want repeating fractional values over a lattice of integer values.

I propose therefore to implement that method either via x % 1.0 or x - (int)x.
This will also allow you to keep the sign of xin the result, since negative values will be preserved.

Suggestion: Heightmap models and collisions and texturemaps

Heightmap - A grayscale image that is used to generate a model that is normally used as the ground in a 3D game.

Texturemap - Same size of the Heightmap image that is colored and each color channel (RGBA) represents a different texture to be painted onto the model allows mixing of textures because what texture is where is based on the color of the pixel at that point

In addition a Collision should also be generated from the Heightmap file as most of the time a heightmaps use is limited to the ground.

Copies of the same basic exception

Is there any real reason that we have 3 copies of several different exceptions just with a different parent class? for example the OutOfMemoryException where you can set all the base exceptions to SilenceException and then just set the message to be different depending on whats throwing the exception

suggestion preInit Method

A preInit method that can be used to resize the display rename it and configure other parts of the engine before it fully start would be a good addition. With it the window wouldn't flash onscreen for a little and then resize itself to the proper size as it would be created as the proper size or resized before it is even displayed. Config options could also be loaded here as they don't normally need any part of the engine started to work properly

EDIT: I changed almost the whole thing as i though of a better way to say it -_-

Suggestion: Remove lwjgl-natives.jar

LWJGL will load up the native it needs now instead of the proper one needing to be loaded by the user so its possible to get rid of the packed version that Silence uses and just replace it with the normal LWJGL natives folder though to keep everything clean it should probably also be placed in its own folder with the jar within the libs folder.

FilePath.calculateResourceSize() is crashing when called from IDE

The exception being thrown is

com.shc.silenceengine.core.SilenceException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:653)
    at java.util.ArrayList.get(ArrayList.java:429)
    at com.shc.silenceengine.io.FilePath.calculateResourceSize(FilePath.java:645)
    at com.shc.silenceengine.io.FilePath.sizeInBytes(FilePath.java:599)
    at com.shc.silenceengine.io.FilePath.toString(FilePath.java:762)
    at net.epoxide.client.ResourceManager.init(ResourceManager.java:24)
    at net.epoxide.EpoxideGame.init(EpoxideGame.java:38)
    at com.shc.silenceengine.core.Game.start(Game.java:268)
    at net.epoxide.EpoxideGame.main(EpoxideGame.java:18)

    at com.shc.silenceengine.core.SilenceException.reThrow(SilenceException.java:73)
    at com.shc.silenceengine.core.SilenceEngine.lambda$static$66(SilenceEngine.java:178)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1057)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1052)
    at java.lang.Thread.dispatchUncaughtException(Thread.java:1952)

Originally posted on the forum at http://silenceengine.goharsha.com/forum/newbie-questions/crashing-when-tostring/

Drawstring fails with NullPointerException

SilenceEngine.graphics.getGraphics2D().drawString("Sometext", Vector2.ZERO);

throws a NullPointerException for me. Not sure if I have to initialize anything before, but I cannot draw a String.

Bug/Limitation/Question: Keyboard not always registering a new Pressed Key

Using the update(delta) method to call the Keyboard like you do in several of your test classes the method Keyboard.isClicked(Keyboard.KEY_UP) along with any other key I have tried does not always register that the key has been pressed. As I recall that system should be running at basically the same speed of the rendering system while update should be running around 60-61UPS so I should be getting a pressed message around once per second at least when spamming the button however it sometimes fails to register that the key has been pressed. This can also be done pressing the key every now and then as the message i have printing to debug this will not print out.

Add an Artificial intelligence system

Currently SilenceEngine provides most of the main features of a game engine, i.e. Gameplay mechanics, Rendering, Audio and Physics.

I think it would be a great enhancement to provide a system for artificial intelligence.
Something like a package com.shc.silenceengine.ai where you have a common interface for decision making like AISystem for further implementations like DecisionTreeAI, BehaviourTreeAI or RuleBasedAI for example.

Suggestion: Remove TimeUtils.Unit and replace with java TimeUnit

Java provides a TimeUnit class that can convert from one unit of time to another and as the glfwGetTime() method defaults to using seconds as its time it is relatively easy to implement. It also provides support for larger time units though they are not really needed. This moves most of the code from TimeUtils into a normal java class that and changes it from a more math class to a more wrapper type class.

Add AZERTY/QWERTY/... (and more) management for Keyboard

I think it would be interesting to add a system to manage different type of keyboard, for example already started QWERTY / AZERTY.

From what I've seen in my tests with LWJGL3, the default keys using the positioning of QWERTY keyboards, it would be interesting to create classes that inherit Keyboard to manage different mode.

I will take time in the weekend I think to do that and you pousez in "merge request" a few things.

If you have some things added to it where a more precise idea of how to do it let me know here.

Add LWJGL3 as a dependency for gradle

LWJGL3 has maven artifacts so why not add it to gradle's dependency management?

repositories {
    mavenCentral()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

project.ext.lwjglVersion = "3.0.0-SNAPSHOT"

dependencies {
    compile "org.lwjgl:lwjgl:${lwjglVersion}"
    compile "org.lwjgl:lwjgl-platform:${lwjglVersion}:natives-windows"
    compile "org.lwjgl:lwjgl-platform:${lwjglVersion}:natives-linux"
    compile "org.lwjgl:lwjgl-platform:${lwjglVersion}:natives-osx"
}

^^^ taken from Badlogic's lwjgl-maven-gradle project

BUG: Model Files do not allow spaces

Model.load("models/character test.obj"); throws an exception and only has the models/character in the error string and not the full path. There is also no way to get around this like in other areas where an InputStram can be passed in. Directly calling the loader could be done but the formatting for the string the loader takes is still undocumented

Possible bug with ResourceLoader

The ResourceLoader resets all the other window states back to how they were however it does not reset the clear color back to what it was before it was run. This isn't a big problem however the color that the scene should be must be reset after every time the loader is run then

Rectangle#getCenter returns -Infinity

We talked about this on the forum.
The default values for minX, minY, maxX and maxY set in Polygon#clearVertices seem to cause a problem in Rectangle#updateVertices, leading to this bug.

Logger Names

Asked through Feature Requests on the forum, by Darkhax. The thread is here.

I was looking for this in the SilenceEngine logger class, but I couldn't seem to find it. What I am looking for is something similar to the logger name feature offered by Log4J's logger, or even Oracle's existing logger. The idea is that you can create a new logger instance with a name, and that name will be appended to the start of all messages that are posted using that instance. An example of this can be seen in the LWJGL init outputs which add [LWJGL] to the start of console outputs. Logger names have also been used in modable games like Minecraft, allowing for easy lookup of which mod originated the output. This could probably be implemented similarly to Log4J which has the name as part of the constructor.

public static final Logger LOG = LogManager.getLogger("Name Here");

If this feature were to be added, some of the specific things I would like access to, is the ability for a game to specify a default name, the ability to get the name from an instance, and a way to override it. It would also be cool if this was worked into the SilenceEngine outputs, adding a [SilenceEngine] in front of it's outputs.

Edit: Another change closely related to the logger is the extent to which the DEVELOPMENT flag affects the logger. It seems very strange to me that the Logger becomes completely useless (info/warn/error all return prematurely). This seems pretty odd because it means that the Logger is going to be turned off when the game is actually being distributed.

This is a good suggestion, and support will be given in the 1.0.1 branch.
Thanks for the suggestion @Darkhax

Adding an IO File system abstraction

This is an IO file system abstraction, with classes that represents both files on the disk and resources in the JAR. The idea is to have a FilePath class that denotes all the files both on the disk and the resources with a single object.

FilePath fileExternal  = FilePath.getExternalFile("data/config.cfg");
FilePath fileResource  = FilePath.getResourceFile("resources/texture.png");
FilePath fileDirectory = FilePath.getExternalDir("data/");
FilePath resDirectory  = FilePath.getResourceDir("resources/");

All parts of the engine will be modified to use these paths now. This class will also contain getters for getting Java's InputStreams and also the paths by constructing from an existing path.

Add a picking system

I don't saw the picking system/engine into your game engine. I think that isn't optional for a game engine.

Implement log re-direction

The current logger is just a convenience wrapper over PrintStreams and is not a complete logging tool. In order to help users that want to use any other logging framework (like SLF4J, Logback, Log4J etc.,), we need a log re-direction mechanism to translate the logs submitted to the Logger into the logging framework of their choice.

This is why this issue is created, and will be used as a tracker to track the progress on the implementation of this feature.

Suggestion: Refactor GameState to State

just a suggestion to refactor the class GameState to State as it is not the Game State but the State the game is in. It also then doesn't take up the name GameState so that can be used instead of PlayState but thats just my own thing.

Bug: Splash Screen not closing

After calling ResourceLoader.startLoading(); two times the whole engine seems to lock up and not move on past the Splash Screen.
Code:

Logger.log("Loading Resources");
ResourceLoader loader = ResourceLoader.getInstance();
// some random font I have that loads fine
int fontID = loader.defineFont("Resources/Fonts/OpenSans-Regular.ttf", TrueTypeFont.STYLE_NORMAL, 24);

loader.startLoading();
Fonts.OPEN_SANS = loader.getFont(fontID);
loader.startLoading();
Logger.log("Setting up Display");
Display.setTitle("Break the Engine :D");
Display.centerOnScreen();

SilenceEngine.graphics.setClearColor(Color.WHITE_SMOKE);

Adding a boolean that stops the SplashScreen from displaying more than once would probably fix the problem as well as allow for loading other objects using the your normal method possibly in another thread :D.

Suggestion: ability to override IEngine components

This goes hand in hand with the suggested preInit() method but during the preInit() method or before SilenceEngine is initilized a way to override the different default components like the collision or sound engines.

SilenceException cannot open window on Windows_64 bit.

Hi, I was trying to run Blox, however there seems to be an issue opening the window on windows 64bit in netbeans. I also tried in the command prompt and got the same error as with trying to run the test classes in netbeans for the Silence Engine. I am wanting to make a game and I like the SilenceEngine it seems to be most of what I'm looking for in a java game engine aside from the issues of it not opening the first window.

My system is i3, 6gb ram, windows professional 64 bits. I have Netbeans 8.0.2 with the latest Java 8 u72 JDK and JRE installed. I will try downloading LWJGL latest release and natives to see if that helps any. I will also try installing the gradle plugin on netbeans in windows, I had tried it in linux earlier today as I have a dual boot system, however I see the same error.

[INFO 01/27/2016 9:22:47 AM] Initializing SilenceEngine. Platform identified as WINDOWS_64
[TRACE 01/27/2016 9:22:47 AM]
com.shc.silenceengine.core.SilenceException: java.lang.RuntimeException: Cannot create window
    at com.shc.silenceengine.core.glfw.Window.<init>(Window.java:280)
    at com.shc.silenceengine.core.glfw.Window.<init>(Window.java:228)
    at com.shc.silenceengine.core.Display.createWindow(Display.java:107)
    at com.shc.silenceengine.core.Display.create(Display.java:83)
    at com.shc.silenceengine.graphics.GraphicsEngine.init(GraphicsEngine.java:73)
    at com.shc.silenceengine.core.SilenceEngine.init(SilenceEngine.java:114)
    at com.shc.silenceengine.core.Game.start(Game.java:265)
    at com.shc.blox.Blox.main(Blox.java:21)

    at com.shc.silenceengine.core.SilenceException.reThrow(SilenceException.java:73)
    at com.shc.silenceengine.core.SilenceEngine.lambda$static$63(SilenceEngine.java:178)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1057)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1052)
    at java.lang.Thread.dispatchUncaughtException(Thread.java:1952)

Suggestion: Logger Stuff

A Static Logger is a good idea however it currently uses System.out and System.err to print its messages. It could easily be reworked to just be a static wrapper for the java logger class and could even be configured easily by a user. It could also then easily print to a log file rather than the console or the console or both. When not in developer mode though it should print out to a log file so that a console window doesn't show up but you still get the log information.

Getting rid of AWT dependency

Right now, we are depending on AWT to load textures and also fonts, and since LWJGL3 doesn't support AWT integration, we are doing it in a hacky way. With the latest build, LWJGL3 has got bindings to the STB library, we could use it to get rid of AWT, and also other dependencies other than LWJGL itself. Here is a list of what we could change.

  • The textures. Right now, we are using ImageIO to load the textures. We can use STBImage now.
  • The fonts. Right now, we are using java's Font class. We can now use STBTruetype now.
  • OGG decoding. Right now, we are using J-Ogg and J-Orbis combined. Now we can use STBVorbis class to do that.

However, we can't completely get rid of AWT, as we still might need to use it to load WAV, MIDI, AIFF and AU audio files, which STB doesn't support. I think this is a better enhancement, because at least, the number of JAR files we have to distribute decreases. However, this will be only done once issue #30 is done.

BUG: Blank String = crash

creditHeaderFont.drawString(batcher, "", 0, 0); throws the exception

com.shc.silenceengine.graphics.opengl.GLException$InvalidOperation: The specified operation is not allowed in current state

This only happens with a blank string. A normal string will work fine. If the string is empty it should just skip doing anything however it crashes instead. a null pointer is thrown as expected when the string value is null though.

Display data not being updated immediately?

This is probably more of an issue on my end, however I have been having trouble getting the size of the display to update correctly. I am setting the size of the display in the start of the init call, however it starts off small, and then updates it's size after a second or two.
animation

I was having a similar issue with the window title being updated, however once I moved the title update to the main run method, before I start the game, it updates correctly. The size does not seem to update at all if I do that to the window size however.

public static void main (String[] args) {

    Display.setTitle("Silence Engine: Darkhax's Test Game");
    Game.DEVELOPMENT = false;

    new Core().start();
}

@Override
public void init () {

    Display.setSize(1280, 720);
    DeckHandler.initDeck();
    Resources.init();
}

@Override
public void update (float delta) {

}

@Override
public void render (float delta, Batcher batcher) {

}

@Override
public void resize () {

}

@Override
public void dispose () {

}

Suggestion: Set Cursor from Display or Mouse (or both)

From what I've seen in most of your code you seem to want to direct people to use your more convenient methods and classes so while it is possible to set the mouse cursor already using Display.getWindow().setCursor(Cursor); it might be a good idea to add the ability to set the cursor from the Display class or the Mouse class directly.

SilenceException related to sound on macosx

Hi Sri,

I am using your engine for the first time. So, basically I took the source from one of your applications and tried to compile and runnit. Everything compiles but at runtime i'm getting several errors.

The following log shows the configuration used to run the example:

[INFO 12/29/2015 9:44:14 PM] Initializing LWJGL library. Extracting natives.
[INFO 12/29/2015 9:44:14 PM] LWJGL version 3.0.0 build 7 is initialised
[INFO 12/29/2015 9:44:14 PM] [LWJGL] Version: 3.0.0 build 7
[INFO 12/29/2015 9:44:14 PM] [LWJGL]     OS: Mac OS X v10.11
[INFO 12/29/2015 9:44:14 PM] [LWJGL]    JRE: 1.8.0_25 x86_64
[INFO 12/29/2015 9:44:14 PM] [LWJGL]    JVM: Java HotSpot(TM) 64-Bit Server VM v25.25-b02 by Oracle Corporation
[INFO 12/29/2015 9:44:14 PM] [LWJGL] Loaded library from org.lwjgl.librarypath: lwjgl
[INFO 12/29/2015 9:44:14 PM] [LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[INFO 12/29/2015 9:44:14 PM] [LWJGL] Loaded native library: /var/folders/5h/f2t3rrvs1mg1cjtsylppphc00000gn/T/SilenceEngine5669742121614165815/libjemalloc.dylib
[INFO 12/29/2015 9:44:14 PM] [LWJGL] MemoryUtil allocator: JEmallocAllocator
[INFO 12/29/2015 9:44:14 PM] [LWJGL] Loaded native library: /var/folders/5h/f2t3rrvs1mg1cjtsylppphc00000gn/T/SilenceEngine5669742121614165815/libglfw.dylib
[INFO 12/29/2015 9:44:14 PM] Initializing SilenceEngine. Platform identified as MACOSX
[INFO 12/29/2015 9:44:14 PM] Running AWT fix on Mac OS X, needed for LWJGL to run
[INFO 12/29/2015 9:44:14 PM] [LWJGL] Loaded native library: libobjc.dylib
[INFO 12/29/2015 9:44:15 PM] [LWJGL] Loaded native library bundle: /System/Library/Frameworks/OpenGL.framework

Until this point it all seems good, however:

[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniform1dEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniform2dEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniform3dEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniform4dEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniform1dvEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniform2dvEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniform3dvEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniform4dvEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniformMatrix2dvEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniformMatrix3dvEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniformMatrix4dvEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniformMatrix2x3dvEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniformMatrix2x4dvEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniformMatrix3x2dvEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniformMatrix3x4dvEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniformMatrix4x2dvEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glProgramUniformMatrix4x3dvEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glVertexArrayVertexAttribDivisorEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glTextureStorage1DEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glTextureStorage2DEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glTextureStorage3DEXT
[WARNING 12/29/2015 9:44:15 PM] [LWJGL] Failed to locate address for GL function glVertexArrayVertexAttribLOffsetEXT
[INFO 12/29/2015 9:44:15 PM] Clearing out OpenGL errors
2015-12-29 21:44:15.319 java[21253:619138] [JRSAppKitAWT markAppIsDaemon]: Process manager already initialized: can't fully enable headless mode.

And finally an exception related to audio

com.shc.silenceengine.core.SilenceException: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at com.shc.silenceengine.audio.ISoundReader.create(ISoundReader.java:119)
    at com.shc.silenceengine.audio.Sound.<init>(Sound.java:74)
    at com.shc.silenceengine.audio.AudioEngine.getSound(AudioEngine.java:105)
    at com.shc.silenceengine.core.ResourceLoader.soundLoadHelper(ResourceLoader.java:107)
    at com.shc.silenceengine.core.ResourceLoader$$Lambda$65/523691575.load(Unknown Source)
    at com.shc.silenceengine.core.ResourceLoader.asyncLoadResources(ResourceLoader.java:284)
    at com.shc.silenceengine.core.ResourceLoader$$Lambda$70/990398217.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)

Do you have any idea of how to solve this problem?

thanks a lot!

GLException$InvalidOperation in different tests

See the logs below.
These are the outputs from running, respectively, Geom3DTest and Graphics2DTest.
I've just recently started digging into the engine (great job, btw!), but from my limited understanding it appears the ResourceLoader is trying to draw the logo before OpenGL has been initialized.

[INFO 03/15/2015 9:18:41 PM] Initializing SilenceEngine. Platform identified as WINDOWS_64
[INFO 03/15/2015 9:18:41 PM] Initializing LWJGL library. Extracting natives
[INFO 03/15/2015 9:18:41 PM] LWJGL version 3.0.0a is initialised
[INFO 03/15/2015 9:18:42 PM] Initializing Audio Engine with OpenAL 1.1
AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead
[INFO 03/15/2015 9:18:42 PM] Audio Engine initialized successfully, with device OpenAL Soft
[INFO 03/15/2015 9:18:42 PM] SilenceEngine version 0.0.3a was initialized successfully
[INFO 03/15/2015 9:18:42 PM] Initializing the Game resources
com.shc.silenceengine.graphics.opengl.GLException$InvalidOperation: The specified operation is not allowed in current state
    at com.shc.silenceengine.graphics.opengl.GLError.check(GLError.java:79)
    at com.shc.silenceengine.graphics.opengl.GLError.check(GLError.java:54)
    at com.shc.silenceengine.graphics.opengl.Program.setUniform(Program.java:158)
    at com.shc.silenceengine.graphics.opengl.Program.setUniform(Program.java:163)
    at com.shc.silenceengine.graphics.programs.DefaultProgram.prepareFrame(DefaultProgram.java:84)
    at com.shc.silenceengine.graphics.Batcher.flush(Batcher.java:219)
    at com.shc.silenceengine.graphics.Batcher.end(Batcher.java:185)
    at com.shc.silenceengine.graphics.Graphics2D.drawTexture(Graphics2D.java:306)
    at com.shc.silenceengine.graphics.Graphics2D.drawTexture(Graphics2D.java:267)
    at com.shc.silenceengine.graphics.Graphics2D.drawTexture(Graphics2D.java:313)
    at com.shc.silenceengine.core.ResourceLoader.renderProgress(ResourceLoader.java:226)
    at com.shc.silenceengine.core.ResourceLoader.startLoading(ResourceLoader.java:167)
    at com.shc.silenceengine.tests.Geom3DTest.init(Geom3DTest.java:71)
    at com.shc.silenceengine.core.Game.start(Game.java:188)
    at com.shc.silenceengine.tests.Geom3DTest.main(Geom3DTest.java:59)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
AL lib: (EE) alc_cleanup: 1 device not closed
[INFO 03/15/2015 9:31:20 PM] Initializing SilenceEngine. Platform identified as WINDOWS_64
[INFO 03/15/2015 9:31:20 PM] Initializing LWJGL library. Extracting natives
[INFO 03/15/2015 9:31:20 PM] LWJGL version 3.0.0a is initialised
[INFO 03/15/2015 9:31:20 PM] Initializing Audio Engine with OpenAL 1.1
AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead
[INFO 03/15/2015 9:31:20 PM] Audio Engine initialized successfully, with device OpenAL Soft
[INFO 03/15/2015 9:31:20 PM] SilenceEngine version 0.0.3a was initialized successfully
[INFO 03/15/2015 9:31:20 PM] Initializing the Game resources
com.shc.silenceengine.graphics.opengl.GLException$InvalidOperation: The specified operation is not allowed in current state
    at com.shc.silenceengine.graphics.opengl.GLError.check(GLError.java:79)
    at com.shc.silenceengine.graphics.opengl.GLError.check(GLError.java:54)
    at com.shc.silenceengine.graphics.opengl.Program.setUniform(Program.java:158)
    at com.shc.silenceengine.graphics.opengl.Program.setUniform(Program.java:163)
    at com.shc.silenceengine.graphics.programs.DefaultProgram.prepareFrame(DefaultProgram.java:84)
    at com.shc.silenceengine.graphics.Batcher.flush(Batcher.java:219)
    at com.shc.silenceengine.graphics.Batcher.end(Batcher.java:185)
    at com.shc.silenceengine.graphics.Graphics2D.drawTexture(Graphics2D.java:306)
    at com.shc.silenceengine.graphics.Graphics2D.drawTexture(Graphics2D.java:267)
    at com.shc.silenceengine.graphics.Graphics2D.drawTexture(Graphics2D.java:313)
    at com.shc.silenceengine.core.ResourceLoader.renderProgress(ResourceLoader.java:226)
    at com.shc.silenceengine.core.ResourceLoader.startLoading(ResourceLoader.java:143)
    at com.shc.silenceengine.tests.Graphics2DTest.init(Graphics2DTest.java:59)
    at com.shc.silenceengine.core.Game.start(Game.java:188)
    at com.shc.silenceengine.tests.Graphics2DTest.main(Graphics2DTest.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
AL lib: (EE) alc_cleanup: 1 device not closed

A ModelBatch, a SpriteBatch, and a new Scene implementation

As it stands right now, the scene graph is inefficient when there are many objects that needs to be rendered, and also in 3D, each model can have multiple materials, increasing the number of required state switches. And more, though models sort geometry based on materials, they are still drawn individually instead of batching all of them. A ModelBatch should be implemented to fix this issue.

ModelBatch batch = SilenceEngine.graphics.getModelBatch();

batch.begin(components);
{
    for (Entity3D entity: entities)
    {
        batch.render(entity.getModel(), entity.getTransform());
    }
}
batch.end();

The components is a list of scene components such as lights that affect the whole scene. The current Scene class can be split into Scene2D and Scene3D classes to avoid confusion between 2D and 3D entities. The SpriteBatch is similar to the ModelBatch, except that it will be used to batch sprites, where a Sprite is a container which contains an animation or a static texture per entity.

SpriteBatch batch = SilenceEngine.graphics.getSpriteBatch();

batch.begin();
{
    for (Entity2D entity : entities)
    {
        batch.render(entity.getSprite(), entity.getTransform());
    }
}
batch.end();

Both the ModelBatch and the SpriteBatch depends on the existing Batcher class, so there is no need to recreate these batches when the OpenGL context is lost due to a Display state change. As this is a major change to SilenceEngine, it will take some time to be implemented, but it will be in progress right from today.

JOML Math Library

Ok so while i know that we already have a custom coded math/util type library it might be a good idea to possibly change to JOML as it was the suggested math library from the LWJGL Blog though this library seems to be getting a large number of updates and has had several fixes/updates over the last few weeks though the core seems to be mostly static

3d models and textures question/bug?

are textures being properly drawn to 3d models because currently I am only able to get pure white models to show up and the OBJModelTest also looks like the only thing affecting it is the color lights and not its own texture. though i could just be doing it all wrong

ALDevice.destroy() does not exist in latest LWJGL 3 release nightlies

In the latest LWJGL 3 release nightlies ALDevice.destroy() has been changed to ALDevice.close().

I'm using LWJGL 3.0.0 build 4

Due to this change the game crashes on exit.

Heres the log:

[TRACE 12/03/2015 5:57:11 PM]
com.shc.silenceengine.core.SilenceException: java.lang.NoSuchMethodError: org.lwjgl.openal.ALDevice.destroy()V
    at com.shc.silenceengine.audio.openal.ALContext.dispose(ALContext.java:95)
    at com.shc.silenceengine.audio.AudioEngine.dispose(AudioEngine.java:79)
    at com.shc.silenceengine.core.SilenceEngine.dispose(SilenceEngine.java:150)
    at com.shc.silenceengine.core.gameloops.FixedCatchingUpGameLoop.stop(FixedCatchingUpGameLoop.java:217)
    at com.shc.silenceengine.core.gameloops.FixedCatchingUpGameLoop.start(FixedCatchingUpGameLoop.java:110)
    at com.shc.silenceengine.core.Game.start(Game.java:267)
    at com.shc.silenceengine.core.Game.start(Game.java:217)
    at io.github.shadowchild.vdgame.Main.main(Main.java:64)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

    at com.shc.silenceengine.core.SilenceException.reThrow(SilenceException.java:73)
    at com.shc.silenceengine.core.SilenceEngine.lambda$static$67(SilenceEngine.java:178)
    at com.shc.silenceengine.core.SilenceEngine$$Lambda$5/1789447862.uncaughtException(Unknown Source)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1057)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1052)
    at java.lang.Thread.dispatchUncaughtException(Thread.java:1952)

AL lib: (EE) alc_cleanup: 1 device not closed

TMX Tiled Map Editor Support

Title says it all, this issue is used as a tracker for adding the TMX Tiled Map Editor Support to SilenceEngine. This will be a big feature as it allows for easy editing of tile maps. The maps will be loaded as just data, and Scene2D will be created from the map.

Here is a list of what works and what does not.

  • Rendering of TmxImageLayer
  • Rendering of TmxTileLayer
  • Transparency and blending between layers
  • Tiles from multiple tilesets
  • Tile Flipping
  • Rendering of animated tiles
  • Support for TMX rendering order (Uses RIGHT_DOWN which is default)
  • Isometric maps
  • Isometric (Staggered) maps
  • Hexagonal (Staggered) maps

Frustum.intersects with Polygon and Polyhedron

Hi Sri,
your two Frustum.intersects methods with the parameters Polygon and Polyhedron don't account for the fact that a polygon's vertices need not be inside the frustum while the polygon still intersects with the frustum, because it cuts one or multiple polygon's faces.
The preferred algorithm for this sort of test seems to be the separating axis test.

bugs in FPSCamera class

sensivity is probably high;
moveUp method doesn't move up the camera, it moves somewhere backward.
there is no limit for rotation by Y axis: camera rotates higher than 360 degrees like a flying sphere. Is this feature must be there? Or I need to solve this problem somehow by myself?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.