The Muffin Crusade

OK, I think my Webstart Crusade has pretty much succeeded. 50% of all games on JGF are webstarted, and in these forums whenever a new non-webstart game is posted a flurry of requests goes up for a webstart version. I think most people around here actually writing their own games now either have a basic knowledge of getting webstart working, or at least know exactly where to look when they next try.

The key point is that as a group we’re now pretty much aware of what webstart is, why we should be using it (as developers) and why we want it (as players) - and we like it.

So. Onwards and upwards!

Next step: muffins. Something I forgot about in the crusade just to get people using webstart at all was these funky little things that allowed you to store webstart settings (config for your game, local scores, etc) without writing to folders on the hard disk - and in such a way that they were part of the webstart cache and could (theoretically) be automatically deleted along with your app.

But Onyx resurrected them, which has got me all fired up again ;D.

The key point is that - as upstanding authors of well-behaved games - we should NOT be writing random unsolicited crap to people’s hard disks (that’s an unkind way of putting it - but many players see it that way!).

We’re java developers, not C++ developers, and we have principles! ;). OK, in all seriousness, the point is that we can fairly effortlessly make games that:

  • run immediately just by clicking
  • require no installation
  • require no de-installation
  • leave behind no crap
  • do NOT clutter up the registry and hence slowdown all win95/98/ Me PC’s

But…we need to work out exactly how to use the bloody things because Sun still haven’t worked out the importance of webstart and/or muffins, and don’t make it easy for us. So, we need to help each other (witness the many threads about gettting webstart to work - by now, JGO threads probably contain an idiot’s guide to almost every webstart problem) get to that point.

Are muffins a 1.5 thing? 'Cos I’ve heard neither head nor tail of them until recently. ???

At first glance they seem slightly awkward - I like how I can set up my jars and resources so that the same files behave the same either via webstart or as a ‘traditional’ app sitting in a locally installed dir. But since muffins only work on webstart apps then I’ve suddenly got to come up with something different for a regular install. :-/

Web Start apps can use at least up to 128 k for muffins
without any permission

Ah! That’s good to know :slight_smile:

I posted two classes over at the shared code board, which should make using muffins somewhat easier.

Right now I’m not really satisfied with the “design” and one of the checks (loop around the names of available muffins before deleting) is somewhat verbose. Well, it’s usable… or just some kind of working example code (the documentation is fuzzy - see my ranting in that thread).

What I still don’t know is why that other version always worked without tagging or why it complained before that the target already exists (despite the fact that I just deleted it before [that problem went away after tagging]).

What I really would like to see is example code from sun, which 1) is complete 2) doesn’t have a handfull of errors in it. I mean… seriously how usefull is that code if it’s full of bugs (and thus - apparently - never run)?

I hope sun will do something in that area. Accurate documentation and good example code. That’s really needed because “muffins” are something new, which you won’t find anywere else.

Good point Orangy.

I’m also wondering if there is some easy (non hacky) way to determine if the application runs through webstart or not.

And - just because ;D - it would be great having some utility classes which handle that by themselfes. Eg that you could just read/write to a file/muffin and which one is actually picked is choosen automatically.

I mean - sure I can just start/test the apps through my local webserver (so - through webstart).

Hmm… well one thing is nice: muffins also work in offline mode. [But that doesn’t matter if you want to offer both kinds of distribution: plain jars and webstart]

Muffins aren’t a 1.5 thing. I use em with 1.4.x. Eventually they are as old as webstart (at least it looks like that if you see that since: 1.0 [refers to the webstart package])

IIRC yes - if you’re brave, wade through the unofficial webstart FAQ (it’s massive!). http://lopica.sourceforge.net/faq.html

Yes, I’ve been long planning to get something together to do this to put on JGF which would make webstart stuff easier.

If you combine it with the survivor code that lets you effortlessly override JAR’s by dropping individual files in the appropriate directories (*), then you start to have a utility JAR that makes distribution a heck of a lot easier.

But we also need a complete rewrite of the webstart tutorial. So, howabout we collaborate on the muffin stuff, put together a nicely architected couple of classes, and do a one-page section on muffins to insert into the new webstart tutorial? If you want to just do the code, I’ll have a go at the tutorial, explaining how to use your code.

    • (i.e. it automatically overrides entries in the JAR on a file-by-file basis - this was very useful when we testing e.g. updates to AI scripts; we didn’t have to resign nor rebuild the JAR every time we wanted to make a small change, and could update the main JAR, getting newer versions of the other files, without losing the overridden version).

NB: modified the text of the “I jar my games” to more precisely reflect the intended meaning; cancel your vote and revote if you didn’t mean that.

Yea, something like that is pretty nice indeed. You can do the same with Q3 (if sv_pure is set to 0), therefore I have some practise with that kind of functionality.

Yes, I already exchanged some emails with Kevin about that matter, but we didn’t end up with anything concretely.

Doing something about muffins sounds good. However, the biggest problem (as I see it) is a fair amount of uncertainty. I mean - yea, I got it working, but I’m not sure about some things eg what tagging really does (gonna investigate) or how it should be done architectural.

Slapping the code together should be a piece of a cake (now heh ;)). All I need would be some kind of rough design - classes and methods.

Hm…

public InputStream getInputStream(String muffinName)
public OutputStream getOutputStream(String muffinName)
public OutputStream getOutputStream(String muffinName, int tag)?
public String[] getMuffinNames()

Well, I’m not that sure right now about how it should be done. Eventually that gets cleaner after I understand what the tagging does.

Wouldn’t it be sweeter to have a Muffin object?

Muffin m = new Muffin(new URL(blah));
m.getOutputStream();

Just a thought,

Kev

Would the person who prefers non webstart games please make themselves known? Seriously…I’d be interested to hear any negative issues affecting players at the moment. Very useful to know, even if we can’t (as developers) come up with a workaround…

yes, make yourself know, we want to tear you limb from limb, rarrr!!! :wink:

Kev

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=share;action=display;num=1092020498;start=0#0

I just went the Muffin object route, which Kevin suggested and it works pretty well.

Hmm… MuffinTest.java:14 is unused - please ignore that one :wink:

I prefeer non webstart games, for the simple reason that the webstart interface is badly done.

As an indie dev one is dependant on causual downloads and the damn webstart has issues. On windows XP the client dont have a tab of its own and drops behind any open windows. So does the “Do you want to create a desktop shortcut” dialog. This means that players cant start the game(cause they havent seen the dialog and can only see it by minimizing all windows).

Also my would be stuck within the webstart client interface. I would want a game of mine to be present in the start->program dialog.

@Middy

Those dialogs are modal and use null as parant… ::slight_smile:

Therefore the webstart JFrame can’t tell em that they should popup again when they should. The only thing which helps there is disabling that shortcut question, and in the case of signed jars either don’t minimize (unlikely) or minimize one application after another until the dialog is visible.

It’s really a very silly mistake (one of the mistakes I’d done with my first Swing application). It’s rather easy to fix and I hope that problem will be gone pretty soon now :wink:

best way for distribution is prolly Jet, this webstart stuff is a big annoyance for users, it’s badly designed, integrate strangely with your OS.

[quote]I prefeer non webstart games, for the simple reason that the webstart interface is badly done.
[/quote]
Interface? What interface? ::slight_smile: As a user I just click [click], see a download bar, and then the game appears.

OK, so Sun broke the windows version so that in certain cases you get that popup problem (a gotcha in the design of windows that has plagued windows apps since windows 95 first came out >:( ), but if you turn it off, don’t you find it all just works fine from then on?

There is nothing more casual than webstart, so isn’t that statement a bit self-contradictory? Howabout: “one is dependent upon casual downloads, which webstart does well, but one is also dependent upon things working first time, and webstart doesn’t work first time for some people with some games” - I think that’s what you mean?

Interesting. When I run webstart on XP, I don’t have to answer that question until AFTER I’ve finished playing the game - it pops up at the start, but I don’t have to deal with it, the game runs just fine if I ignore the dialog. What am I doing differently from you?

[quote]best way for distribution is prolly Jet, this webstart stuff is a big annoyance for users, it’s badly designed, integrate strangely with your OS.
[/quote]
That’s a pretty dumb way of putting your point, given that it’s on the same page as a poll where one third of people say they ONLY play JWS games, and a further third say they prefer them ::slight_smile:

I suggest you rephrase that in a way that doesn’t make you sound stupid - e.g. by not making a generalization that flies in the face of the evidence - and conveys your point better - e.g. by explaining HOW it can be annoying, (or how it’s particularly annoying to YOU, since you are currently in a minority who feel it’s bad overall) etc.

Yes but you usualy only get one shot. If the damn thing wont work the casual bypasser just say… “shrew it”.

Also it does not act as other programs do so. The SECOND time a player wants to start it, he cant find it. Cause he exspect it to be in his “programs” Menu.

No idea. I just know I cant start the dam thing until I have answered that dialog.

I have a personal problems with applications that acts differently “just because”. If sun had implemented webstart so it acted just like any other programs I would have been a webstart fan. But having my game put into a SUN frame, I dont like it.

dumb point sounding stupid, ok no need to argue with impolite guys …

Awww, don’t get annoyed. You know that just how Blah^3 posts, its a culture thing. Sounds more offensive than it actually is.

Kev

[quote]OK, so Sun broke the windows version so that in certain cases you get that popup problem (a gotcha in the design of windows that has plagued windows apps since windows 95 first came out ), but if you turn it off, don’t you find it all just works fine from then on?
[/quote]
Sure, you can turn it off, but 1st time users probably won’t bother and think it just doesn’t work which may lead to a general assumption “Oh this is java web start, it probably won’t work”.
Another issue with this is that when you develop LWJGL stuff, the popup appears after the program has started and steals focus. How stupid. As a result, input won’t work unless you click the mouse somewhere outside the (invisible) dialog.
If you have the jws manager open, a simple ‘enter’ may even start the same app again.
I got around this by putting a simple Sys.alert() at the start of the program, reclaiming focus again, except the 1st time when the popup dialog appears behind the alert box, stealing focus, leaving the alert box not responding. Then you have to drag the dialog from behind the alert box to get rid of it. What a friggin nightmare.

Another issue is that if you choose for the ‘desktop integration’ so that it will create shortcuts and some such, you can’t choose where it will create them. It’s now always at the top level of the ‘Programs’ menu in the start menu. It would be nice if you would have some control over that so that it won’t clutter your system with shortcuts where you don’t want them.
The interface of the jws manager is also just soooo bad. If you have a good collection of jws programs, it quickly becomes an annoyingly unmanagable mess of icons. The people who came up with the user interface should not be allowed in the building again until they have read some good books about user interface design.

I did vote ‘pro web start’ though as I feel it is great deployment technology, I just wish the user interface and OS integration wasn’t as bad as it is now.