The Weblog » 2008 » February

Halting Problem

The Weblog

Part of Roland Sadowski's website

February 29th, 2008

Diving Into Java

I was the guy who not so recently declared on every occasion: I hope I will never have to program anything in java and my mind will remain java free for the rest of my life.

I hoped. But some time ago I decided to write a game and the only engine that had everything I needed in an easy to use package was jMonkeyEngine for java. I also looked at Ogre3d, but the Ogre model exporter in Blender didn’t work at the time. jME has importers for the most common formats, so there shouldn’t be a problem.

I have never programmed in java before but going from C# to java is relatively painless experience. Basics are the same. All the really useful things from C# are missing (eg. delegates). In the end I find the java language really boring and I wasn’t surprised by any of its limitations. Irritated, yes, Surprised? No.

Apart from the language I had to get used to Eclipse. It’s a pretty good IDE, but it uses a lot of resources. Every 2-3 minutes my cpu usage spikes, so if I’m listening to music at the moment on anything other than Winamp, I hear skipping or pauses. I experienced it only on Windows, linux manages to withstand Eclipse’s whims. Well, almost. Eclipse on linux has one of the most unresponsive UIs I’ve ever seen. I find it unbearable.

But let’s get back to java. JDK comes with Rhino javascript engine, and thanks to some recent additions to java’s API’s, other scripting languages are pretty easy to host on the JVM. I decided I’ll stick to rhino, so javascript is the scripting language I use in my project. There are libraries for jME which provide a console, like the one in Quake. That’s useful for development. But nothing beats custom tools, which I know I should write, but I just don’t have the desire to learn SWT or Swing or whatever right now.

Since I’m mostly done with building the base layer of code, soon I’ll start playing with the mechanics of the game, and then graphics, effects etc. I’m completely green in that area and I can’t wait too start. Too bad I have to focus on my thesis

§