Moving away from Java

This is probably a weird first post, but I want to say that I’ve been making 2d Java games for 6 years and I am tired of carrying the bloated JRE in my distributions. It looks amatuerish. I love the language but Sun doesn’t seem to realize that some developers need more flexibility.

I was using AWT only.

I am moving to C++, but do you guys have any suggestions about a library or engine that would make my transition from Java more smooth?

That is a weird first post :slight_smile:
I thought SDL is pretty nice to use.

Is having to carry the JRE really the only reason to switch to C++?

[quote=“tnttnttnt,post:1,topic:33091”]
Except that they finally are. It’s at least a year away, but it’s really happening this time.

http://blogs.sun.com/theplanetarium/entry/project_jigsaw_modularizing_jdk_7

It’s the main reason. I love java and I love awt. In fact my games were featured on java.com for years. My main job is j2me games development.

I had my own graphics engine for applets that was super fast. But I am sick of the nerdiness of the Sun mentality and I decided to move away.

That’s cool but I decided that I don’t trust these guys any more. I won’t say more because I don’t want to turn my thread into a flame war. I am really looking for some helpful suggestions, so if you can help please do.

I’ll start by saying that I’m looking into using PTK. What do you think?

Do what I did, and just hack all the crap out of the JVM you don’t need. You can get it down to a few meg compressed. (In my case, 2.5mb, because I didn’t even include AWT - I used LWJGL)

Cas :slight_smile:

That’s against the Sun distribution license. Legally you can get it down to only 15 megs or so. Correct me if I’m wrong.

I’m not sure what PTK offers that SDL doesn’t. PTK does seem less portable and more proprietary.

As an aside, have you considered going a similar route as Cas went with puppygames on Windows? (moleboxing a tiny stripped JRE + LWJGL)
Or even GCJ?

[quote]I had my own graphics engine for applets that was super fast.
[/quote]
How do applets relate to your problems with distributing the JRE? ???

Not that C++ doesn’t have any advantages above Java, but in the context of Mac & Windows only 2D games I don’t really see them to be honest. Especially since your problems with distributing the JRE can be worked around.

That’s a bit debatable.
Sun’s distribution license is probably mostly meant to prevent people from distributing incompatible versions of their JRE, which is not what Puppygames is doing.
Puppygames doesn’t really distribute java. It’s just an exe with the game. Of course there’s java inside, but that’s not accessible from the outside.

AFAIC, no harm’s done and Sun doesn’t seem to mind Puppygames at all.

I did try that. The main problem was that the final exe was recognised by some antivirus software as virus, and that’s the Kiss of Death for the shareware games market.

About the applets, I was doing the 2 piece deal. Online applets and downloadable application, based of course on the same awt engine. All Java 1.1 compatible and I’m proud of that! :slight_smile:

Ok I see, that makes sense then, but puppygames don’t use AWT which makes things easier for such a job. I’d rather distribute the official JRE, it would be more efficient in my case.

Edit: I just re-read Cas’ post and he did say that he’s not using AWT, so there you have it.

Ouch.
Was that trying GCJ or molebox?

Oh, ok I see.
But since you’re moving away, I guess the applets are not important to you?

I think it was the Excelsior JET free trial.

Good question. I would lose the applets and that will hurt. I would have to add some sort of embedded video I guess.

It was a version of Molebox that triggered the virus warnings (because some tool had packaged a virus in Molebox and then all Moleboxed apps were tagged as being viruses - duh - and long since fixed).

It’s kind of a moot point these days - we stopped shipping the cut down VM over a year ago, and embed an entire kosher VM now. Distribution size went up by 10 megs … and nobody noticed or cared. Simple as that.

Excelsior JET is a super excellent option but it costs money and it is indeed somewhat fiddlier to use - and in fact to get the actual size down is just as hard as using a sneakily hacked JVM. I used to use Exelsior JET when I first deployed Alien Flux - the entire demo came in at the magic size of under about 5mb. The one with the hacked JVM ended up being about 6mb I think. And then I ditched using separate demos and full versions and it ended up about 10mb with embedded hacked JVM.

Anyway to cut a long story short - almost nobody noticed or even cares that the whole VM is embedded but if I wanted to I could switch back to a hacked one and … nobody would notice or care, least of all Sun.

Cas :slight_smile:

Every time I try and move away from Java, eventually Eclipse just drags me back. Development environments for other languages just aren’t anywhere near as mature and functional as what’s available for Java. :frowning:

Any chance we could see some of the games so it’ll be easier to suggest what other APIs will give you required functionality?

Are you just blitting images to the screen at the end of the day, or are you dependent on more of AWT than that?

Kev

I had implemented my own drawImage() that was much faster than the awt one. You know using one huge array that represented the entire screen buffer and I would copy things on top. There was one drawImage() call at the end to blast the contents to the screen. Plus rotations, scaling, etc.

For 1.1 it was awesome. Not such a big deal for the newer Javas. Anyway, anything that would be simple enough to do direct clipping and blitting, not having to deal with textured quads or whatever is being used as the engine, that’d be great.

I would like to remain somewhat anonymous at this stage if you don’t mind. Although I’ve given enough clues. (Not that I consider myself to be anyone special)

I have tried C++ before(not for games though). it is different.

One problem wiht ajva is taht it is so good that other languages dont make my high standards anymore lol.

GL with C++

So, the only reason you are moving away from Java is due to JRE distribution size? How big are your typical games, JRE included? As for distribution via the model that Cas has been using, for years, has not stopped Sun from promoting his work in any way. Agreed that this is a weird first post. If you have been developing for 6 years, it would have been nice to have had you introduce yourself and your concerns sooner.

What I find interesting is that, lately, I have been talking to more developers who say they are moving back to Java after a few painful years of Flash…

Could you please tell me a bit more about what you are currently using to package java with? It might be worth giving it a try.