gholdys
|
 |
«
Posted
2008-12-20 10:44:04 » |
|
Hello all I have just joined JavaGaming.org, so I'll briefly introduce myself. My name is Grzegorz Holdys. I run a small company called Insight Machines, that creates simulation games mainly for education and training purposes. Some time ago I started developing a physics engine for 3D car games. The engine is not complete, but in my opinion it works well enough to show it to the World :-). You can find the demo here. It requires Java 6.0 to work. Please take a look at it a tell me what you think. I have tested the demo on three different machines running Windows XP, Linux and Windows Vista, so it should work, but if it doesn't please let me know. Cheers, Grzegorz P.S I include a screenshot:
|
|
|
|
irreversible_kev
|
 |
«
Reply #1 - Posted
2008-12-20 13:07:30 » |
|
Very very cool - worked perfectly.
However the FPS is alot lower than I would like at 21FPS on Intel Q6600, Geforce 8800GTS, WindowsXP. You seem to be using JOGL so is it the physics slowing it down?
Would love to see a game made out of this.
|
|
|
|
gholdys
|
 |
«
Reply #2 - Posted
2008-12-20 13:27:37 » |
|
However the FPS is alot lower than I would like at 21FPS on Intel Q6600, Geforce 8800GTS, WindowsXP. You seem to be using JOGL so is it the physics slowing it down?
Can you check your CPU usage? The demo does not use continues rendering - it uses a special Animator thing from JOGL to keep FPS at around 25. On Linux, this is 25, but on WindowsXP it's a little less (thanks to the precision of the system timer on Windows)
|
|
|
|
Games published by our own members! Check 'em out!
|
|
irreversible_kev
|
 |
«
Reply #3 - Posted
2008-12-20 13:42:48 » |
|
it uses a special Animator thing from JOGL to keep FPS at around 25. Oh that explains it  It seems to run at below 2% CPU when driving around and about 6% when I push a cylinder around by driving into it continuously. I managed to get it to 11% when trying to hit all 4 cylinders at the same time.
|
|
|
|
gholdys
|
 |
«
Reply #4 - Posted
2008-12-20 13:54:13 » |
|
I have increased the target FPS to 30, so it should run a little smoother now. I can't increase it much more, because I won't be able to play  - I have a 2.1GHz AthlonX2 CPU and an integrated GeForce 6150.
|
|
|
|
kevglass
|
 |
«
Reply #5 - Posted
2008-12-20 14:33:20 » |
|
This is a very very cool demo!  I managed to get stuck inside a cylinder at one point tho! Really great car physics. Kev
|
|
|
|
bienator
Senior Devvie   
OutOfCoffeeException
|
 |
«
Reply #6 - Posted
2008-12-20 14:37:10 » |
|
thats really cool gholdys! FPSAnimatuor usually does not produce smooth framerates try to switch to the normal Animator and enable vsynch (gl.setSwapInterval(1)). This should produce much better results on most systems (except old intel cards). ...and implement a handbrake 
|
|
|
|
gholdys
|
 |
«
Reply #7 - Posted
2008-12-20 14:43:11 » |
|
This is a very very cool demo!  I managed to get stuck inside a cylinder at one point tho! Really great car physics. Kev The collision response code does need some work yet 
|
|
|
|
gholdys
|
 |
«
Reply #8 - Posted
2008-12-20 14:46:46 » |
|
FPSAnimatuor usually does not produce smooth framerates try to switch to the normal Animator and enable vsynch (gl.setSwapInterval(1)). This should produce much better results on most systems (except old intel cards).
I will try to implement this ASAP. Thanks for the hint bienator!
|
|
|
|
Xyle
|
 |
«
Reply #9 - Posted
2008-12-21 07:47:50 » |
|
Ok, that was very nice. Thats one of the best demos I've seen so far. I am very impressed. I've been working with Visual Basic, DarkBasic, Blitz3d and recently went to Java due to deployment issues. I have looked at alot demos and purchased a few physics engines and I will say that this worked a heck of alot smoother that the engines I purchased. Thank you for the view.
Well done.
|
|
|
|
Games published by our own members! Check 'em out!
|
|
gholdys
|
 |
«
Reply #10 - Posted
2008-12-21 09:22:56 » |
|
Ok, that was very nice. Thats one of the best demos I've seen so far. I am very impressed. I've been working with Visual Basic, DarkBasic, Blitz3d and recently went to Java due to deployment issues. I have looked at alot demos and purchased a few physics engines and I will say that this worked a heck of alot smoother that the engines I purchased. Thank you for the view.
Well done.
Well then. Next time, you will consider buying a physics engine for a Java game, leave me a note 
|
|
|
|
Eli Delventhal
|
 |
«
Reply #11 - Posted
2008-12-21 10:03:18 » |
|
Any chance you can get this demo into Java 1.5? Many of us Apple users are still without Java 6 because Steve Jobs's turtleneck is too tight.
|
|
|
|
gholdys
|
 |
«
Reply #12 - Posted
2008-12-21 10:09:46 » |
|
Any chance you can get this demo into Java 1.5? Many of us Apple users are still without Java 6 because Steve Jobs's turtleneck is too tight.
Certainly. I'll get on it right away.
|
|
|
|
gouessej
|
 |
«
Reply #13 - Posted
2008-12-21 11:01:24 » |
|
Excellent!!! It works fine under Linux. I like this demo very much. You have made a very good job. I think I will quote your demo  But why is the frame rate so low on my machine? Only 11 FPS. It is not very important as it is quite playable. I'm under Mandriva Linux 2007, AMD Sempron 2600+, ATI Radeon 9250 Pro, open source driver. Other 3D Java games using JOGL rarely get a frame rate lower than 20 FPS on my machine. What do you use for your physics engine?
|
|
|
|
gholdys
|
 |
«
Reply #14 - Posted
2008-12-21 11:10:41 » |
|
Excellent!!! It works fine under Linux. I like this demo very much. You have made a very good job. I think I will quote your demo  But why is the frame rate so low on my machine? Only 11 FPS. It is not very important as it is quite playable. I'm under Mandriva Linux 2007, AMD Sempron 2600+, ATI Radeon 9250 Pro, open source driver. Other 3D Java games using JOGL rarely get a frame rate lower than 20 FPS on my machine. What do you use for your physics engine? I have written the physics engine myself basing on the Marco Monster's tutorial of vehicle dynamics. I've also used some equations from "Physics for game developers" by David M. Bourg. I'm a little disappointed that you get only 11 FPS. Can you check your CPU usage?
|
|
|
|
gouessej
|
 |
«
Reply #15 - Posted
2008-12-21 11:24:20 » |
|
I have written the physics engine myself basing on the Marco Monster's tutorial of vehicle dynamics. I've also used some equations from "Physics for game developers" by David M. Bourg. I'm a little disappointed that you get only 11 FPS. Can you check your CPU usage?
You use almost 100% of my CPU. Do you use VBO? How do you draw your car? Do you use NURBS?
|
|
|
|
gholdys
|
 |
«
Reply #16 - Posted
2008-12-21 16:12:30 » |
|
You use almost 100% of my CPU. Do you use VBO? How do you draw your car? Do you use NURBS?
I use the good old display lists, no VBO. The reason why rendering takes so much time, is that the car model is quite detailed. Too detailed for this kind of demo, but that was the only model I could use. Nevertheless I have found a small bug that has quite significantly increased the CPU load during rendering. I have removed it, so the demo should work a little faster now.
|
|
|
|
irreversible_kev
|
 |
«
Reply #17 - Posted
2008-12-21 19:07:54 » |
|
It's still on 21FPS for me on WindowsXP. I think im playing the latest version as the shape of the grey block has changed. It's a shame that the FPS is locked to the same on every computer regardless of it's power. There has to be a way of letting the engine work out what is acceptable in terms of balancing physics and rendering. Just out of interest, is the rendering's FPS independant of the physics' FPS? Can't wait to see additions&improvements 
|
|
|
|
Eli Delventhal
|
 |
«
Reply #18 - Posted
2008-12-21 20:08:57 » |
|
Certainly. I'll get on it right away.
Hey gholdys - I just tried it out on my Mac with 1.5 and I get: java.lang.NoSuchMethodError: java.util.Arrays.copyOf()
I think that's a 1.6 only method.
|
|
|
|
gholdys
|
 |
«
Reply #19 - Posted
2008-12-21 21:35:11 » |
|
I guess I have to get myself a JRE 1.5. Darn it 
|
|
|
|
Corvinex
Senior Devvie    Projects: 1
Work Hard, Go Pro.
|
 |
«
Reply #20 - Posted
2008-12-21 22:01:14 » |
|
Not really, you just put "-target 1.5" on the compile line as a parameter.
|
|
|
|
gouessej
|
 |
«
Reply #21 - Posted
2008-12-21 22:24:19 » |
|
What have you done??? It is worse!!! 5 FPS and it is flickering!!
|
|
|
|
phu004
|
 |
«
Reply #22 - Posted
2008-12-22 00:44:39 » |
|
works fine here, nice physics. I got ~16 fps on my intel E8400 with integrated graphic card. It seems you are performing some really accurate shadow mapping here, it might be the reason that i got such low frame rate.
|
|
|
|
Ranger
|
 |
«
Reply #23 - Posted
2008-12-22 01:12:10 » |
|
What have you done??? It is worse!!! 5 FPS and it is flickering!!
Mine too. Java 1.6. Vista. Dell Inspiron 9400. Core Duo 2Ghz. GeForce 9700 GS.
|
|
|
|
gholdys
|
 |
«
Reply #24 - Posted
2008-12-22 07:46:06 » |
|
Ooups! Sorry guys. I'll fix it right away.
|
|
|
|
CommanderKeith
|
 |
«
Reply #25 - Posted
2008-12-22 07:57:06 » |
|
Wow that worked well, ran at 21 fps even on this machine which has an intel integrated video card. The physics is very good. nice job 
|
|
|
|
gholdys
|
 |
«
Reply #26 - Posted
2008-12-22 08:49:49 » |
|
OK. I have made a few changes. 1. I have recompiled the code to work with JRE 1.5 using JDK 1.5. Simply changing "target" to 1.5 is not enough. This does not check for API compatibility, but only marks the code as compatible with Java 1.5 2. I have removed the FPS limit, so it should run smoother on Windows. 3. I have included a simple profiler type of thing. When you run the demo with the console open and press ESC to restart, you will see a printout in the console similar to the one below. This is an analysis of an average simulation time step, that tells you how much time was required to complete each phase of a time step. There are four phases: physics, shapes, shadows and overlay. There is also an entry for the whole time step. The "Potential FPS" value means, that if some phase were processed alone (without other phases) it should reach such a frame-rate. 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
| Time measurement "JOGLRenderingManager: physics" Minimum time = 0.93ms Maximum time = 26.69ms Average time = 2.18ms Potential FPS = 458.60
Time measurement "JOGLRenderingManager: shadows" Minimum time = 0.93ms Maximum time = 9.10ms Average time = 1.24ms Potential FPS = 804.70
Time measurement "JOGLRenderingManager: shapes" Minimum time = 2.35ms Maximum time = 11.25ms Average time = 2.87ms Potential FPS = 348.61
Time measurement "JOGLRenderingManager: time step" Minimum time = 4.76ms Maximum time = 190.89ms Average time = 9.34ms Potential FPS = 107.08
Time measurement "JOGLRenderingManager: overlay" Minimum time = 0.17ms Maximum time = 169.41ms Average time = 2.75ms Potential FPS = 363.73 |
|
|
|
|
irreversible_kev
|
 |
«
Reply #27 - Posted
2008-12-22 12:45:31 » |
|
Awesome - its so much smoother @ 390FPS+ It seems to be using about 90% of one core and 60% of another core for an overall CPU usage of about 36% over 4 cores. 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
| Time measurement "JOGLRenderingManager: physics" Minimum time = 0.20ms Maximum time = 10.40ms Average time = 0.27ms Potential FPS = 3681.57
Time measurement "JOGLRenderingManager: shapes" Minimum time = 0.13ms Maximum time = 2.79ms Average time = 0.16ms Potential FPS = 6249.57
Time measurement "JOGLRenderingManager: overlay" Minimum time = 0.01ms Maximum time = 87.81ms Average time = 0.30ms Potential FPS = 3367.42
Time measurement "JOGLRenderingManager: time step" Minimum time = 1.11ms Maximum time = 96.48ms Average time = 1.67ms Potential FPS = 598.87
Time measurement "JOGLRenderingManager: shadows" Minimum time = 0.27ms Maximum time = 29.04ms Average time = 1.06ms Potential FPS = 941.99 |
|
|
|
|
Eli Delventhal
|
 |
«
Reply #28 - Posted
2008-12-22 18:21:26 » |
|
Works great now on my Mac! Very cool demo. I was getting 60 fps and using 50% of my CPU. So, totally acceptable.
|
|
|
|
gholdys
|
 |
«
Reply #29 - Posted
2008-12-22 18:26:52 » |
|
Works great now on my Mac! Very cool demo. I was getting 60 fps and using 50% of my CPU. So, totally acceptable.
Glad to hear that. Cheers!
|
|
|
|
|