Jump to content

  • Log In with Google      Sign In   
  • Create Account

[java] URGENT - Major Applet issue


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 tjbrosna   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 November 2000 - 12:14 AM

I have developed a java applet game. However their is some major performace issues. The game is intended to run on browsers so I have only used jdk1.1.x.The game speed is really inconsistent. I need ideas to why as this is going out on a demo cd in a day or 2. It can run fine one machine(fps 20 - 30) and then on another machine with the same spec really slow(fps ~5).Put it this way, on a PI 133 it runs along fine and on a Athlon 800 with a Radeon 256 DDR it runs terrible so it cant be the machine, it must be the java runtime environment, virtual machine etc. Has anyone got any ideas to what I can do, where I can look for help or any suggestions at all?? Thanks for your help, T.J

Sponsor:

#2 Stiby   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 November 2000 - 12:29 AM

The problem may come from the browsers on the two machines as the specs show they are radically different, and that means the amount of installed software will differ so the best idea is to run the game in Applet viewer on both machines and see how they compare (no slow down from the parent browser).

I get a lot of slow down from my OS whilst using the keyboard due to the key repeat fired from the OS when you hold a key down, apprently this has a major effect on java games running on Posix based machines more than Windows/MacOS.

Well good bug hunting other wise



Phillip Stiby BSc(HONS)

I program therefore cant spell!

#3 snowmoon   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 November 2000 - 12:49 AM

Here are some things to look for.

1) See if the slowdown is linked to any particular color depth. 8 bit and 32 bit seem to work alot better than 16 bit displays.

2) If you relly need consistancy, consited using the java plug-in. At least then you can be guanteed that you will be using the sun jdk.

3) If you go with the plug-in consiter using the new BufferdImage in Java 1.2 in place of Image, as I have consiterable improvments in performace using this insted.

4) Make sure your drawing code is happening independant of other activity.

Otherwise just overall bug hunting. Make sure when testing to run it under netscape, appletviewer, and MSIE if you opt not to use the plug-in.

Without looking at the source there''s not alot more I can do.

#4 tjbrosna   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 November 2000 - 01:17 AM

Changing the color depth dosent do anything. It runs fine under jdk1.2.2 and jdk1.3 appletviewers. If i open up jbuilder in the background(doing nothing, so it must change the jre) the game runs fine in the netscape and MSIE. This game loads in a load of images approx 50 gifs and 5 jpgs. Could this make a difference(I doubt it)??

Seeing the code is not an option as its way too big but heres a stripped down version of the main game loop:

//-------------------------------------------//
public void run()
{
while(Thread.currentThread() == gameThread)
{
switch(gameStatus)
{
case PLAYING:
{
if (zombieLevelRef.isFinished())
{
if(currentLevel == 2)
{
setEnding();
gameStatus = ENDING;
}
else
gameStatus = CHANGING_LEVEL;
break;
}
zombieLevelRef.play(offScrGC);
break;
}

// Loads of other case to handle other game states
//....
}
repaint();
try
{
Thread.sleep(20);
}
catch(InterruptedException e)
{}
}
}

Thanks again,
T.J



#5 snowmoon   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 November 2000 - 05:20 AM

So I don''t understand.... where are you having low framerate problems?

#6 tjbrosna   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 November 2000 - 11:02 PM

The applet size is 800x600 which is probably why the frame rate is so slow.The player area is 800x400 and the interface is 800x200. So does anyone think this is the problem??

T.J

#7 Fovster   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 November 2000 - 12:48 PM

Make sure you have JIT enabled in the browser and that the java-console isn''t on Just to make sure..



''''2+2=5 for extremely large values of 2.''''




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS