Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (108)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Too fast?!  (Read 1561 times)
0 Members and 1 Guest are viewing this topic.
Offline liminal

Senior Newbie




Java games rock!


« Posted 2005-01-11 00:09:30 »

I'm using the gage timer for an animation loop. Everything starts out fine with the animation limited to the framerate I set, but once the hotspot compiler does its optimizations, everything speeds up the maximum rate possible on my computer...

Have other people seen this issue or have suggestions? I can post my timing code if necessary.

Thanks,
Brian.
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #1 - Posted 2005-01-11 01:24:22 »

A few questions to help diagnose the problem:

1. How many FPS are you targetting?

2. Are you testing on Windows, Mac, or Linux?

3. Is this an Applet or an Application?

4. If it's an application, is the DLL loading and/or is this JDK 1.5?

Java Game Console Project
Last Journal Entry: 12/17/04
Offline MasterOfDisaster

Junior Member




O_o


« Reply #2 - Posted 2005-01-22 08:26:37 »

hi,

i experienced the same problem in two different games:

game 1: racing applet, target framerate 30fps, no gage timer
game 2: football game, target framerate 50fps, webstart application, gage timer used

i have the timer dll's installed on my windows machine.
i use j2sdk1.4.2_04.

it's strange, most of the time everything works fine, but then suddenly the fps jumps up dramatically (100-300 fps) which makes the games unplayable and racing time measurement becomes worthless.

any hints would be appreciated ...

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline liminal

Senior Newbie




Java games rock!


« Reply #3 - Posted 2005-01-22 14:42:46 »

Sorry, for taking so long to get back, but I've been distracted by life stuff...

JBanes, answers to your questions:

1) i usually target about 30 fps
2) windows
3) application
4) java 1.4.2_06 and the dll must be loading or else I can't see how the gage timer would be working.

I might try to work up a small test case later, but for now I'm stumped.
Offline Abuse

JGO Coder


Medals: 11


falling into the abyss of reality


« Reply #4 - Posted 2005-01-23 10:43:52 »

Quote

4) java 1.4.2_06 and the dll must be loading or else I can't see how the gage timer would be working.


if it doesn't find the dll, it falls back to the crappy currentTimeMillis().

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #5 - Posted 2005-01-27 12:48:36 »

Quote
Sorry, for taking so long to get back, but I've been distracted by life stuff...


My apologies as well. A few of these posts seemed to have slipped my attention.

Quote

1) i usually target about 30 fps
2) windows
3) application
4) java 1.4.2_06 and the dll must be loading or else I can't see how the gage timer would be working.


Number 4 can be checked by looking at the console on startup. If you see a stacktrace, the DLL is not loading. Would you be able to post your timing code? It should look something like this:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
AdvancedTimer timer = new AdvancedTimer();
long frameTicks = timer.getTicksPerSecond()/30;
long time = 0;

timer.start();

while(running)
{
  //draw stuff
 at.sleepUntil(time + frameTicks);
  time += frameTicks;
}


Let me know if that helps. :-)

Java Game Console Project
Last Journal Entry: 12/17/04
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (17 views)
2014-07-30 21:08:39

Riven (23 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (43 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43
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!