Okay, Give it to me straight, is this possible? :D

I’m a moderately experienced game programmer whose written text games, games using DirectDraw, multiplayer internet games using Direct3D, and recently some fun physics based games using Newton’s physics engine.

Physics are a blast! …and not my strong point.

I’m starting another game project from scratch using JSR-184. It’s basically a stripped down version of Java 3D (if I recall correctly) neither of which I have any experience with. JSR-184 (m3g? Java 3D for mobiles?) is a specification for 3D on limited handheld devices.

I want to create a game using realistic physics and JSR-184. The problem is… there are no native binaries available for the devices that run JSR-184. They themselves are only running a stripped down version of Java – J2ME.

Does that mean I can’t get ODEJava to work with JSR-184? Are the native .dlls absolutely mandatory? I don’t need ODEJava to manupulate the screen, only the update the object’s locations and whatnot. JSR-184 is suppose to be very similar to Java 3D which there is already a binding for.

I have a gut feeling that this is all fruitless. There is no way I can write my own physics engine (yuck!) and I have a bad feeling that a Java ODE wrapper absolutely must need native support.

Last, but not least, this is going to be a lot of fun if it works. I really enjoy having to work with limited hardware. If you’re interested in this, let me know, let’s see if we can work something out. :slight_smile:

Trounce

Odejava is just a binding to ODE, ODE is the actual physics engine. So in short, Odejava does require the natives to run properly.

There was much talk about making Odejava Java only, but i dont know what happened to that…

Guess your stuck with making one on your own. That or finding a physics for J2ME (probably costs you an arm and a leg!)

DP

I’d have a better chance of turning lead into gold before I’d be able to write a physics engine. I can handle the simple things. Most games use some form of physics, but the real fun stuff requires all kinds of scary math concepts.

What about… looking at the ODE sources and making a ‘light’ version? At it’s core it’s all math right? It’s just a bunch of equations?

I think you’re right about physics for J2ME. That would be valuable. Maybe more valuable than any commercial game ever developed from it. :slight_smile:

I’m up for the challenge if anyone else is.

ODE is pretty greedy on system requirements in addition to being native code. It uses the stack heavily and performs many floating point calculations per second (some devices such as the PocketPC apparently only emulate floating point arithmetic.

I think what you need is a lightweight pure java physics engine as has been suggested.

[quote] What about… looking at the ODE sources and making a ‘light’ version? At it’s core it’s all math right? It’s just a bunch of equations?
[/quote]
It’s certainly possible to look ad ODE and learn how a physics engine works. I would suggest a very good understading of physics and dynamics engines before tackling such a project though.

Will.

So are you developing the game for a limited handheld device using J2ME? If you are, then it will be impossible to use ODEJava with JSR-184. But I do agree that a light version of ODE in pure Java is certainly possible. Many of the current devices aren’t really powerful enough to cope with the number of computations, but they are getting faster day by day.

I’ve heard rumours that some companies are considering whether to embed a physics API in their J2ME devices. But even if that was to go ahead now, it would take year or two before anything becomes of it. Eventually it will surely happen, but there is currently very little on the horizon.

A pure Java version of ODE would be a very cool piece of technology to have.

Yep, using J2ME.

I’ve gone ahead with plan B: Look through an open source physics engine and try to gut it / re-code it in pure Java for use on J2ME.

Many physics engines have loads of features that just aren’t needed for a specific game. I think that if I only use the features that are applicable to the game, it might be possible. I figured that any device that can use JSR-184 should be powerful enough to simulate limited physics.

…that’s the theroy. :slight_smile:

Of course all physics engines use floating point math which would be a problem for current devices. I’m going to try it anyway.

It will probably be too slow, but… maybe not?

It’s certainly worth a shot.

I wouldn’t worry so much about floating point. I’m sure that the situation will improve soon and, even if it doesn’t, you could release your code as open-source and somebody is bound to convert it to fixed-point. I believe there is a strong demand for a J2ME physics engine.

However I am concerned about the fact you might not be able to retrieve the transformed data from a JSR-184 scenegraph. I am not familiar with combining physics engines and scenegraphs, so bare with me here. In JSR-184 you can create a scenegraph, rotate things about a few times and then you have no idea where anything is. You cannot retrieve much data from it, you can only render to the screen. So would you need 2 copies of the data? One copy in the scenegraph (that you cannot access) and another copy for calculating collision intersections. Both would have to be transformed independently, causing further computations, and both would be consuming valuable heap. Is this the case? and can it be avoided?

The same is with ODE :slight_smile:

GeomTriMesh will require you pass it an array of vertices and the indices. This will be stored in ode somewhere…Two copies of data, both dont talk to each other.

DP

I didn’t even think of that. I haven’t used JSR-184 in any depth what so ever. I just assumed it would be similar to DirectX and allow you access to vertex and matrix data.

I think there would be two systems in place. One virtual for the physics side, and one visual for the game’s models. The physics engine would take care of all collisions and the creation of primatives. Once the physics engine has updated, it would just send the physical object’s matrix to the 3D model handled by JSR-184 which should then animate realistically.

This is going to be very difficult. :-/

I have that loathing feeling that I might be biting off way more than I can chew. :slight_smile: