Decoupled physics

Hi



Im gonna try and implement quake 1 style network code in a jme app. For that to work i need to decouple the scenegraph from bullet and do the simulations manuallt. There will be alot of “starting at time t0, put objects in these positions / operations and simulate up until t1”. Ill prolly need to reset the physics space alot… starting from different instants in past time. Does anyone see a problem of decoupling bullet from jme / using it independently but still utilize a lower level api? Would it require to write native calls from java or are the java “adapters” for all that is needed?

Bullet is not able to go back at all.



Only thing you could do is sotre all data in like 10ms steps for velocity position rotation for all objects, and set that manually.

@EmpirePhoenix said:
Bullet is not able to go back at all.

Only thing you could do is sotre all data in like 10ms steps for velocity position rotation for all objects, and set that manually.


I prolly expressed myself badly. I understand theres no rewind. But id hope theres atleast delete object/add object? Maybe reset/new? Or maybe a reset velocity/accel and reset positions. Is it possible to have "many" simulations at once? Or can there only be one bullet instance at any point.

Well yes, how else would the engine add the objects itself :stuck_out_tongue:

You can also run multiple simulations, I think its not what you want tho.



I would story the position of all players every 25 ms for 250ms past (who plays with larger ping sucks anyway XD) Then prior to the ray test for the bullet, just set the player position only back the closes one, calculate hits, and set back to current.



Having anything more complex like physical barrels ect is kinda problematic. So if the level itself is static this works kinda good.

Hi



Putting down some time lately to get ahead with this action multiplayer game. As for now, i must say im really happy about the traction ive had. Before ive been put of on that so much time was needed dwelving deep into low level apis and code-swelling algorithms, to accomplish simple tasks, because of primitive languages. Now, with JME/bullet and Scala ive got a perfectly fluid multiplayer game with logical server collision detection and client side prediction/visual collision detection. Having bullet for physiics and jme for graphics/input available i could focus on the parts that interrested me. Felt meaningful to learn that is. Im just adding-projectiles-to-inplace-collision away from creating my first ever game (even if simple) that i set out to do. A personal goal so to speak. The JVM has its limits but no other existing enviornment would let me into the world of games im sure. So i just wanna send a big thank you to the JME team for creating this good framwork that let me achive that goal.



/proud “Amature Game Developer”

2 Likes

Cool. So you use the jme bullet api? Or vanilla jbullet? The former also gives you native bullet and you don’t have to use the controls layer.

I did a fair bit of work on something similar. I don’t know how much you want to try and do yourself but I can email you the code if it would help. I may put it back on googlecode at some point, but I need to get Sinbad it working again first!



Matt

@normen said:
Cool. So you use the jme bullet api? Or vanilla jbullet? The former also gives you native bullet and you don't have to use the controls layer.


I am using the PhysicsSpace.java api (wo a BulletAppState attached) so its the jme bullet api. I thought id disabled non native version. As I just switched to the sonatype maven distribution it seem i switched back to jbullet-jvm-only as the native version isnt available at sonatype!!! Sad. I really dislike not having dependencies autofetched for me.. Anyway, Im prolly to n00bish to understand what constraints the Control layer puts on me, but so far ive been fine with the Spatial.getControl-way of working. Do you see some argument for not using the Controls layer? As i see it "controls" are just a pluggable handle on a spatial?! Nice to have the physics available there too..

Sure, idk how your app looks, just wanted to point out that you don’t have to use it.