Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (426)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (466)
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  
  Arcane Tactics: applet loader  (Read 4085 times)
0 Members and 1 Guest are viewing this topic.
Offline Nate

JGO Kernel


Medals: 129
Projects: 3
Exp: 14 years


Esoteric Software


« Posted 2011-12-10 04:33:05 »



I've resurrected one of my abandoned projects, Arcane Tactics. The game is real time tactics with a fantasy setting. The game isn't ready to play yet, but can you guys give the applet a try? It is here:
http://arcanetactics.com/applet/
The server isn't running yet! I know "Play" doesn't work. I'm specifically looking to make sure the applet works everywhere. Any feedback on the applet loader would be great. Smiley

So far, I have fleshed out a party creation UI and spent quite a bit of time on the applet loader (anything to keep me from finishing the game! wtf!?). It is based on LWJGL's loader, but with a few changes for a hopefully better user experience. The progress bar is glowing and smoothly animated. It is constantly (or almost always) moving, so you never feel like it has hung. Also it is weighted toward the end. It artificially fills up too fast to give the user the feeling it is almost done sooner. It fades out for a more pleasant transition to the game. I dimly draw the applet version in the corner, to remove confusion as to whether then cache is being used.

I've tested it on Windows in Firefox, IE6, and Chrome and it seems to work well. It doesn't work on OSX for some reason. I don't have OSX myself, but others say the loader works but the game never starts, they just get a black screen. It's a mystery, there are no exceptions thrown or any errors in the OSX console. Maybe someone here has some insight why?

I have OSX in VMware and I fixed problems until it fails due to some OpenGL problem. I thought it was because my VM doesn't have hardware acceleration, but alas it still doesn't work on real hardware. At any rate, here is the exception running in VMware:
Quote
java.lang.NullPointerException
   at org.lwjgl.opengl.GL11.glGetString(GL11.java:1771)
   at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.initiateGLInstances(LwjglGraphics.java:200)
   at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setupDisplay(LwjglGraphics.java:156)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:138)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:130)

This doesn't seem like a nice way for LWJGL to die. How should I modify libgdx to avoid an NPE and throw an exception if LWJGL can't start up?

I mentioned in this thread a simple error collecting mechanism and I'm using it in the applet. So, if the applet doesn't show up for you, likely we'll be able to see your error here:
http://arcanetactics.com:8080/at/error?p=view

I'm sorry I wasn't able to make my applet loader changes generic and contribute back to LWJGL. I burnt hours on it already and it would take some effort to get everything I want in a way that is also usable for any game. I do think some of what I did, like the smoothly animating progress bar, would be useful for all LWJGL applets. Maybe someone would port some or all of what I've done or write something similar from scratch? Here is my code:
http://arcanetactics.com/temp/AppletLoader.java
It has been formatted, so for your diffing pleasure, here is the original (which is from LWJGL 2.8.2) formatted with the same formatter:
http://arcanetactics.com/temp/AppletLoaderOriginal.java
I hardcoded all the settings, ripped out a couple things (eg, no animated gifs), and did what I needed for my progress bar, fading out, etc.

Beyond that, I think LWJGL would benefit from promoting an easy way to get running in an applet. Eg, put all your JARs in a directory, run something, and now you have everything signed and your applet is ready to be deployed. I don't care how it's done, but I can't help mention that Scar could do it. Smiley It has an lwjglApplet method, but that only works out of the box if Scar is already building your project. Figuring out Scar ruins the whole idea with making it super easy to go from JARs -> working applet. Scar could still be used though, for its utility methods. Eg, here is part of my build script for Arcane Tactics:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
String keystore = ...;
String alias = ...;
String password = ...;
keystore(keystore, alias, password, "Esoteric Software", "Arcane Tactics");

String distDir = ...;
String appletDir = ...;
new Paths(distDir, "**/*.jar", "*.html", "*.jpg").flatten().copyTo(appletDir);
for (String jarFile : new Paths(appletDir, "*.jar")) {
  String fileName = fileName(jarFile);
  if (fileName.equals("appletloader.jar")) {
    sign(unsign(jarFile), keystore, alias, password);
    continue;
  }
  if (fileName.contains("native")) {
    lzma(sign(unsign(jarFile), keystore, alias, password));
    continue;
  }
  sign(unpack200(pack200(unsign(jarFile))), keystore, alias, password);
  lzma(pack200(jarFile));
}

Note this is all plain Java code, it just has a static import for Scar.*. As you can see, the whole generate keystore, unsign, pack200, unpack200 (to normalize the JAR), sign, pack200, and then lzma is pretty intense. Imagine trying to write an Ant script for that nastiness! It would also be nice if it could generate and/or update the JARs section in the HTML file. Is a tool like this worth the effort? Would the LWJGL cats promote and maintain it?

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 70
Projects: 15


★★★★★


« Reply #1 - Posted 2011-12-10 09:37:02 »

Really nice work, especially like the smooth always moving progress bar which IMO would make a really nice addition to the official AppletLoader.

One feature of the AppletLoader which I think has a lot of potential is its headless mode, unfortunately just not had the time to document it properly and write examples for it yet. Basically it enables you to write the appletloader loading screen in html/javascript, thus allowing endless customisation possibilities (basically whatever you can do with javascript/html including putting advertisement banners on it). There is a rather old example here to briefly demonstrate it, probably won't work, especially on mac, since that example uses a really old lwjgl version and the html/javascript code isn't tested properly but it should give a rough idea of what is possible.
Offline dishmoth
« Reply #2 - Posted 2011-12-10 11:11:24 »

The loader worked fine for me (Windows Vista, IE9) and the game so far looks magnificent.

Two words: Spider Assassin. Cool

I mentioned in this thread a simple error collecting mechanism and I'm using it in the applet.

Obviously people will want to read that whole thread, and perhaps play the game described there, in order to fully appreciate the significance of your error collecting approach.  (Yay!  Free publicity! Grin )

Simon

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

Senior Member


Medals: 3
Projects: 2



« Reply #3 - Posted 2011-12-10 11:30:36 »

Wow! The graphics is really smooth, and the title screen is impressive. How did you create that?
Offline thaaks

Junior Member


Medals: 1
Projects: 1



« Reply #4 - Posted 2011-12-10 16:09:39 »

Looks great and worked fine for me (Windows 7 32-bit, Firefox 8.0.1)!

The glowing progress bar is cool and so is the title screen. And tweening menu dialogs are also cool!

A nice tool to wrap up my game jars with all required LWJGL stuff to deploy as an "applet to go" would indeed be a great thing to have!

I think all the deployment trouble we have with Java (Webstart JNLP files, Applet signing/packing, Applications without .exe on Windows and included JRE) is one of the biggest reasons Java isn't used as much for game development as it could  Sad

So whatever tool can help here (for example like Kappa's fat jar tool JarSplice or LWJGL's AppletLoader) is one step forward!

Offline me

Senior Member


Projects: 4


Java games rock!


« Reply #5 - Posted 2011-12-10 21:47:29 »

Hello Nate,

Your applet on my mac mini gave this in the system.log file
(Both Safari and Firefox)

Dec 10 21:22:44 www [0x0-0x15f15f].org.mozilla.firefox[59583]: Exception in thread "AWT-AppKit" netscape.javascript.JSException: Plugin instance for applet ID 1 was already released
Dec 10 21:22:44 www [0x0-0x15f15f].org.mozilla.firefox[59583]:    at sun.plugin2.main.server.LiveConnectSupport.getInfo(LiveConnectSupport.java:405)
Dec 10 21:22:44 www [0x0-0x15f15f].org.mozilla.firefox[59583]:    at sun.plugin2.main.server.LiveConnectSupport.shutdown(LiveConnectSupport.java:41)
Dec 10 21:22:44 www [0x0-0x15f15f].org.mozilla.firefox[59583]:    at sun.plugin2.main.server.JVMInstance.unregisterApplet(JVMInstance.java:1376)

(These messages don't appear when running the lwjgl applets from the 16kb contest)

Not sure if it helps, but a quick google search hinted towards mixed 32-bit / 64-bit libraries.
Might be something you can work with?!

Best regards from
M.E.




M.E.
--------
Offline Nate

JGO Kernel


Medals: 129
Projects: 3
Exp: 14 years


Esoteric Software


« Reply #6 - Posted 2011-12-12 01:23:39 »

Thanks everyone for trying it out. Smiley Got a couple exceptions I didn't expect.

One feature of the AppletLoader which I think has a lot of potential is its headless mode, unfortunately just not had the time to document it properly and write examples for it yet. Basically it enables you to write the appletloader loading screen in html/javascript, thus allowing endless customisation possibilities (basically whatever you can do with javascript/html including putting advertisement banners on it). There is a rather old example here to briefly demonstrate it, probably won't work, especially on mac, since that example uses a really old lwjgl version and the html/javascript code isn't tested properly but it should give a rough idea of what is possible.
It sounds a little scary. Potential for things to go wrong is even higher than applets, which is already not great.

Wow! The graphics is really smooth, and the title screen is impressive. How did you create that?
Thanks.  Cool It's just two images drawn on top of each other with blending.

Thanks for the exception, M.E. This is the only clue I have for OSX. Does it make any sense kappa? Would it cause a black screen  after loading? Is there anything I can rip out that might help?

Offline h3ckboy

JGO Coder


Medals: 5



« Reply #7 - Posted 2011-12-12 07:46:51 »

worked fine for me, Ithink that your menu transitions are sick though!
Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #8 - Posted 2011-12-12 07:58:05 »

Oooh I got this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
java.lang.Exception: JNLPClassLoaderUtil: couldn't find a valid JNLPClassLoaderIf
   at com.sun.jnlp.JNLPClassLoaderUtil.getInstance(Unknown Source)
   at com.sun.jnlp.JnlpLookupStub.findService(Unknown Source)
   at com.sun.jnlp.JnlpLookupStub.access$000(Unknown Source)
   at com.sun.jnlp.JnlpLookupStub$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at com.sun.jnlp.JnlpLookupStub.lookup(Unknown Source)
   at javax.jnlp.ServiceManager.lookup(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.badlogic.gdx.backends.lwjgl.LwjglNativesLoader.<clinit>(LwjglNativesLoader.java:33)
   at com.badlogic.gdx.backends.lwjgl.LwjglApplet.<init>(LwjglApplet.java:44)
   at com.esotericsoftware.arcanetactics.ArcaneTacticsApplet.<init>(ArcaneTacticsApplet.java:9)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
   at java.lang.reflect.Constructor.newInstance(Unknown Source)
   at java.lang.Class.newInstance0(Unknown Source)
   at java.lang.Class.newInstance(Unknown Source)
   at com.esotericsoftware.arcanetactics.AppletLoader.switchApplet(AppletLoader.java:1074)
   at com.esotericsoftware.arcanetactics.AppletLoader$3.run(AppletLoader.java:414)
   at java.awt.event.InvocationEvent.dispatch(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)


Really smooth and really cool graphics, great job! Smiley
How did you do that highlighted loader bar? Tongue

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 70
Projects: 15


★★★★★


« Reply #9 - Posted 2011-12-12 12:09:11 »

Thanks for the exception, M.E. This is the only clue I have for OSX. Does it make any sense kappa? Would it cause a black screen  after loading? Is there anything I can rip out that might help?
If a NullPointerException is thrown in LibGDX's main loop -> graphics.setupDisplay(); -> initiateGLInstances() by the following call:
String version = org.lwjgl.opengl.GL11.glGetString(GL11.GL_VERSION);
then yeh it does look like it'll crash the LibGDX applet thread as it isn't caught and therefore cause a black screen.

Really odd though why the glGetString call would throw a NullPointerException once the Display has been created. It does look like some sort of driver or lwjgl bug, you could try comment out that line (or catch exception) on OS X since you can assume any OS X 10.5+ will have OpenGL 2.1 to see if you get any luck. Btw your error collecting mechanism is pretty cool, would be nice if it also displayed a bit more information about the system it happened on like the OS and Java Version.

Also which version of LWJGL are you using?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Nate

JGO Kernel


Medals: 129
Projects: 3
Exp: 14 years


Esoteric Software


« Reply #10 - Posted 2011-12-12 21:45:28 »

worked fine for me, Ithink that your menu transitions are sick though!

Thanks. Smiley It's easy, just Interpolation.swing.apply. Run LwjglTestStarter and choose InterpolationTest and it'll show a little graph of all available interpolators, as well as let you test each one.



Oooh I got this:
Really smooth and really cool graphics, great job! Smiley
How did you do that highlighted loader bar? Tongue
Ehh, that code is in a try/catch(Throwable), it should never be thrown or logged! WTH? Sounds like the applet did work though. Thanks. Smiley The loader is Java2D, the bar and glow are separate images and are shown more and more using clip, just like the LWJGL loader. Then the alpha of the glow is modulated. Most of my effort was making the bar continuously grow, even when the download isn't being updated. Just assuming the download is somewhere just behind the visuals is sneaky, but makes it buttery smooth and makes the user feel like, hey, it's almost done! :p

Really odd though why the glGetString call would throw a NullPointerException once the Display has been created. It does look like some sort of driver or lwjgl bug, you could try comment out that line (or catch exception) on OS X since you can assume any OS X 10.5+ will have OpenGL 2.1 to see if you get any luck. Btw your error collecting mechanism is pretty cool, would be nice if it also displayed a bit more information about the system it happened on like the OS and Java Version.

Also which version of LWJGL are you using?
M.E.'s exception was in LiveConnectSupport though, which doesn't seem related to LWJGL or my stuff. libgdx should probably catch the NPE and throw "Hey, your computer really blows!". Smiley Good point on the error reporting, knowing the OS, Java version, OpenGL, and other info could be very helpful.

Ack, very good good point on the LWJGL version. libgdx is a bit behind. Should have upgraded before bothering anybody! Smiley Will do that soon and see what happens.

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 70
Projects: 15


★★★★★


« Reply #11 - Posted 2011-12-12 21:54:06 »

M.E.'s exception was in LiveConnectSupport though, which doesn't seem related to LWJGL or my stuff.
Oops, sorry, was looking at the wrong error. LiveConnect has always been a little flaky, although it was fixed/rewritten in Oracles plugin2, the mac implementation is still a little rough, if you're not using any live connect or accessing javascript from java in any other way then I have no idea how or why its throwing that error. Some info on the OS X and Java version would have been useful here Smiley

Ack, very good good point on the LWJGL version. libgdx is a bit behind. Should have upgraded before bothering anybody! Smiley Will do that soon and see what happens.
Yup, do keep in mind that any LWJGL version older than 2.8.0 will no longer work as an Applet on OS X 10.6+ now due to Apple's plugin2 changes. If it is older than 2.8, you will indeed just get a blank screen although the applet will be running.
Offline philfrei
« Reply #12 - Posted 2011-12-12 23:41:54 »

Beauty!

I like those bouncy menu transitions a lot. The interpolation formula adds the illusion of weight and mass.
The glowing progress bar--color & themes matching the lettering: I was hypnotized and forgot how long it took to load.

winXP Home, sp3
Java 6.29
firefox 8.0

"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Offline impaler

Senior Newbie





« Reply #13 - Posted 2011-12-13 17:24:01 »

You just made many of us look bad! It's very neat and polished.

It works on Windows 7 on Chrome, FireFox and Opera.

Couldn't get it working on Mac OS (both Snow Leopard and Lion). After it loads it fades to black and that's it.
Switched on the java console (Utilities -> Preferences -> Java Settings -> Console on  - I had difficulties to find it) but couldn't get hold of any logging and the servlet reported no error.

I will give it a go on Linux (Ubuntu) too and once these things are ironed out and the game finished I'm sure it will be a great asset for the Chrome Store.

As for the applet loader, I always avoided them but it seems that you did a terrific job to take out most of the pain associated with it.

Kudos!
Offline StephR

Senior Member


Medals: 9



« Reply #14 - Posted 2011-12-13 20:31:37 »

A truely brilliant and mesmerizing presentation screen... And the sprites seen in the Edit Party section are very promising... We can only ask for more !
Offline Nate

JGO Kernel


Medals: 129
Projects: 3
Exp: 14 years


Esoteric Software


« Reply #15 - Posted 2011-12-20 04:06:11 »

Yup, do keep in mind that any LWJGL version older than 2.8.0 will no longer work as an Applet on OS X 10.6+ now due to Apple's plugin2 changes. If it is older than 2.8, you will indeed just get a blank screen although the applet will be running.
Oh god. Mystery solved! ::head desk:: libgdx is still on 2.7.1! I'll update soon.

You just made many of us look bad! It's very neat and polished.
Ha! Thanks, but it isn't a game yet. Not even close!

I've done some work on the game and the server is running now:
http://arcanetactics.com/applet/
As soon as two players connect, they are matched up. You can open two tabs if you want to play against yourself. Warning: it isn't fun yet! Undecided The cleric and wizard are useless until they level up once. Eg, the wizard doesn't have a fireball and cleric doesn't have heal until you pick your first talent. Warrior does too much damage. Probably too many hit points (~1000) for units that can only deal 50 damage. The list goes on. I'll create some more talents before really focusing on balancing gameplay.

I did the work on Scar discussed above. You can easily deploy JWS apps and LWJGL applets with it, see here:
http://www.java-gaming.org/topics/easily-deploy-jws-and-applets-with-scar/25342/msg/218118/view.html#msg218118

Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #16 - Posted 2011-12-20 06:37:54 »

That was really cool. Loved the flip animation when a new game starts. How do you play? I connected against someone and start randomly attacking their players. Unfortunately for the opponent, I was annihilating their players so they quit Grin

Offline Nate

JGO Kernel


Medals: 129
Projects: 3
Exp: 14 years


Esoteric Software


« Reply #17 - Posted 2011-12-20 16:28:48 »

Haha... to play you click your guys, and kill the other guys. It isn't balanced very well now, so unfortunately it isn't very fun yet. The fun is supposed to come from customizing your guys with tons of different synergistic talents, that is the theory at least.

Offline AurelienRibon

Senior Newbie


Medals: 3


Toolmaker, yeah.


« Reply #18 - Posted 2011-12-20 16:54:45 »

Neat! I love the style, very polished Cool
In my opinion, tweens are like particles: small details providing a huge extra user experience!

Don't know if you saw that wip, but it may interest you.

Pages: [1]
  ignore  |  Print  
 
 

 
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!