Question on how to implement building & player

After some few months delving into JME I need an advise which is the best way to implement following things.



I'd like to create some kind of skyscraper building. This building will be created in blender and imported into JME. Within this building a player should be able to walk around. Sounds not complicated, but following 2 thoughts came to my mind:



The building - old and desolated - has holes in some of the floors. Like in a FPS I want the player being able to jump over these holes or fall down. Now I am not sure how this jumping and falling should be handled? Do I need to use JMEPhysics for that, or is there another approach for this kind of gravity-dependent actions?



Now that the player should be able to walk in the building I guess I need some way of collisiondetecting in order to make the player not walk through walls. So… is it possible that this whole imported building automatically gets a collision on all its walls/floors/ceilings and that there is no collision at the empty areas (rooms/holes/door openings)?



I am not clear in these aspects and would like them to be … ehm… cleared XD, probably preventing a time consuming wrong turn from my part.

I believe physics would be the best approach for this… You can always have a low-poly version of the same building for all collision computations and a high-poly for visualization.

Thanks, that sounds very reasonable :slight_smile:



After reading into the JMEPhysics Lesson 2 it seems that collision can be applied to objects with a single function like

spatialobject.generatePhysicsGeometry(true);



Thats sounds very simple and exactly what I need. I was not sure about the whole thing since I read this thread which had the problem of having the doors and inner rooms not being excluded from the collision.

Now that I've worked into physics some I found out that things turned to be not that easy as expected while encountering problems like playerobject should stand upright always, playerobject should not tip over etc.



Also I read lots of topics in the physics-forum and found posts claiming:

"Physics and Animations don't mix well"

"Physics are too difficult when using multiplayer"


Also when using physics I thought about: "how shall this physics work when the player is supposed to go up a stair without jumping => moving forward using addForce() will most likely cause the playercharacter stuck in front of the first step.



And then the thing that almost all sample codes (such as flagrush tutorial or TestObjectWalking.java etc. never use physics… I really don't get what I should use now. Maybe I need to explain my goals further:


  1. I want to have a player being able to duck/jump/run around in a building (this includes walking on stairs :wink:
  2. Of course I want to use animations when the player ducks/jumps/runs
  3. I want the whole thing to be able to use with multiplayer (not MMORPG, but maximum 4 players)



    (4. that's now optionally: at first I wanted to implement objects like tables/chairs etc. to push and throw around… but I am not sure now since I read many posts claiming how difficult it is to synchronize it when using physics and that you should use "self-programmed-fake-physics" for jumping)



    Action like in a Deathmatch-Game. But let's stay I want to create something like the multiplayer part in SystemShock 2, where people cooperatively fight through the game. I just need to implement the basic functionalities (no textures, levels etc.).



    Now any further/other suggestions which is the best way to approach that?

http://www.jmonkeyengine.com/jmeforum/index.php?topic=9341.0

i implemented my own collision handling system. now i am proud (really really cool algorithms i invented there) and ashamed at the same time (rererererereinvented the wheel), which is really rare.