Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (483)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (550)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: Applet, Mouse IO, and Performance on: 2007-05-08 18:46:24
am i asking for too much accuracy or is it reasonable to expect a higher frame rate?
Do the frameworks / engines for java games all fix this problem?
Thanks for pointing me to GAGE Timer, but ideally i'd like to have a pure Java solution, if possible.
I notice Jake2 (the Quake2 port in java) says it's pure Java how could they manage to pull it off?
Is there a way of checking User IO on your own terms instead of AWT based? (Although Kill Game Programming in Java recommends AWT - as far as i've read)
If i'm asking riduculous questions just let me know... or just don't respond i guess...

actually i'm wondering if Jake2 takes the hit of a 15ms timer. It has a max 66 FPS, which is good, but those little blips in performance are annoying, so could that be fixed with better garbage collection handling? I guess i may try that route though my programd doesn't seem to be doing enough to require serious GC.
I'll read more KGPiJ

EDIT: am i taking the wrong angle on this? i suppose using native binaries becomes necessary for OGL so maybe i should just learn native binary linking and get on with it?
          I noticed something in a Java3D tutorial or something or other that mentioned a 'wakeuponawtevent' method.. thought that might help..
2  Game Development / Newbie & Debugging Questions / Applet, Mouse IO, and Performance on: 2007-05-08 14:03:26
Hi, thanks for reading,

I am doing some basic 'research' and i've written an Applet that animates a ball and moves a paddle using MouseMotionListener. The Applet implements Runnable, i got this idea from a tutorial somewhere, i say this because i'm not entirely sure how that's working. I know it fixed the problem i had where [i guess] the Applet Thread hogged the CPU and the IO was never processed.

My problem is that there are blips in performance. I can see the blips visually as well in the output on the console. I say output the currentTime - endOfLastIterationOfLoop, that's probably confusing so let me give it to you in pseudo code:

time1 = System.currentTimeMillis ();  // for first iteration.
while (true) {
     
        ball.animate ();

        
       time2 = System.currentTimeMillis();
         System.out.println (time2-time1);
         time1 = System.currentTimeMillis();
           
        repaint();
}

so the output is something like
...
...
...
0
0
0
0
0
0
15
0
...
...
...

I tried using Thread.sleep(), inserting a 10ms delay, which results in:

16
0
31
16
15
16

Mostly it's 16s and 15s but that occasional 31 bothers me. I suppose this is Garbage Collection?
Actually those zeros bother me too. Is this a matter of System.out.println (timeDiff) rounding the long value to zero? Or is this value actually zero? If the Thread is supposed to sleep why doesn't it? I understand it goes long because the timer on XP is ~15ms. And the 31ms delay seems to be ~double the 15 or 16.

I suppose i should do a test myself, but is this behaviour similar in an Application / WebStart ?
Would something like http://javolution.org/help?

And what about how this problem scales? If/When i have a large number of objects to animate and more IO to accept and more game logic to compute, what happens then? To me it seems it would get worse.

EDIT: thanks again!
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

CopyableCougar4 (18 views)
2014-08-22 19:31:30

atombrot (28 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (23 views)
2014-08-16 06:12:11

Rayexar (63 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (38 views)
2014-08-06 19:49:38
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59: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!