Discuss the future of 4k contest

I’m completely opposed to using source file size limitations, as it demands the creation of illegible code.

While the 4KB binary limitation might not result in the most structurally sound of code bases, it’s perfectly possible to write verbose and readable code that compiles down to optimal byte code.

The expected competition start date is so close, I’m doubtful that any changes to the rules that requires significant framework development are going to take place this year.
For the elimination of doubt, I suggest we settle on the status quo.

The issue of Applet compatibility & usability going forward can be addressed retrospectively with wrappers & byte code weaving, if the demand arises.

I am actually very interested in seeing what coders could accomplish with a 4096 octet source code file size limitation. But, not for this contest. Maybe we could spawn off a mini side competition or just a skills exposition. The winners of IOCCC 22 were just announced and my entry is among them. That contest has very strict size constraints and it is well known what hackers have been able to accomplish with so little space. I also appreciate the anonymous entries and the collaborative judging process that they use.

Unsigned Applets are going to stop working completely?!!! Where did you get that from?

For HTML 5, JS1K and the5k are already well known competitions. A tiny Android competition sounds interesting as well. But, again those are too distinct from what we have been doing here.

Needless to say, it’s fun to code under an artificial constraint. There’s also retro-coding for all the obsolete game machines and computers of eras past. E.g. why create another Atari 2600 clone for J4K when I could actually code up an actual game that runs on Stella.

https://blogs.oracle.com/java-platform-group/entry/new_security_requirements_for_rias

New security requirements for RIAs in 7u51 (January 2014)
Java 7 update 51 (January, 2014) intends to include two security changes designed to enhance authentication and authorization for Rich Internet Applications (Applets and Web Start).

The default security slider is being updated in a way that will block RIAs that do not adhere to these requirements. Note: this only applies to RIAs, and not to Java on server or desktop applications run outside of a browser.

Summary:
•You are required to sign all RIAs (Applets and Web Start applications).
•You are required to set the “Permissions” attribute within the Manifest.
•Your application will be affected if it uses Java started through a web browser. Your application will not be affected if it runs anywhere outside of a web browser.

That’s the end of J4K.

hmm… that is indeed one barrier too far. I think the only viable solution for this current competition is to leave the rules the same, but use a “launcher” application as suggested/ partially implemented earlier in the thread.

That will give time to come up with the solution for next year.

Or, sign the applets for deployment and claim that we have a compression tool that proves it is 4K in principle. Ugh.

who is going to sign it?

Poor old applets! :’(
How about something like XMLVM where the the compiled java code had to be under 4K (ulp!) but the game would also be available as HTML5, android or iphone? Just a thought…

I am new here and my opinion wont weigh as heavily as others, but here it is.

I think the contest should stay as is. Honestly a contest should be about who has the best stuff. If source code is provided for each game, then it also qualifies as a learning experience. I understand the contest may be old and applets aren’t people’s favorite. However shouldn’t this be done for the community? The community should still be able to participate and have this fun contest. There is so much that can be learned from this type of contest that it makes the concept invaluable.

I understand times are changing, but whatever you decided, please don’t get rid of the contest all together.

Cheers!

The problem is that unsigned and self-signed applets (and webstart) will no longer work after January 2014. This means none of the java4k games hosted at java4k.com will work. The options (as I see it) are:

  1. Sign all the entries with a paid for code-signing key
    ---- This costs money and the owner of the key would have to check each game entry didn’t contain malware.
  2. Sign all the entries with a self-generated code-signing key and provide a root certificate for users to import.
    ---- The certificate import process is not user friendly. It’s a bit easier if one only targets IE & Mozilla as it is easy to import certificates into the browser certificate store and java will check those. Doesn’t work on other browsers. Otherwise it needs to be imported into the java keystore.
    ---- Importing someone else’s root certificate means you are trusting them not to freely distribute code-signing keys based on it, as these could be used to sign malware.
  3. Write a downloadable java application (executable jar probably) that displays the entries and dynamically loads them.
    ---- Downloading the loader is a slight inconvenience. It doesn’t have the immediacy of applets on the webpage.
    ---- The downloader needs to be very carefully written, so as to run games in the sandbox, rather than with full permissions; it probably also should check the length. Even so, there is a risk of java bugs allowing sandbox escape, but this is no worse then where we are now.
  4. Use downloadable executable jars
    ---- Downloading these is a bit tedious.
    ---- They run with full permissions, running games from new entrants presents a risk.
  5. Cancel the competition
    ---- Could happen if we can’t agree :frowning:

Of these, the downloader option is probably the best option, and might be able to be made to work with the existing games on the java4k site as well. However, since unsigned applets are now effectively dead, it is probably time to move on and come up with a new competition more relevant to today.

The options here seem to be (sorry if I missed any)

  1. Javascript
    ---- Runs pretty much everywhere, but not really java, although there are similarities (This is a java-gaming site)
    ---- The 4k limit would have to be applied to the source code, as there is no executable code equivalent.
    ---- The range of games that could be written with it is likely to be more limited (In my uninformed opinion)
  2. HTML5
    ---- Supports OpenGL ES, so a wider range of gaming possibilities
    ---- Presumably adds on to Javascript (I haven’t used it, so showing ignorance)
    ---- Again, the question is whether an HTML5 competition is pertinent to a java gaming website.
  3. Android
    ---- Not everyone has an android phone or tablet (e.g. those with iPhones)
    ---- There is a large range of screen sizes, operating system versions and processor performance
    ---- We probably need to load entries onto Android Market (Google Play)
    ---- This is written in java, so provide a good match to java-gaming

We have been unable to reach a consensus on the way forward and as the start of the competition is in a couple of weeks, there isn’t really time to come up with a new competition and write a test entry to prove it works in the timescale. I suspect we will have to proceed as normal and write a downloader application in parallel, so as to provide a workaround come January.

Naturally you want as many people as possible to participate and watch a specific event/contest. Because of that it is important to not become stagnated in a tech contest - IT is changing, one of the changes is that applet are absolutely dead and not an option anymore.
Plenty of options have been mentioned.

Also, as I said before, I know there are a lot of 4K supporters, but I think the whole 4K deal is making the contest way too limited and it makes it harder to gain decent exposure / the entry bar is too high.
4K is way less than a NES game or gameboy game. 4K makes it almost impossible to include sound, which should be part of any game, since games are multimedia entertainment.
I would love to try out the limitation they had in the NES/Gameboy area. But 4K is way below that.

While I understand your point, and it relates to the rule disallowing MIDI, it’s important to point out that there have been a number of 4K games that included sound of various sorts. Procedurally generated sound can be created and played in only 4 or 5 lines of Java code. For more complex music, there are definitely options. I wrote a Java4K game a couple of years ago (Mazer 4K)that plays the full score of Music Box Dancer as the background music (though only 8-bit quality.) I also posted the code for the player and the encoder, including documentation, on this thread of java-gaming.org. It’s not minimized, but I guarantee that the source code posted with Mazer4K is the exact source code that was compressed and submitted. You can see that the music decoding and playing component takes up only about 15% of the code. The score for Music Box Dancer only takes up about 60 bytes after compression.

Last year I was working on generating nicer tones by simulating piano sound waves, I may continue it for this year’s competition. If I do I’ll post the source for others to use.

On the main topic: Regarding the launcher, appel’s comment sounded like he was going to work on something on his own. If not, then I can set aside a couple of hours this weekend to work on it. What I see as the next steps:

  • start from groboclown’s code
  • double-check the security policy - if we can restrict the launcher itself so that even it doesn’t have full permissions, any applet that breaks out of our sandbox therefore wouldn’t have full permissions. I’d also like to restrict the network permissions to just the java4k site. I’ve got a policy file worked out for that, but that needs to be merged with what groboclown has created.
  • put the security policy in the jar. It’s only a single line of code to load a policy as a resource from the jar, and that way we don’t need to use a separate script to supply the policy as a command-line argument. So no risk of users running the app without a loaded security policy.
  • put the downloaded jars in the system temp directory instead of having an installation directory
  • load the list of this year’s games from java4k.com. For now I would say it can just be screen-scraped, using last year’s game list for testing. Groboclown’s code already looks for the applet tag when supplied a url, so we could just use a list of urls pulled directly from the page listing the games.
  • I had an issue with loading gzip + pack200 jars using groboclown’s code. If so, that would need fixing.
  • UI work - Probably the easiest would be to follow the standard web paradigm, of a left menu of options affecting content to the right. So we load the list of games in a collapsible pane on the left, and selecting one would load it into a pane on the right.
  • In theory this launcher app doesn’t need to be signed, but in practice it would be a good idea. Otherwise nefarious parties could put out their own modified version that does bad things. A second advantage would be that the jars could be served over https, stopping any man-in-the-middle attacks (redirecting the user to a bad jar instead of the java4k one). We may be overly concerned, it’s a lot of work for someone to do bad stuff like this, but I figured I’d bring it up.

And a last item: the java4k website was having issues earlier this year, and I suggested appel move it to a different host. Unfortunately the free host I suggested is flakey, and we saw intermittent downtime. I’m willing to contribute towards a year of hosting on a more reliable site like host gator, if that would help (it’s about the same price as a high-end game.) Some paid hosts even offer a shared SSL certificate. Just putting it out there for discussion.

I have a linode vps node (the same host that jgo runs on) and I wouldn’t mind providing appel root access to do whatever he likes.

A new host sounds cool.

But regarding the launcher, no, I’m not working on anything. What is mentioned here sounds like a big project to me, dozens of hours of work at least, research and lots of testing. The end-result of it is also dubious to me, will people use a launcher?
Java isn’t exactly the easiest platform to work with, not when it comes to security, certificates, etc.

I can take care of the website and manage the contest, but developing all of this is beyond my interest and time. To me this no longer sounds like a one man job. I got my plate pretty full with job, and don’t have many nights to burn on hobby projects anymore.

I’m not saying I’m giving up on the contest, but circumstances are not making it easy to run. :clue:

Just so we’re clear, in my mind the site and everything is community owned, so I wouldn’t mind passing the torch to someone who thinks he can keep the contest running.

The launcher isn’t that far from being usable, if others think it’s worthwhile then I’m willing to put in a few hours to get it to that state. It basically becomes a Steam client for java4k.com; see and run the games, which will no longer run in a browser if Oracle really does role out the proposed security changes. It already works, and I’ve got the security changes figured out, the big question for me relates to the one you asked at the start of this thread: will it be enough to keep non-developers playing the Java4K games?
If the answer is “No”, then this becomes a developer only contest, and we could just do something like tell everyone to not install the future update that disallows unsigned jars.

I work with more than a hundred other developers writing hospital software in Java. The project I’m assigned to these days has 7K+ java source files. So a little thing like an applet launcher is practically a walk in the park. :wink:

It would be hard to gauge non-developer interest as they will not be on this forum… though when java4k was mentioned on slashdot there was a significant boost of interest so I imagine that there are “users” that would be interested.

I think it would be more palatable to windows users if the launcher is deployed as a exe with a runtime included.

I can pretty much guarantee there is non-developer interest in the Java4K gaming. I mean, we can just look at the numbers of times these games are being played. (Developers definitely don’t have time to boost a game’s play numbers to 10K in the span of a year.) It is probably better off that we do prepare launchers for each major platform (Windows, Mac, Linux).

The other thing I was thinking about is what this means for the older portions of the contest. Some of these games came with source, so we might be able to salvage and make them part of this system (Even if they are a little bit over 4K). I know that if we just straight bundle the JRE with the launcher, it might be big, but it will run everywhere.

Definitely, I feel a bit of strain for the contest. I mean, there is no guarantee that they would want to use the launcher as it isn’t as accessible as just playing the game directly from the browser. Also, most places don’t allow you to just download things onto the system keeping this contest more developer oriented.

The only other solution that I though up of was using LibGDX to make a similar contest that we can convert the Java code into HTML5/JS code. It is a radical change, but you’d be able to run the game on Android and probably keep the technology running on a browser interface. Just a thought.

I think it would be good if we could get some kind of consensus for this year’s contest, given that it starts in a couple of weeks!
My opinion is pretty much the same as moogie’s:

Regarding the launcher…

+1, definitely worthwhile!

I do wonder how Oracle will implement the security enhancements in 7.51.
Will they simply move the default value of the Java Control Panel security slider from its current value of ‘High’ to ‘Very High’?

Ok, I’ll get it to a “good enough” state this weekend, and put it up for code review. If you read this @Groboclown, do want to keep hosting the code? If so I can just send you a patch. If not, I’ll put the code up somewhere like sourceforge (though we don’t want to have users download the final build from there, what with the new install wrapper they’re now adding! WTF are you thinking Sourceforge!?!?)

If that’s what they do, we could simply stick a message on the website header explaining how to lower the slider. ;D

I think we should move to a community project dedicated to this. I agree that SourceForge isn’t the way to go, considering how bloated with ads and other stuff it’s become.

I looked around, and I’m trying out pikacode:

https://pikacode.com/groboclown/java4k-launcher/

Let me know if this looks alright, and we can start the project there, or let me know if you have a better location.