to JET or not to JET...

Hi :slight_smile:

I just finished work on a game 8) and I’m trying to find the best way to distribute it to the world. I thought about JET of course but unfortunately, after the distributable was finished the final product required not only JET’s files but JRE as well (I wasn’t using Swing and I thought I’d get away with it, but JET doesn’t cover AWT either. So the final distributable is 50MB (!), which is crazy.

Is there any way to make the distributable smaller? Is there any other compiler that might do the trick? (native code please, no JRE installation should be required).

Thanks

Sorry I forgot to add that compression limits the size to 20MB which is still quite a lot …

You probably didn’t use the 'professional ’ edition of JET which is able to produce stand alone executables, although I think that requires a dll from AWT as well. Which in turns requires distribution of the complete JRE due to license restrictions.
(You might want to check this, I don’t know if the java license still has this restriction).
If you want to produce just an exe without violating licenses, you should not use AWT but for example LWJGL.

Thanks. I am using the “professional edition” evaluation package, which produces stand-alone executables provided that you don’t use Swing or AWT.
Anyway, I wish things were simpler as far as Java deployment is concerned…

[quote]You probably didn’t use the 'professional ’ edition of JET which is able to produce stand alone executables, although I think that requires a dll from AWT as well. Which in turns requires distribution of the complete JRE due to license restrictions.
(You might want to check this, I don’t know if the java license still has this restriction).
If you want to produce just an exe without violating licenses, you should not use AWT but for example LWJGL.
[/quote]

Is there a chance you could use jar files and use Java WebStart to distribute your game? It’s not compiling to native code, but at least you get around the liability of not using Swing/AWT.

Not a bad idea. Thanks.

Although you know, it kinda pisses me off that we have to use these “weird” execution techniques (weird to non-programmers) when it comes to Java. I think the language has grown to the point where a compiler (that doesn’t cost Dr.Evil’s voice “1 billion dollars”) is essential…

You could also not use JET and just use GCJ to compile your code. GCJ is fast and free. GCJ does not include AWT or SWING. Use SWT instead.

Bob, have you managed to create a Windows executable (a game preferably) with GCJ/SWT? Because I’ve heard that it doesn’t really do the trick (but I’ve never tried it myself)…

[quote]You could also not use JET and just use GCJ to compile your code. GCJ is fast and free. GCJ does not include AWT or SWING. Use SWT instead.
[/quote]

As a longtime Jet user I have this to say:

You have no choice but to eliminate AWT and Swing from your application entirely and pay the £500 for Jet Pro. It’s worth every penny and produces excellent, super-fast code with a great footprint.

If you insist on using AWT, you are actually far better off shipping with either a bundled JRE (8MB or so) or using Webstart and asking your customers to get the JRE themselves.

A JAR file by the way is approximately 80% of the size of a typical compressed Jet EXE. The bigger your game is the less the JRE counts against it.

Cas :slight_smile:

Ive created windows apps with GCJ and SWT. Here’s an article covering doing this:

http://www-106.ibm.com/developerworks/java/library/j-nativegui/?Open&t=grl,l=805,p=cgui

I have to agree with PrinceC that AWT and SWING are not ideal for game development. SWT is not much better. But it often depends on exactly what type of game your designing I guess. Most commercial games do not use native gui controls. Game designers often create thier own controls from scratch to blend more with the games look and feel.

If you are gonna use SWT and GCJ on MS Windows I suggest using the GCC/GCJ toolchain at www.thisiscool.com. It includes some SWT examples in the distro. Use 3.3. I found a few issues still remain in the development 3.4.

Also, executable sizes with GCJ for small programs can seem rather large. This is because GCJ created executables include the java runtime. You can cut this down by using UPX (upx.sf.net). Kills like 60% of the bloat or more.

Webstart is not a bad option also. I have mixed thoughts on using it for games though. Theres a few games people have put out in this forum that use webstart like Wurms. Check them out and see what you think.

I would like to hear from anyone who has designed their own game components outside of Swing, and isn’t using DirectX/OpenGL solutions for their game. Specifically, what are your experiences? How are you drawing to the screen? How happy are you with your new components?

I’m sorry, I might say something stupid here but I have created my own gui controls (no Swing/AWT buttons etc) and still have to use AWT. GraphicsDevice, Frame, Toolkit, Color, Image, MemoryImageSource, etc, these are all in java.awt.*.
I have created a 2D space shooter with no need for any OpenGL or anything, so I guess I didn’t do anything fundamentaly wrong by not using an external library… (unless of course I did ::slight_smile: )

It’s not that AWT/Swing are bad for game development, it’s just that if you want to get the best possible result from Jet it’s worth ditching them.

I believe it was Cas who said a while back “you need powerfully good reasons not to use Swing”. A requirement to deploy as small-as-possible Jet-compiled binaries might be such a reason, although using Jet shouldn’t be an actual goal, more a solution to a different goal, if you get what I mean!

Aha. Ehe. Hm.

I would love to treat that statement as a sort of gospel (even though I advise against sticking to any one rule a bad thing): “you need powerfully good reasons not to use Swing.”

Because, in truth, I LIKE Swing. It does the job. Perhaps not well, but it does the job.

I’m waiting for the day Sun tells us Swing’s being rewritten on top of OpenGL. Now THAT would be cool.

Trying to return to topic: I have found one really good reason not to use Jet: AFAIK, Jet can only produce Windows binaries. If you’re trying to be multiplatform, this defeats your purpose. My Jet knowledge is minimal, so please correct me if I’m wrong.

[quote]I have found one really good reason not to use Jet: AFAIK, Jet can only produce Windows binaries. If you’re trying to be multiplatform, this defeats your purpose. My Jet knowledge is minimal, so please correct me if I’m wrong.
[/quote]
Yes, you’re right. But you know if thinking (just thinking) about selling this game as shareware when I’m done, and when it comes to selling software, Windows is your only choice. I’m a Linux guy and I know: Linux people don’t buy software. Especially shareware. Mac users are too few compared to Windows users. So if I was able to make a foolproof, classic installation method for Windows, that would be great.

To me it, Sun made a mistake when they sued M$ for changing the JRE in Visual J++ (when was it, '97?). I mean, so what? Today we’d be building Win32 Java executables with visual studio and Java would be many times stronger than it is today. By suing M$ at the point, Sun gave a clear message to everyone: you cannot touch Java, only Sun can (and look what they did: they (Sun) had the slowest, bugiest JVM around for 4 years. Even today in 1.4.x the one (1) person who takes care of java’s sound, messed it up big with AudioClip). Just what Apple did with their computers and look where they’re now (saleswise). I mean I never really heard anyone complaining about Visual C++…

I just wanted to add that we here are game developers. And unfortunately, Linux is a piece of shit when it comes to gaming. (We pray that a game studio releases their source code of a 6 year old game, so that someone can build a Linux port). Are there any Linux game port companies left? I don’t think so. So why should we, Java game programmers build Linux games if nobody cares?

As a hobbiest, the only answer is:

Because we can!!

I guess as a commercial developer you could argue that many analyst reports are saying that the home desktop is growing in the linux market and hence there is a nice new market openning up that most of the existing game developers don’t really know much about. (I’m not sure I’d argue this, but its just another side to the coin)

You could argue the same thing about MacOS, who really wants games there, mostly Macs are work horses.

Kev

[quote]I just wanted to add that we here are game developers. And unfortunately, Linux is a piece of shit when it comes to gaming. (We pray that a game studio releases their source code of a 6 year old game, so that someone can build a Linux port). Are there any Linux game port companies left? I don’t think so. So why should we, Java game programmers build Linux games if nobody cares?
[/quote]
Don’t make the mistake of thinking people don’t care. Windows comes free with nearly all PC’s (and you don’t usually get a refund if you ask for a PC without one, thanks to some rather dodgy MS practices). If you have a PC, you probably have windows…even if you run Linux, if you’re a games player you keep windows around simply to play games.

There was a time when you kept windows around mainly because there were lots of basic apps you occasionally needed that only existed on windows - but now there’s a top-notch web-browser, email, graphical IDE’s, desktop, DVD/mpeg/mp3 players, Office clone that’s 99% compatible with MSOffice, etc etc. IME, few people actually need Windows for anything other than games these days…leaving aside all those who depend on custom applications.

Hence people like lokigames go out of business at least partly because the vast majority of PC players who’d play a linux conversion already can play it on windows. And for many of the games, you had to buy the original first anyway - so why the heck would you bother paying extra to be able to play something you already owned on linux as well as windows? (cough cough American business practices - sell you something you already own :P).

Healthy demand for linux games exists, but it’s masked by the widespread existence of Windows. This is a chicken-and-egg situation of course - until the good games start appearing on linux and windows simultaneously, people will still need to reboot into windows to play their favourite games, and so won’t bother showing demand for any particular game to move to linux - e.g. they have to reboot to play Doom3 anyway, so they don’t mind doing it for Warcraft 4 as well. But when (if) a significant number of people’s favourite games don’t need the reboot, they will be less inclined to play the games that require extra effort (no-one enjoys rebooting ;)).

IMHO even if such a sea-change occurs, it’s at least 5 years away, and will only happen because - like RenderWare - the cost economics of writing in java can very rapidly make java games the norm (look at how fast and large RW grew…admittedly this is largely due to their infamous sales force, but it also had something to do with the palpable sense of relief to developers who no longer had to support three or four target platforms, but just one).

IMHO.

Quick chime in on the multiplatform issue:

  1. We’ve to date had 1 confirmed Linux sale, which makes the Linux:Windows ratio 1:45 or so, which is somewhat less than our Linux:Windows site visitors ratio of about 1:10

  2. MacOS, though under 3% of the total distribution of PCs, has plenty of anecdotal evidence to say that they are about 10 times more likely to buy your software; when we release the Mac version we are expecting at least 30% of our sales to come from the Mac

  3. When it’s trivial to get your game running on the Other Two OSs, porting is just a non-issue. The reason why Linux users keep a Windows system round to play games is because it’s a big pain porting games to Linux so very few make it. But the more compelling games they have the more they can stay in their Linux boot. And as for the Mac, they’re so anti-windows they tend to stick with MacOS and the few games they have. This, combined with their general affluence, leads them to be very good prospects for a sale.

It cost me nothing to get my game running on Linux. It Just Works. I expect the Mac one to do the same. So don’t be thinking about Win32-only games any more; there’s no need, it’s been proven you no longer need to concern yourself with it.

Cas :slight_smile:

I’d like to return to the topic and ask,
what is your favorite AWT replacement for 2D games?

Thanks.