Weird rendering glitch

Hello,

One of my customers is experiencing a very strange problem when trying to access my game. It’s a Java Applet. Just to be clear - this is the applet loading screen. It does it when displaying the game too. He says it’s happening in all 3 browsers (ie, firefox, chrome). Given that it’s happening on the applet load screen I feel like the HTML must be the culprit, but to be honest I’m completely stumped here.

Here’s a screenshot:

http://www.tacticstudios.com/downloads/messed_load_2.jpg

Here’s how it’s supposed to look:

http://www.tacticstudios.com/downloads/correct_load.jpg

Here’s another example of the login screen (this is in-game code)

http://www.tacticstudios.com/downloads/messed_login_2.jpg

and how it’s supposed to look:

http://www.tacticstudios.com/downloads/correct_login.jpg

Ignore the debug info - was just some stuff I printed to help debug the problem.

Anyone seen this before or have any idea what’s going on here? Most of my customers have no problem. Website is www.immortal-empire.com

It’s probably a browser problem. I would ask your customers what browser they’re using if I were you. It looks like the applet is not being repainted after it is invalidated. Calling the applet’s repaint() method after it loads might fix the login screen. As for the loading screen, consider using this kind of loading screen instead.

Your load screen appears to just be an animated gif
http://www.immortal-empire.com/ie_loadscreen.gif
How are you displaying it?

Yeah the browsers are IE, Mozilla, and Chrome. All 3 it’s doing this on his machine. I’ve tried all three locally and they all work fine for me.

The applet calls repaint() on the Canvas every frame. ie. there is a main thread that runs the game and calls the repaint method every X milliseconds. I add the main Canvas to the JApplet’s ContentPane on applet initialization. I can try calling repaint() on the Applet itself… will let you know how that goes.

For the load screen (which I’m less concerned about if the game ends up working fine) the HTML is as follows:


<html>
<title>Immortal Empire</title>
<link rel="stylesheet" href="iempire.css" type="text/css">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<body>
<TABLE WIDTH=100% border=0 cellpadding=0 cellspacing=0>
<TR ALIGN=CENTER HEIGHT=80%>
<TD ALIGN=CENTER VALIGN=CENTER>



<applet code=Main.IsoGame.class width="800" height="600">
<param name="boxbgcolor" value="#000000">
<param name="boxfgcolor" value="#000000">
<param name="progresscolor" value="#9B5000">
<param name="boxborder" value="false">
<param name="image" value="ie_loadscreen.gif">
<param name="cache_archive" value="IsoGame.jar,IsoImages_interface.jar,IsoImages_game.jar,IsoSounds_interface.jar,IsoSounds_game.jar,IsoMusic_bossbattle.jar,IsoMusic_cinematic_standard.jar,IsoMusic_cinematic_vuldreth.jar,IsoMusic_desert.jar,IsoMusic_dialog_dazo.jar,IsoMusic_dialog_elder.jar,IsoMusic_dialog_maielle.jar,IsoMusic_grasslands.jar,IsoMusic_menu_0.jar,IsoMusic_menu_1.jar,IsoMusic_volcanic.jar,IsoLib_jogg.jar,IsoLib_jorbis.jar,IsoLib_tritonius.jar,IsoLib_vorbis.jar">
<param name="cache_option" value="Plugin">
<param name="cache_version" value="0.0.3.4,0.0.1.D,0.0.1.C,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8">
You cannot play this game because you do not have Java installed.  Java is a free download, please acquire it from <A HREF="http://www.java.com" target="_blank">http://www.java.com</A>.
</applet>
</TD>
</TR>
</TABLE>
</body>
</html>

It took me a while to settle on this type of deployment since it handles JAR caching and JAR indexing correctly in all browsers without needing javascript. I don’t use JNLP - but maybe I should?

Do you hang on to the Graphics object from the paint/paintComponent call? That can cause interesting problems on Windows.

I store the Graphics object of the backbuffer as a member variable of the main frame. It’s just an image I use for double buffering to prevent flickering. I don’t store the Graphics object of the paint() method that’s passed as a parameter.