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   
Pages: [1]
  ignore  |  Print  
  Looking for the "Smooth Applet Loader" Grall ? yet another try ... (Updated 3)  (Read 5934 times)
0 Members and 1 Guest are viewing this topic.
Offline DzzD
« Posted 2008-03-13 23:37:07 »

Working on a Smooth Applet loader a cupple of monthes ago, I have now reviewed the whole and finally ends up with a smaller, easier and lighter version, follow the links for details, source files and sample:

http://dzzd.net/demo/ROAD/

It may be compatible FF/IE/Safari & all JVM

Note that it works best with IE6, enven if it works with FF, unfortunatly FF seems to not really like applets : hanging, unkilled process, exception....

EDIT:
there is a know issue with FF (wich is a FF/Java bug...on sockets) about security exception as the sample applet is not the subject of this thread this is not an issue for the Applet Loader Script, to avoid this bug JVM warmup is disable in script for FF this one can be enable for applet not using socket

EDIT: update 3
try to correct FF issue using a warmup applet that make a server connection before anycall to liveconnect

Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #1 - Posted 2008-03-14 09:44:36 »

Applet didn't start on FF 2.0.0.12, WinXP, Java 6. The Java loading screen also flashed by between the spinning thing and "loading" screen, but then it was just stuck at the loading screen. Tried refresh and reload, but no luck. There was no loading progression on either FF or IE, but maybe it was just that quick. Worked fine with IE7.

Offline DzzD
« Reply #2 - Posted 2008-03-14 15:06:27 »

Quote
Applet didn't start on FF 2.0.0.12, WinXP, Java 6
yep as explained abve this is a kow bug of the applet with FF due to a FF/Java bug, this dont care this is not a Applet Loader bug, if you see the loading bar than it mean that applet is loaded and started.

Quote
There was no loading progression on either FF or IE, but maybe it was just that quick.
yep that's true, needed ressources are very small so they may load in a seconde

thank's for your feedback

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

Junior Member





« Reply #3 - Posted 2008-03-14 17:31:15 »

I had the same problem - I thought it was Windows-only, but I just got a report it happens on Linux too. My workaround is to not use LiveConnect if the server is a virtual named-based host.
The bug is here:
http://bugs.sun.com/view_bug.do?bug_id=6622150


Offline DzzD
« Reply #4 - Posted 2008-03-14 18:39:11 »

Thanks I have read about this bug, this is too bad this avoid the warmup for FF....

what is strange is that I was thinking that I remove liveconnect for firefox as well as safari, I have no more this bug here ... with FireFox 2.0.012 I can reproduce bug here and so I am unable to correct Sad

I use the following JS to detect FireFox :
var firefox=(navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);

@Jojo, do you still have this bugs ?

plz, anybody else able to test with FF and give some feedbacks  ?

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 781
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #5 - Posted 2008-03-14 19:07:13 »

Just tested with FF 2.0.0.12

It hangs on "loading" with darkgreen/darkblue progressbars


Works with Opera 9.25 and IE7

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline brackeen

Junior Member





« Reply #6 - Posted 2008-03-14 19:27:08 »

DzzD, you should be able to avoid LiveConnect altogether on FF. Ironically, this works fine in FF:

applet.getAppletContext().showDocument(new URL("javascript: notify_appletLoaded();"));
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 781
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #7 - Posted 2008-03-14 19:33:46 »

I'm really dying for a smooth user-experience for applets.

I just convinced my boss to use applets for a serious webbased application (where users are not afraid to install Java).

Having everything work smoothly once they got Java installed, would be terrific.


What's the (upcoming?) license like?

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline DzzD
« Reply #8 - Posted 2008-03-14 20:07:04 »

I did not really know that I can licensing such works, What can be done ?  is it necessary ? dont really know, I guess it will be free, just try to keep the files header as they are.

I think I found a nice workaround for FF and I have updated web site, not perfect but better.

feedbacks and especially FF one, are welcome ?

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 781
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #9 - Posted 2008-03-14 20:57:58 »

Nothing changed in FF, it still hangs on the two progressbars Undecided

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DzzD
« Reply #10 - Posted 2008-03-14 23:35:00 »

thanks for your help braken, I remove all liveconnect and no more monitor isactive for FF.... it seems that fortunatly FF hang so much that it show applet only once it is loaded when applet is build by javascript.

Riven, I made an update and I think the new verion should be ok now but I cant be sure, so let me know if all works fine for you ?


I also found here a clear explanation of this bug wich has signaled to both mozzila and sun bug database:
http://oueb.org/AppletFireFoxLiveconnectBug.html


Offline Riven
« League of Dukes »

JGO Overlord


Medals: 781
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #11 - Posted 2008-03-14 23:45:18 »

Works! Cheesy

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline DzzD
« Reply #12 - Posted 2008-03-14 23:55:59 »

nice,

so it is really easy to implements it only requiere some few modification on the HTML

1) in the header of the web page the javascript must be added:
1  
2  
3  
<HEAD>
<SCRIPT language=JavaScript src=SmoothApplet.js></SCRIPT>
</HEAD>


2) Applet tag name have to be modified with APPLETLOADER as below
1  
2  
3  
4  
5  
6  
7  
<APPLETLOADER 
   archive="LIB/dzzd.jar,LIB/extension.jar"  
   code   = "Road.class"
   width   = "100%"
   height   = "100%"    
   MAYSCRIPT>
</APPLETLOADER>


3) the startApplets() function must be called once loaded, this can be achieved by jscript or by adding onload attribute
1  
<BODY onload="startApplets()">


4) finally this requiere that two files to be on the server:
http://dzzd.net/demo/ROAD/SmoothApplet.js => contain the requiered script
http://dzzd.net/demo/ROAD/jvmLoader.html => requiered to load a miniapplet to warmup JVM

5)just one more point Smiley you may embed Appletloader tag in another HTML element showing that applet is loading as below
1  
2  
3  
4  
5  
6  
7  
8  
9  
<DIV style="background-image:url(INIT.GIF);background-repeat:no-repeat;BACKGROUND-POSITION: 50% 50%;">
<APPLETLOADER
   archive="LIB/dzzd.jar,LIB/extension.jar"  
   code   = "Road.class"
   width   = "100%"
   height   = "100%"    
   MAYSCRIPT>
</APPLETLOADER>
<DIV>

replace INIT.GIF by your own splash screen

that's all!

Online CommanderKeith
« Reply #13 - Posted 2008-03-15 03:13:31 »

Worked fine on WinXP, firefox 2.

I did notice the orange java loading logo the very first time it loaded, but that's not a big deal.

I'm not sure what version of java firefox is using for applets.  (maybe it would be cool to display the jvm version in your demo applet? )

The flash-style loading thing is great, nice work.

Offline g666

Junior Member





« Reply #14 - Posted 2008-03-15 11:03:34 »

i dont want to be so negative but i dont see what this is meant to fix. the problem is imo the 1-2 seconds of  browser freeze that you get when the vm loads for the first time and you get that with this too.  Undecided

desperately seeking sanity
Offline DzzD
« Reply #15 - Posted 2008-03-15 12:36:16 »

Quote
the problem is imo the 1-2 seconds of  browser freeze that you get when the vm loads for the first time


that's true that hang is too bad, but it cant be removed  Sad, personnaly I dont think it is a big problem, I am more worry about the hang happening on applet start (more visible on FF), maybe IE give a lower priority to the applet so it not freeze ?

Quote
I did notice the orange java loading logo the very first time it loaded, but that's not a big deal.

too bad Sad, this is really hard to polish that... I am unable to reproduce that on my computer even with java cache off, and if I remove it for FF than the security exception comeback... the only way that can work is maybe what bracken explain above but I would like to make this script independant of applet

Offline princec

JGO Kernel


Medals: 362
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #16 - Posted 2008-03-22 17:51:12 »

One crafty idea is to put your applets on a second page, and have your landing page have a 1x1 applet in it that does nothing to prime the VM. By the time the reader has read the landing page and found the "Click Here To Play!" link that goes to the second page (or maybe creates the applet with DHTML, I dunno...) several handy seconds will have passed in which time the JVM will have booted. Hopefully.

Is there no way of asynchronously doing things in JavaScript? (Like, a separate Thread?) Maybe Flash could do it? Then you could asynchronously load the JVM.

Cas Smiley

Offline DzzD
« Reply #17 - Posted 2008-03-22 19:40:22 »

good idea, using a second window could be a good idea to force a different process/thread, I will do some try on that but I think that maybe popup blocker will make this solution hard to make, anyway this merit a test.

Quote
Is there no way of asynchronously doing things in JavaScript? (Like, a separate Thread?) Maybe Flash could do it? Then you could asynchronously load the JVM.
I think that can not be done with JS , using flash is a funny idea  Smiley but it will make user requiere java & flash too run applet, it make maybe things too more complexe and increase the risk that the applet dont start.

Offline DzzD
« Reply #18 - Posted 2008-03-25 11:14:51 »

the FF bug about LiveConnect have moved on SUN DB bug...  so if you have vote for this one you should do it again here :
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6669818

NB: as explained in the bug description, it seems that there is a workaround for socket security exception with FF and liveconnect.

Offline DzzD
« Reply #19 - Posted 2008-04-02 21:43:36 »

I try the solution proposed in the sun bug thread using the following applet as warmup applet :

Quote
import java.applet.Applet;
import java.net.URLConnection;
import java.io.IOException;

public class SmoothApplet extends Applet {
   
   public void init()
   {
      try
      {
         URLConnection uc=getCodeBase().openConnection();
         uc.connect();
      }
      catch(IOException ioe)
      {
         ioe.printStackTrace(System.out);
      }
      

   }

}

this way the FF bug should removed, I have updated two Applet :
http://demo.dzzd.net/ROAD/
http://demo.dzzd.net/ROAD4/


anyone able to give me some feedback on FF plzzzz ?

EDIT:
It run fine on my computer : XP with IE6 / Safari3 / FF2 but I would like to be absolutly sure that it run almost everywhere

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 781
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #20 - Posted 2008-04-02 21:57:10 »

both work in FF on Vista x64

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline DzzD
« Reply #21 - Posted 2008-04-02 22:34:04 »

thanks,

something strange.... I just realise that it seems fixed using  :

http://demo.dzzd.net/ROAD/
http://demo.dzzd.net/ROAD4/

rather than

http://dzzd.net/demo/ROAD/
http://dzzd.net/demo/ROAD4/

 Huh

and they both point on the same directory...

Offline SimonH
« Reply #22 - Posted 2008-04-03 00:15:00 »

oops!
ROAD;
1  
2  
3  
4  
5  
6  
7  
8  
 File Version     : 0
 Mesh Version     : 0
 Units            : 0.0
 Background Color : 0

Exception in thread "Thread-7" java.lang.NullPointerException
   at Road.run(Road.java:120)
   at java.lang.Thread.run(Unknown Source)


FF 2.0.0.13 Win2K java 1.5

ROAD4 works fine! (bit too much console output!) - Can you loosen the steering a bit?  Smiley

People make games and games make people
Offline DzzD
« Reply #23 - Posted 2008-04-03 00:46:59 »

Quote
oops!


yup the null pointer come from the ACE socket exception...  Sad,

which url did you use ?

http://demo.dzzd.net/ROAD/ //should work

or

http://dzzd.net/demo/ROAD/ //should not work

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.

CopyableCougar4 (17 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 (22 views)
2014-08-16 06:12:11

Rayexar (61 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!