Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (805)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (868)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2 3
  ignore  |  Print  
  FPS Engine  (Read 70895 times)
0 Members and 1 Guest are viewing this topic.
Offline orange451

JGO Kernel


Medals: 564
Projects: 8
Exp: 8 years


Your face? Your ass? What's the difference?


« Posted 2016-04-25 07:32:07 »

Hi! Smiley
About a month or so ago I started working on another 3d java game-engine. I wanted to release it here to see how it works on your guys computers!

At the moment it's a pretty simple fps engine, and as such you cannot do much in the demo.

Download:
Link!

Here's some screenshots:





Controls:
~ or F12 Console
E throw crate
Q throw barrel (first one is slow [loads model/tex])
1 gun animation
WSAD move
T put a test decal on the scene.

Console variables:
http://pastebin.com/6FV3DmRR
Please note that any variable with r_ or post_ requires that you type the command "r_update" to load it. However, use r_update sparingly; it has a memory leak.

Console commands:
quit quits game
r_update updates rendering engine. This also clears all lights from the scene!
testlight spawns a point light at the camera
testsun spawns a directional light in the scene
clear clears console
memstat prints RAM info
gpustat prints GPU info
noclip allows you to fly
clearlights clears all active lights in the scene
map loads a map at the specified location. ROOT is ./maps/
respawn If you fall off the map Smiley

Credit:
Adam Pasek: Art
Roland La Goy: Sound
TheAgentD: Lighting engine


Requirements:
OpenGL 3.2
Java 8

1000 points if you know where the van model is from!

First Recon. A java made online first person shooter!
Offline EgonOlsen
« Reply #1 - Posted 2016-04-25 07:55:20 »

On my mighty work PC with an AMD Radeon HD5450 and Windows7/64bit, all it renders is the sky and the arm/weapon. It also says this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
Starting up SoundSystem...
Initializing LWJGL OpenAL
    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.or
g)
OpenAL initialized.

Error occured: An OpenGL error was already present when the new LightingEngine o
bject was created.: Invalid enum
Error occured: An OpenGL error occured while creating the new LightingEngine obj
ect.: Invalid enum

Offline elect

JGO Knight


Medals: 76



« Reply #2 - Posted 2016-04-25 08:14:51 »

Really cool work, orange!

You may want to implement anti-aliasing now.

Also check depth range, you can see triangles glitches on the arm. Sometimes it is enough to push forward a little the near plane  Wink
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline orange451

JGO Kernel


Medals: 564
Projects: 8
Exp: 8 years


Your face? Your ass? What's the difference?


« Reply #3 - Posted 2016-04-25 08:16:17 »

You may want to implement anti-aliasing now.
open console:
1  
2  
3  
post_fxaa 1
r_update
testsun

Wink


On my mighty work PC with an AMD Radeon HD5450 and Windows7/64bit, all it renders is the sky and the arm/weapon. It also says this:
Darn Sad I will look into this!

First Recon. A java made online first person shooter!
Offline elect

JGO Knight


Medals: 76



« Reply #4 - Posted 2016-04-25 09:03:20 »

open console:
1  
2  
3  
post_fxaa 1
r_update
testsun

Wink

Then why don't you chose your best looking screeshots therefore?  Smiley
Offline ShadedVertex
« Reply #5 - Posted 2016-04-25 09:38:43 »

It looks awesome Cheesy

But it runs at 18 FPS. That's because of the lighting, because there was a significant performance boost when I did r_update and removed all of the lights. Maybe it's the shadow calculations? Or the ambient occlusion? It's either one of them. There are a couple of lighting bugs too.

But overall, it's awesome! Of course, right now it isn't much of a game engine, but seriously, that's almost AAA standard graphics. Also, isn't MSAA easier to implement than FXAA? Is FXAA faster or something?
Offline SHC
« Reply #6 - Posted 2016-04-25 09:40:43 »

Runs at a solid 100+ FPS for me. What is the TPS value? By the way, I have found a small glitch, why is there a light in the corner?



Pretty cool looking of course. This will be a big hit if made into a complete game.

Offline ShadedVertex
« Reply #7 - Posted 2016-04-25 09:46:37 »

Runs at a solid 100+ FPS for me. What is the TPS value? By the way, I have found a small glitch, why is there a light in the corner?



Pretty cool looking of course. This will be a big hit if made into a complete game.


I don't think he intends to turn it into a game, I think he's making an engine.

Also, about the FPS, I think it's just because of my computer. I've got 4GB of RAM and an Intel HD Graphics 2500 graphics card. SHC was really alarmed when he heard that. He asked me to change my graphics card Tongue
Offline SHC
« Reply #8 - Posted 2016-04-25 09:55:20 »

Standing on the wall. I guess TPS is Ticks Per Second, am I right? The rendering is still pretty smooth but the movement is not.


Offline SHC
« Reply #9 - Posted 2016-04-25 09:57:38 »

A log by the way, just an exception, but not fatal.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
Starting up SoundSystem...
Initializing LWJGL OpenAL
    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
OpenAL initialized.

Exception in thread "Thread-1" java.lang.IllegalStateException: Keyboard must be created before you can query key state
        at org.lwjgl.input.Keyboard.isKeyDown(Keyboard.java:406)
        at engine.game.client.io.GameKeyboard.mapKeys(GameKeyboard.java:67)
        at engine.game.client.io.GameKeyboard.tick(GameKeyboard.java:77)
        at engine.game.GameEngine.gameLogic(GameEngine.java:151)
        at engine.game.GameEngine.run(GameEngine.java:139)
        at java.lang.Thread.run(Unknown Source)

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline VaTTeRGeR
« Reply #10 - Posted 2016-04-25 10:36:12 »

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
org.lwjgl.LWJGLException: Pixel format not accelerated
        at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
        at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)
        at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:247)
        at org.lwjgl.opengl.Display.createWindow(Display.java:306)
        at org.lwjgl.opengl.Display.create(Display.java:848)
        at org.lwjgl.opengl.Display.create(Display.java:797)
        at engine.rendering.util.DisplayHelper.initDisplay(DisplayHelper.java:30)
        at engine.rendering.RenderingPipeline.initialize(RenderingPipeline.java:128)
        at engine.rendering.RenderingPipeline.initialize(RenderingPipeline.java:121)
        at tests.fps.TestPhysicsExample.main(TestPhysicsExample.java:120)
Failed to create OpenGL Context.

Intel HDs opengl support is awesome yay. I'll try it on my PC later this day.
Offline elect

JGO Knight


Medals: 76



« Reply #11 - Posted 2016-04-25 12:12:34 »

I got this:


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
C:\Users\GBarbieri\Downloads\TestFPS\TestFPS>java -jar client.jar

Starting up SoundSystem...
Initializing LWJGL OpenAL
    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.or
g)
OpenAL initialized.

java.lang.NullPointerException
        at com.bulletphysics.collision.dispatch.UnionFind.find(UnionFind.java:12
3)
        at com.bulletphysics.collision.dispatch.SimulationIslandManager.storeIsl
andActivationState(SimulationIslandManager.java:97)
        at com.bulletphysics.dynamics.DiscreteDynamicsWorld.calculateSimulationI
slands(DiscreteDynamicsWorld.java:669)
        at com.bulletphysics.dynamics.DiscreteDynamicsWorld.internalSingleStepSi
mulation(DiscreteDynamicsWorld.java:374)
        at com.bulletphysics.dynamics.DiscreteDynamicsWorld.stepSimulation(Discr
eteDynamicsWorld.java:337)
        at com.bulletphysics.dynamics.DynamicsWorld.stepSimulation(DynamicsWorld
.java:58)
        at engine.game.physics.PhysicsWorld.tick(PhysicsWorld.java:89)
        at engine.game.World.tick(World.java:27)
        at engine.game.GameEngine.gameLogic(GameEngine.java:187)
        at engine.game.GameEngine.run(GameEngine.java:139)
        at java.lang.Thread.run(Unknown Source)
AL lib: (EE) alc_cleanup: 1 device not closed

C:\Users\GBarbieri\Downloads\TestFPS\TestFPS>pause
Drücken Sie eine beliebige Taste . . .
Offline orange451

JGO Kernel


Medals: 564
Projects: 8
Exp: 8 years


Your face? Your ass? What's the difference?


« Reply #12 - Posted 2016-04-25 17:51:55 »

    I have updated the engine a little bit today.

Added:
  • Physics objects make sounds when they collide with objects. At the moment they use the same sounds as your footsteps. This will be changed.
  • If the engine crashes on load it will pop up a simple error dialog.
  • I lowered the default settings slightly. No SSAO, and 60 fps
  • There shouldn't be a UnionFind error in Bullet anymore
  • Fixed a problem with the barrel material file. The textures will load properly now

There are two things to note:
Firstly, to exit the game, go to console and type quit instead of ALT F4ing. @SHC when you alt f4 it prints that error! Grin
Secondly, you need OpenGL 3.2 to run the engine. I completely forgot to mention this in the OP!

@VaTTeRGeR does your intel chip have 3.2? o: If it does I need to fix some things! Tongue

@EgonOlson I haven't found anything that explains why you cannot see the world geometry on an AMD card. I will keep looking though! Sad[/list]

First Recon. A java made online first person shooter!
Offline VaTTeRGeR
« Reply #13 - Posted 2016-04-25 17:52:46 »



I get 144 fps and 200 ups if the world is sparsely populated, it breaks down from 200 ups to 140 ups from one moment to another after some amount of phys-objects.
This is on an Q9650 and GTX 960.

The Intel Chip has the first generation Intel HD built in (at the university Cheesy).
http://ark.intel.com/de/products/43546/Intel-Core-i5-650-Processor-4M-Cache-3_20-GHz
I couldn't get LibGDX to run with these kind of graphics processors.
Offline orange451

JGO Kernel


Medals: 564
Projects: 8
Exp: 8 years


Your face? Your ass? What's the difference?


« Reply #14 - Posted 2016-04-25 18:04:00 »

The Intel Chip has the first generation Intel HD built in (at the university Cheesy).
http://ark.intel.com/de/products/43546/Intel-Core-i5-650-Processor-4M-Cache-3_20-GHz
I couldn't get LibGDX to run with these kind of graphics processors.
Did a quick search, seems that chip only goes up to OpenGL 2.1.

First Recon. A java made online first person shooter!
Offline VaTTeRGeR
« Reply #15 - Posted 2016-04-25 18:10:49 »

btw I can't open the console, tried ^ + ~ ´ ß < # and any other key.
Offline orange451

JGO Kernel


Medals: 564
Projects: 8
Exp: 8 years


Your face? Your ass? What's the difference?


« Reply #16 - Posted 2016-04-25 18:12:00 »

btw I can't open the console, tried ^ + ~ ´ ß < # and any other key.
Hmm it should just be the Grave key (~). The key right above Tab. Are you on a non qwerty keyboard?

EDIT:
Some google searches show that LWJGL 2 doesn't always work correctly with the grave key. Sad!

First Recon. A java made online first person shooter!
Offline VaTTeRGeR
« Reply #17 - Posted 2016-04-25 18:13:37 »

I'm on a qwertz keyboard  Grin
Offline kingroka123
« Reply #18 - Posted 2016-04-25 18:19:36 »

On my mighty work PC with an AMD Radeon HD5450 and Windows7/64bit, all it renders is the sky and the arm/weapon. It also says this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
Starting up SoundSystem...
Initializing LWJGL OpenAL
    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.or
g)
OpenAL initialized.

Error occured: An OpenGL error was already present when the new LightingEngine o
bject was created.: Invalid enum
Error occured: An OpenGL error occured while creating the new LightingEngine obj
ect.: Invalid enum


I have this same problem but on a Intel Core m3. I'm running OpenGL 4.4. Will test on my tower when I get home.
Offline orange451

JGO Kernel


Medals: 564
Projects: 8
Exp: 8 years


Your face? Your ass? What's the difference?


« Reply #19 - Posted 2016-04-25 18:26:54 »

On my mighty work PC with an AMD Radeon HD5450 and Windows7/64bit, all it renders is the sky and the arm/weapon. It also says this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
Starting up SoundSystem...
Initializing LWJGL OpenAL
    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.or
g)
OpenAL initialized.

Error occured: An OpenGL error was already present when the new LightingEngine o
bject was created.: Invalid enum
Error occured: An OpenGL error occured while creating the new LightingEngine obj
ect.: Invalid enum


I have this same problem but on a Intel Core m3. I'm running OpenGL 4.4. Will test on my tower when I get home.
I assume there must be a problem with the gbuffer vertex shader then. If you're seeing the arm then the frag shader must working fine; the arm model uses the same frag shader as the world geometry.

But for the life of me, I have no idea how this doesn't work on non NVidia cards:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
#version 330

uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;
uniform mat3 normalMatrix;

uniform mat4 worldMatrix;
uniform mat3 normalWorldMatrix;
uniform vec4 modelColor;
uniform vec4 pipelineColor;

layout (location = 0) in vec3 in_Position;
layout (location = 1) in vec3 in_Normal;
layout (location = 2) in vec2 in_TexCoords;
layout (location = 3) in vec4 in_Color;


out vec3 vNormal;
out vec3 vViewSpacePos;
out vec2 vTexCoords;
out vec4 vColor;

void main(){
   vec4 viewPos = viewMatrix * worldMatrix * vec4(in_Position, 1.0);
   gl_Position = projectionMatrix * viewPos;
   vViewSpacePos = viewPos.xyz;
   
   vNormal = normalMatrix * normalWorldMatrix * in_Normal;
   vTexCoords = in_TexCoords;
   vColor = in_Color * modelColor * pipelineColor;
}



Perhaps the problem lies in the static model class...

First Recon. A java made online first person shooter!
Offline elect

JGO Knight


Medals: 76



« Reply #20 - Posted 2016-04-25 19:16:52 »

That code looks fine, the error lies somewhere else
Offline kingroka123
« Reply #21 - Posted 2016-04-25 20:00:35 »

Ok got the chance to test it on my home pc and it works perfectly. 144 fps stable. My tower has an amd cpu and Nvidia 660 gpu.
Offline phu004

JGO Knight


Medals: 19
Projects: 10
Exp: 10 years


NoSuchPersonException


« Reply #22 - Posted 2016-04-26 00:44:24 »

It works and looks great on my home computer which has a GTX680, got about 114 fps at the beginning of the scene.

However it failed to launch on my work computer which has a Intel HD 4600, I tried to update the driver but still no luck,  here is the message:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
C:\Users\pan\Downloads\TestFPS\TestFPS>java -jar client.jar
.......................................
... Initializing Rendering Pipeline ...
.......................................
Exception in thread "main" java.lang.IllegalStateException: Function is not supported
        at org.lwjgl.BufferChecks.checkFunctionAddress(BufferChecks.java:58)
        at org.lwjgl.opengl.ARBDebugOutput.glDebugMessageCallbackARB(ARBDebugOutput.java:104)
        at engine.rendering.RenderingPipeline.initialize(RenderingPipeline.java:138)
        at engine.rendering.RenderingPipeline.initialize(RenderingPipeline.java:126)
        at tests.fps.TestFPS.main(TestFPS.java:124)

C:\Users\pan\Downloads\TestFPS\TestFPS>pause
Press any key to continue . . .
Offline orange451

JGO Kernel


Medals: 564
Projects: 8
Exp: 8 years


Your face? Your ass? What's the difference?


« Reply #23 - Posted 2016-04-26 01:53:07 »

However it failed to launch on my work computer which has a Intel HD 4600, I tried to update the driver but still no luck,  here is the message:

This one is actually my fault! Tongue
I wanted to check if I was doing any illegal openGL calls (trying to fix EgonOlson's issue). In doing so I had to create a debug callback, and I forgot that those only work on OpenGL 4+.

I removed the callback and reuploaded the file. Hopefully it will run on your work computer now ^^

I also changed all of the physics sounds. And I added a "hard" and "soft" sound for each rigid body.

[Edit]
I showed this to my friend, and he couldn't believe that this was java  Smiley

First Recon. A java made online first person shooter!
Offline Some1epic123

Senior Devvie


Medals: 8
Projects: 1



« Reply #24 - Posted 2016-04-26 02:27:25 »

Hmm, getting this when I try to run it:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
.......................................
... Initializing Rendering Pipeline ...
.......................................
.......... Creating Shaders ...........
......... Setting Up Camera ...........
..... Setting Up Lighting Engine ......
Detected NVIDIA card.
Vendor: nvidia corporation
Renderer: geforce gtx 670/pcie/sse2
Exception in thread "main" java.lang.NullPointerException
   at engine.rendering.gl.texture.SkyBox.<init>(SkyBox.java:38)
   at engine.rendering.RenderingPipeline.initialize_lighting_engine(RenderingPipeline.java:204)
   at engine.rendering.RenderingPipeline.initialize(RenderingPipeline.java:180)
   at engine.rendering.RenderingPipeline.initialize(RenderingPipeline.java:126)
   at tests.fps.TestFPS.main(TestFPS.java:124)
Offline orange451

JGO Kernel


Medals: 564
Projects: 8
Exp: 8 years


Your face? Your ass? What's the difference?


« Reply #25 - Posted 2016-04-26 02:49:11 »

Did you extract the game?  Huh
The skybox is just a standard buffered image loading thing.

First Recon. A java made online first person shooter!
Offline Some1epic123

Senior Devvie


Medals: 8
Projects: 1



« Reply #26 - Posted 2016-04-26 03:19:49 »

Yes, it's extracted. It worked fine when I ran it on another computer, though. The computer with the issue is running Linux while the other is running Windows, so maybe that
has something to do with it?
Offline orange451

JGO Kernel


Medals: 564
Projects: 8
Exp: 8 years


Your face? Your ass? What's the difference?


« Reply #27 - Posted 2016-04-26 03:21:16 »

Maybe ¯\_(ツ)_/¯

First Recon. A java made online first person shooter!
Offline phu004

JGO Knight


Medals: 19
Projects: 10
Exp: 10 years


NoSuchPersonException


« Reply #28 - Posted 2016-04-26 05:06:37 »

Quote
I removed the callback and reuploaded the file. Hopefully it will run on your work computer now ^^

Yeap it now works happily on my desktop at work Cheesy

Good job on the physics engine, it feels very realistic. 
Offline EgonOlsen
« Reply #29 - Posted 2016-04-26 06:42:47 »

Perhaps the problem lies in the static model class...
I'll give it a go at home on a more recent AMD card and report back...

Pages: [1] 2 3
  ignore  |  Print  
 
 

 
Riven (585 views)
2019-09-04 15:33:17

hadezbladez (5526 views)
2018-11-16 13:46:03

hadezbladez (2406 views)
2018-11-16 13:41:33

hadezbladez (5788 views)
2018-11-16 13:35:35

hadezbladez (1227 views)
2018-11-16 13:32:03

EgonOlsen (4666 views)
2018-06-10 19:43:48

EgonOlsen (5685 views)
2018-06-10 19:43:44

EgonOlsen (3200 views)
2018-06-10 19:43:20

DesertCoockie (4102 views)
2018-05-13 18:23:11

nelsongames (5117 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!