Switching from xith3d to jme3 (Experiences with HELI-X)

Hello,

I am the main developer of HELI-X (www.heli-x.net) and want to share my experiences with you, when switching from xith3d to jme3. First of all, tank you for all the developers and contributers of jme!

HELI-X is not a game but a simulation software which helps r/c helicopter pilots to learn flying. Up to version 4.2 it used the xith3d library and I decided a year ago to switch to jme3. The main reason is that xith3d seems not to make much progrss and I never got the shadows to work properly. Used from the libraries is mostly the graphics part. The physics, collision etc. does not use any libraries beside some math libraries.

The switch to jme3 took approximately two months or so. Jme3 has in my oppinion a clearer concept and is not so difficult to learn because there are many tutorials. The background of the scenes is made with a sky cube. Because I want to use textures for each side with arbitrary size I wrote some shaders for this. Problems come from the memory consumption. Sometimes textures for each side of size 4096x4096 are used with alpha channel. Then the switch of a skybox was difficult since one easily gets in memory problems. The

NativeObjectManager.UNSAFE = true;

helped, but I am still not sure how to free the memory in the graphics card efficiently. The cache in the assetManager is also cleared after each loading of a texture.

The models are stored and loaded as wavefront object files, since I want others to make or adopt models. In order to allow texture changes of some parts or identify what are the rotors etc, the model loader had to be extended to take care of the names of the groups.

HELI-X 4.2 works in a awt canvas, and the current version should run in the openGL window, because of performance, in particular on Mac OS. Thus I had to take care about the UI. I decided to make the main menu with nifty, and kept the old Swing dialogs for the moment. I am still not sure how to go further with the UI. However, making the menu system took me quite a long time. Nifty is not so easy to understand.

Issues today are that the input of japenese letters (HELI-X uses a dozen languages or so) is not possible in the chat window. Also a copy/paste feature in the TextFileds is missing). Another thing is, that shadows on a half transparent surface (as the disk of the rotating rotor) are to dark and I have no idea how to make them softer without chnging the shadows on the normal ground.

Altogether, the graphics of the aplication is much nicer (better shading, shadows, etc.) and the FPS are a bit slower which is ok, since the graphics is so much better.

If you want to see the programs, the fully functional demos are available at the HELI-X side (both versions, with xith3d (4.2) and with jme3 (5.0).

If you are interested in more details, I am glad to tell you
what you want to know.

Again, thanks to all the contributors of jme3.

Michael

P.S. Here is a video of how it looks:

[video]http://youtu.be/YT_fh7JHs9k[/video]

6 Likes

Looks pretty cool! Thanks for the write up.

Can r/c helicopter fly like that for real, I had no idea :-o The graphics looks sweet.

I guess you have looked at using compressed textures (S3TC/DXT) http://www.opengl.org/wiki/Image_Format#Compressed_formats
I think the skybox can handle DDS-files and that might take away some of the pain even if it isn’t an answer to the question on how to release textures.

What might work, disable skybox, system.gc show new skybox (all coverd behind a nice loading screen and over a few frames)

But I must say I never knew rv helicopters can fly pretty much upside down, kinda impressive.

A friend of mine is actually a r/c helicopter pilot, and trained with this kind of software (idk if it’s this one though).
He showed me this in real life and that’s very impressive. This things go really fast and can do really wicked figures… that is…if the pilot can do it…
You can’t really afford to try flying upside down for the first time with a real chopper as you will probably fail and crash it…and those things are quite expensive :stuck_out_tongue:

Very good work it looks really nice

@jmaasing said: Can r/c helicopter fly like that for real, I had no idea :-o The graphics looks sweet.

I guess you have looked at using compressed textures (S3TC/DXT) Image Format - OpenGL Wiki
I think the skybox can handle DDS-files and that might take away some of the pain even if it isn’t an answer to the question on how to release textures.


Well, thanks this is a good hint, I never thought about this. There are many small programs for converting png to dds and they all do not well with the alpha channel. I found “The Compressonator” useful which you can get from the AMD web site.It does a good job and the dds files are loaded without any problems from jme3.

Michael

@Empire Phoenix said: What might work, disable skybox, system.gc show new skybox (all coverd behind a nice loading screen and over a few frames)

But I must say I never knew rv helicopters can fly pretty much upside down, kinda impressive.


This is what is done currently. Removing the textures and waiting 10 frames or so until trying to load the new one. I tried to this in one frame but this did not work well. The source code tells us why: there is a limit of memory which can be returned per frame.

Michael

Have you tried using Image.dispose() method? It allows you to mark unused images for disposal which generally occurs on the next frame.