revisiting jME3 (jMonkeyEngine)

Added 11 Oct 2013, 10:29 a.m. edited 19 Jun 2023, 3:41 a.m.

An adventure with the command line


I've often kept my eye on jME as its a really fantastic engine, alas I've always found the IDE heavy weight and just a tad unwieldy. I've yet to see a heavy weight IDE in java a really like, don't get me wrong I love java but for complex GUI's it seems to get bogged down, I'd love to see and IDE using javaFX but I digress... So I found this tutorial about using jME3 from the command line (my favourite ide when combined with a simple text editor ;) ) - I was going to rant about intelliguess again but I won't bother... :D Alas the tutorial was a little out of date and seemed to assume you'd directly call javac yourself! (who'd use gcc without make?) Fortunately hammering my boiler plate ant script into something serviceable was very easy. If you choose the svn route for the jme jars, ant run will very quickly have you running the tests - some of which you won't see just what they are really doing just by running them, you're as well to be browsing the source for the tests as you run them... there doesn't seem to be a "dist" target but the update-sdk does seem to make a dist directory but be aware it also places folders and files in the directory above jme's (bit naughty that!) I've attached my build file here one nice point to note is the jars in the compile or run targets

rather than cramming all the jars onto a single unreadable line that's difficult to maintain I like to give each jar or path its very own line... You'll have to change things like the class name in the run target and bullet library path and so forth, for the lib directory I just made a symlink to the dists lib directory... Returning to by experience with the tests - I have to say I'm really rather impressed with the ease of use of jME - everything in the engine seems consistent and believe it or not logical (wonders will never cease!) Just by cobbling together a number of code fragments from the tests, within a few hacking sessions I had a vehicle running over a landscape casting shadows and firing exploding cannon balls (real explosions too that "fling" other objects) I'd estimate that if I was just directly using OpenGL and Bullet physics you'd be looking at at least a weeks coding if not two! Just one minor irritation although in the javadocs there were specified alternatives for deprecated methods (which is good!) there is very little and often no descriptive documentation for classes - what's it for ? how should it be used ? Alas this is all too common and really slows down the adoption of libraries and directly effects their popularity... That gripe aside I'd really recommend looking through the jME3 tutorials, they are a tiny bit dated but you can usually replace the deprecations (a good learning exercise in itself) the test code if quite extensive and you can usually find a example usage for most things in the engine.