Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (601)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (649)
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();

so the output is something like

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


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

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]
Riven (23 views)
2015-07-27 16:38:00

Riven (13 views)
2015-07-27 15:35:20

Riven (18 views)
2015-07-27 12:26:13

Riven (8 views)
2015-07-27 12:23:39

BurntPizza (24 views)
2015-07-25 00:14:37

BurntPizza (36 views)
2015-07-24 22:06:39

BurntPizza (20 views)
2015-07-24 06:06:53

NoxInc (23 views)
2015-07-22 22:16:53

NoxInc (14 views)
2015-07-22 22:13:39

Jesse (36 views)
2015-07-22 03:10:36
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 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‑
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!