LWJGL16k

Using the obfuscater/kzip chain you can pretty much count on getting about 32k into 16k so that gives us a bit of breathing room.

So, its May 1st, any word on when/if this thing is going to start?

What happened to woogley?

You can delete your own posts you know?

Kev

I think we ought to announce the compo soon, just need to thrash out a few details with Matzon and Elias and possibly blah^3.

Cas :slight_smile:

[quote]Using the obfuscater/kzip chain you can pretty much count on getting about 32k into 16k so that gives us a bit of breathing room.
[/quote]
Thumbs up on the obfusticator. I ran proguard over some code and it came out less than two thirds of the starting size. :smiley: I haven’t tried alternative zippers yet, but heard that 7zip is good. Even (say) a 2% gain would be another 320 bytes of code. Worth a look later for that final code squeezing.

[quote]So, its May 1st, any word on when/if this thing is going to start?

What happened to woogley?
[/quote]
His website hasn’t been updated for a while. Probably concentrating on his schoolwork, which is a good call.

Alan

well you’re half right ;). My site HAS been updated (almost daily), you just don’t know the address ;). Kev and a few others have seen peeks at it. And yes school kinda threw a small roadblock at me, I’m graduating May 28th so… it’s been kind of busy. Also I have driving class every night so that’s no fun either ;).

Anyway the launch date in my sig isn’t set in stone, that’s just the MAX TIME I expect it to take. I already have the database scripts completed and stuff, just putting the pieces together now.

The site isn’t complete but the game submission page is done and working (http://unlimited.woogley.net/data/game.php) so you could go ahead and start the contest while I polish up the last parts of the site.

Thanks for the heads up. May 21st it is then. I see you’ve been busy on the submission page and this clarifies how the game should be presented (i.e. homepage &| jar &| webstart). The licencing page is also clear. We will also need a rules page (No 3rd party libs for 4k, assume LWJGL for 16k, any midi soundbank?, does jar have to have a manifest, etc., Oh & I forgot - duration) I’ll hold off on entry submission until closer to the start. No hurry, get the school stuff done first. This will give me time on learning to arrange music, since I will need to stay compatible with the creative commons licence. Time to tinkle the ivories :smiley:

BTW: Are the left hand menus intended for your private control of the CMS? If so, should they be generally viewable?

Cheers
Alan

Yes those links are only for the CMS managers (so far myself hehe), and if you clicked one you would need a password ;). They shouldn’t be viewable from that specific page though, I think I included the wrong menu file. Thanks for looking out :slight_smile:

So who can get the smallest lwjgl window?

Here’s my first shot (1760 bytes uncompressed):



import org.lwjgl.Sys;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.glu.GLU;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;

import java.io.IOException;

public class lwjgl16k  {
    boolean running=true;
    
    public lwjgl16k() {
        try {
            DisplayMode currentMode=null;
            DisplayMode modes[] = Display.getAvailableDisplayModes();
            //boolean modeFound = false;
        
            for (int i = 0; i < modes.length; i++) {
                currentMode = modes[i];
                if (currentMode.getWidth() == 640 && 
                    currentMode.getHeight() == 480 && 
                    currentMode.getBitsPerPixel() >= 32) {
                        Display.setDisplayMode(currentMode);
                        //Display.setFullscreen(true);
                        Display.create();
                        //Display.setTitle("mg16k");
                        //Display.setVSyncEnabled(true);
                        
                        break;
                }
            }
        }
        catch (Exception e) {
            //e.printStackTrace(System.err);
        }
        
        GL11.glShadeModel(GL11.GL_SMOOTH);
        GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
        GL11.glClearDepth(1.0);
        GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);
        GL11.glHint(GL11.GL_POLYGON_SMOOTH_HINT, GL11.GL_NICEST);
        GL11.glCullFace(GL11.GL_FRONT);
        //initGL();
        //initGame();
    
        gameLoop();
    
        /** Cleanup */
        Display.destroy();
    }

    private void gameLoop() {

        while (running)
        {
            if (Display.isCloseRequested()) running = false;
            else if (Display.isActive()) {
                handleInput();
                render();
                Display.sync(60);
            }
            else {
                handleInput();
                if (Display.isVisible() || Display.isDirty())
                    render();
            }
            Display.update();
        }
    }   

    private void handleInput() {
        if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE))
            running = false;
    }

    //private void initGame(){
        // This is the place to load textures, create necessary data, etc.
    //}

    double angle = 0.0d;

    private void render() {
        GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
    
        GL11.glMatrixMode(GL11.GL_PROJECTION);
        GL11.glLoadIdentity();
        GLU.gluPerspective(60.0f, 4.0f/3.0f, 1, 100);
    
        GL11.glMatrixMode(GL11.GL_MODELVIEW);
        GL11.glLoadIdentity();
        double xpos = 10.0d*Math.sin(angle);
        double zpos = 10.0d*Math.cos(angle);
        GLU.gluLookAt((float) xpos, 0, (float) zpos,  0, 0, 0,  0, 1, 0);
    
        angle += 0.1d;
    
        // Render your scene here
        GL11.glBegin(GL11.GL_TRIANGLES);
            GL11.glVertex3f(0.0f, 0.0f, 0.0f);
            GL11.glVertex3f(1.0f, 0.0f, 0.0f);
            GL11.glVertex3f(0.0f, 1.0f, 0.0f);
        GL11.glEnd();
    }
    
    public static void main(String[] args) {
        new mg16k();
    }
}

edit; yabb code tags suck :’(

Mine’s fairly similar. Slightly different constraints in the search for a suitable display mode & the main class only has a constructor and a loop method to save space.

        DisplayMode mode = null;
        try {
            DisplayMode[] modes = Display.getAvailableDisplayModes();
            for (int i = 0; i < modes.length; i++)
                if (modes[i].getWidth() == 800 &&
                    modes[i].getHeight() == 600 &&
                    modes[i].getBitsPerPixel() >= 16 &&
                    modes[i].getFrequency() <= 60) {
                    mode = modes[i];
                    break;
            }
            if (mode == null) {
                System.out.println("Bad Display Mode");
            System.exit(0);
            }
            Display.setDisplayMode(mode);

I generated and displayed a height map to practice openGL. This came in at less than 4k. Since then it’s been parked, since the comp hasn’t started yet. Been thinking about gameplay though :wink:

Why aren’t you just using the lwjgl Display utility?


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"}));

Cas :slight_smile:

[quote]Why aren’t you just using the lwjgl Display utility?
[/quote]
Ah, I hadn’t spotted it ;D

/Edit - Actually (after a closer look) I am using the utility, but not as concisely as your code.
/Edit2 - After an even closer look I realised that I was using the Display class in the opengl package not the utils package.

Thanks
Alan

Since LWJGL is a community project, we can add some 4k tweaks to the library
http://tankammo.net/fora/images/smiles/sm_evil.gif
.

I’m thinking of setOptimumDisplayMode() which makes a full screen LWJGL window at the user’s current resolution. :wink:

Will.

It already does that :slight_smile:
Display.setFullscreen(true);
Display.create();
Done!

Cas :slight_smile:

Nice, that’s gives me a spinning triangle in about 1400 bytes!

:slight_smile:

It’s been rather quiet on the LWJGL16k front, so here are some suggestions for rules. These have no official standing and are supplied for discussion purposes only.

1.5 must alas be banned for now, as it’s rare as hen’s teeth. Conveniently that sidesteps the pack200 issue.

Cas :slight_smile:

There should only be one JVM version supported, so that everyone’s on a level playing field. Personally, I’d say 1.4, and anyone who can’t bear to go without their VB-for-loops can just make their game yet-another-advert for Toby’s retroweaver.

This makes it sound like the code has to be that size before be packed into the jar. You might want to say:

I agree with blah3, 1.4 should be the required VM for this contest. But if users want I dont see why they cant go under that VM (i.e. VM <= 1.4). It doesn’t bother me if someone uses 1.2, I have 1.4 so it should run fine.

I don’t see the need for the 24 hour time limit. All of the participants may not be online at the same time when we launch the contest. Besides, this contest has been in the making for quite some time, it wouldn’t surprise me if someone has already whipped up an application for the contest (like oNyx did in the 4K contest: JM4K). I suggest we make it a 3-4 week contest (roughly a month).

Also, the submission link for games has changed: http://unlimited.woogley.net/games/submit.php

There’s a contest choice called “Java 16K 2005” - that is the contest category the judges of this contest (which needs to be determined) will use to find the glorious winner :wink:

How do we want to do the judging by the way? Last time people just emailed me the scores (and jbanes later took those scores and put them into a handy Excel file). That’s alot of work though… I think I’d rather code up a judging panel where the judges vote on Java Unlimited sort of like a poll… and we’ll let PHP do the calculating :wink:

But before that happens, we need to figure out WHAT to judge (gameplay, graphics, sound, etc.)

LWJGL only works on 1.4 and above so that pretty much rules out the earlier VMS.

Cas :slight_smile: