LWJGL16k

I’ve yet to see a LWJGL-app that ran on all systems the first run. The “Your games here” forums is flooded with stackttraces.

We are talking about an unknown computer, with unknown drivers here. It might crash for any random reason, while your code is actually valid.

You are reversing it here. I said that it might not run on all systems. I didn’t say that it would only run on a few.

I’m wondering what makes you say this. It’s completely obvious the judge should not attempt to fix anything. If it doesn’t start, that’s the end of the story.

Shrug.

What a lame response. Take a look at J4K. There were no such weird rules (like the sandbox environment), and it was a huge success. The feedback in the forum resulted in important stacktraces and thus the bug-fixes. No need to enforce that. It regulates itself.

You guys give me a headache.

::slight_smile:

Who cares about certificates, just write your damn game and webstart it from jgf or whatever; you can sort all that out when you actually have something to submit… :-*

After some careful looking-arounding, I found the biggest problem, and a good solution to it:

I’ll join the competition if blahblahblah isn’t involved in it.

Take a look at J4K. There were no such weird rules (like the
sandbox environment)

Fullscreen.

You need permissions for that.

With that extension you don’t need permissions. You really just don’t need em for anything… except multiplayer across the network, but that didn’t work for j4k very well (there were 2 network games iirc… most people weren’t able to play em because no one else was connected to the server).

Sandbox, webstart, java 1.4… sounds great, doesn’t it? :wink:

Using LWJGL requires signing your own jar, right? That results in a (big) manifest, and some additional files (2?) in the jar-file.

This seems to be more fair:
16384 bytes for your original JAR, and everything signing (or writing the JNLP) adds in bytes is considered ‘free’, like the LWJGL-lib.

Think of the frustration when you hit the 16k limit just because you also have to sign your JAR.

You don’t have to sign your jar, as it remains untrusted.

Only the LWJGL extension will be signed, and granted

In your jnlp, you just have to declare and that’s it.

Lilian

All of you whiners, stop whining. Just write a game that comes in a jar that measures no more than 16384 bytes whether it’s signed or not. You should use LWJGL 0.97 as an extension and the one I’ve provided will work perfectly for that purpose. It’s got to work on 1.4.2 onwards and it’s got to work on all the judges’ machines, the specs of which will be available, and there will be a qualifying round where the judges can test everything and provide stacktraces etc. before the final submission. The prizes will be small and it’s all for fun. The entries will be available for the general public to play so aim to please them as much as any developers. Open source it if you like but no-one’s going to host the source for you.

Any other nitty gritty is just pointless. If I were you I’d start coding now as there is basically nothing going to change with what I’ve just said that will affect your entry or your enjoyment of the competition in any way and the sooner you start the sooner you can test your gamelet on more computers before it gets officially submitted to the qualifying round which will make our lives much easier.

Who else would like to judge? Who else would like to offer a prize?

Cas :slight_smile:

Cas,

Thanks for the signed lwjgl & lwjgl_util jars. However I suspect that signed jars containing the native libraries are also required to make this work.

I also tried using keytool to put my self-signed certificate in as a root certificate, but while I can now see it in the webstart trusted certificate list, that doesn’t provide a temporary work around for some reason that totally escapes me. More magic required.

Alan

No, we’re talking about properly installed computers with decent modern hardware (no Intel crap, for instance). It’s not like someone’s going to go out and find the worst machine they can - they’ll almost certainly be using their own dev machine.

The entire post was in response to those claiming that it’s unfair to disqualify entries that don’t work. So, that’s what “made me say it”; apparently you agree :slight_smile: ?

LOL. I was one of the judges, and even after running my own debug tools against them I couldn’t get several of the games to run, period. Wasted a heck of a lot of time. So, no, it doesn’t “regulate itself”. And if you were to include all the games that didn’t work first time, IIRC there would have been approx 20 that would have been disqualified, i.e. around 50%.

Hence (though I’m getting fed up of saying this) the need to actually read what we (the judges) said at the time and to try and take it on board, rather than just objecting because you don’t like the things I say.

Sorry Alan, forgot to mention the native jars too:
http://www.puppygames.net/downloads/shared/test/lwjgl-windows.jar
http://www.puppygames.net/downloads/shared/test/lwjgl-osx.jar
http://www.puppygames.net/downloads/shared/test/lwjgl-linux.jar

Now, fly, my pretties!

Cas :slight_smile:

Smithers! More work at the labs!

Cas,

Thanks for the files. I plugged them all in, cleared out the old versions in the webstart & browser caches, but unfortunately am still getting the same error as previously posted. Signing my game jar & giving it all permissions continues to work.

Have you previously tested your library without signing the main app? I keep looking at
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#setSecurityManager(java.lang.SecurityManager)
with suspicion. Maybe my apps unprivileged thread is attempting a priviliged operation through the library call without acquiring the necessary privilege first.

Or maybe not. I don’t really know what I’m doing here. I might try signing my app, but then setting the thread priv’s to sandbox before calling Display.create() to see what happens, if that breaks it.

Alan

/Edit - Subclassed SecurityManager with one that prints all access requests & set it before the first library call. It prints a load of library generated access requests, including one to do with Debug, which judging from the earlier stack trace, is where it is failing. All the printed access requests must be within the security context of the application, rather than the library, which explains the problem. The entire log is too large to post, but most of it is the classloader requesting file read permissions. Here are the edited highlights:

This bit of code:

            mode = org.lwjgl.util.Display.setDisplayMode(
                   org.lwjgl.util.Display.getAvailableDisplayModes(
                   640, 480, -1, -1, 16, 32, 60, 85),
                   new String[] {"width=800", "height=600", "bpp="+
                   Display.getDisplayMode().getBitsPerPixel(), "freq=60"});

            mode = Display.getDisplayMode();

(I know that second line is redundant, I’d been hacking the code about & forgot to take it out :smiley: )

Produces these application context access requests:


C:\Documents and Settings\Alan Waddington\.netbeans\3.6\system\org\lwjgl\util\Display.class
C:\Documents and Settings\Alan Waddington\.netbeans\3.6\system\org\lwjgl\util\Display.class
C:\Program Files\NetBeans3.6\system\org\lwjgl\util\Display.class
C:\Program Files\NetBeans3.6\system\org\lwjgl\util\Display.class
C:\User\Java\SharpShooter16K\org\lwjgl\util\Display.class
...
C:\Program Files\NetBeans3.6\system\org\lwjgl\LWJGLUtil.class
C:\User\Java\SharpShooter16K\org\lwjgl\LWJGLUtil.class
C:\User\Java\SharpShooter16K\org\lwjgl\LWJGLUtil.class
org.lwjgl.util.Debug
os.name
C:\Documents and Settings\Alan Waddington\.netbeans\3.6\system\org\lwjgl\Win32SysImplementation.class
...
C:\User\Java\SharpShooter16K\org\lwjgl\SysImplementation.class
suppressAccessChecks
loadLibrary.lwjgl
C:\j2sdk1.4.2_06\jre\bin\lwjgl.dll
C:\j2sdk1.4.2_06\jre\bin\lwjgl.dll
user.dir
C:\User\Java\SharpShooter16K\lwjgl.dll
C:\User\Java\SharpShooter16K\lwjgl.dll
.\lwjgl.dll
user.dir
os.name
C:\Documents and Settings\Alan Waddington\.netbeans\3.6\system\org\lwjgl\opengl\Win32Display.class
...
C:\User\Java\SharpShooter16K\org\lwjgl\opengl\Win32DisplayPeerInfo.class
suppressAccessChecks
C:\Documents and Settings\Alan Waddington\.netbeans\3.6\system\org\lwjgl\opengl\DisplayMode.class
...
C:\User\Java\SharpShooter16K\org\lwjgl\opengl\DisplayMode.class
shutdownHooks
C:\Documents and Settings\Alan Waddington\.netbeans\3.6\system\org\lwjgl\util\Display$1Sorter.class
...
C:\User\Java\SharpShooter16K\org\lwjgl\util\Display$1Sorter.class
suppressAccessChecks
suppressAccessChecks
suppressAccessChecks
suppressAccessChecks

From the earlier stack trace, I suspect things fall over at

org.lwjgl.util.Debug

/Edit2 Perhaps some privileged actions need wrapping:
http://www.expressnewsindia.com/site/khandwa/Setting%20Privileges%20for%20Extensions.htm

Best wishes, Alan :slight_smile:

Aargh, my post was supposed to have smiles in it. =/

Sorry about that, blahblahblah. :o

Cas,

Yep, case solved. I created my own extension & put all the display creation stuff in it, wrapped up in a doPrivileged, and the game works. Obviously this defeats the object of not signing the app, but it does point the way to a bug fix. Note that going full screen also needs to be wrapped, but isn’t in this code.

import java.security.AccessController;
import java.security.PrivilegedAction;
import org.lwjgl.opengl.Display;
public class myPrivileged {
    
    /** Creates a new instance of myPrivileged */
    public myPrivileged() {
    }
    
    static void createDisplay() {
        
        AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() { 
                try { 
                   org.lwjgl.util.Display.setDisplayMode(
                   org.lwjgl.util.Display.getAvailableDisplayModes(
                   640, 480, -1, -1, 16, 32, 60, 85),
                   new String[] {"width=800", "height=600", "bpp="+
                   Display.getDisplayMode().getBitsPerPixel(), "freq=60"});
                   Display.create();
                } catch(Exception e) {
                    System.err.println(e); 
                } 
                return null;
            } 
        }); 
    }
    
}

/Edit I’ve refined this workaround & started a thread in LWJGL to discuss it, as I’m rather cluttering this thread up with code.

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=LWJGL;action=display;num=1117354554

http://homepage.ntlworld.com/alan.d.waddington/images/camp.png

Mostly working :smiley:

/Edit - mostly works on the mac too, except there are (fixable) Z-buffer resolution problems. Some sound problems on the pc, possibly a yield() required. Quite a big difference in mouse sensitivities. Don’t have a linux box to test on.

so is the rules draft approved by all? I’m like ready to post it up and everything :stuck_out_tongue: (and by the way, June 1st is tomorrow…)

Yes, publish it; seems all the quibling dried up :stuck_out_tongue:

Is this contest dead or has it moved to a new thread.

In a new thread under Contests.

Cas :slight_smile:

Here is a 16K entry I was working on. I am not sure from the lack of activity in this thread if the competition will still take place. I thought I would post what I had so far instead of just tossing it.

It is a little racing game where you fly a Klingon warbird against some federation ships. Use the arror keys to navigate and the space bar to fire. The race is only one lap around the circuit so be quick off the mark.

I have an unexplained pause around frame 80 after the start of the race. It is not garbage collection. Maybe someone with a bit more experiance in LWJGL could point me in the right direction to find the problem.

Please let me know if you encounter problems.

The game is at http://www.elmkom.matzoo.com/

Great race game. The mini-map is a nice touch. 2nd so far, but 1st is just around the corner.

I didn’t notice the pause, although I was too busy trying to go faster to look for it really. If it’s not garbage collection, then maybe it’s a JIT compilation taking place.

Alan

/Edit Can see the pause now. Played about 4 levels :slight_smile: