First Person Shooter - Best Tools/Classes?

I would like to create my own First Person Shooter. 

Features:

Lan & Internet Play 8 players

Mouse and KeyBoard support: Be able to walk up stairs

Menu

Nice to haves:

Vehicles

Rag Doll Physics on Death(Client only)

Bump Map and/or Tangent Space Normal Map

On Screen Mini Map



IDE: Eclipse

3d Modeler :  Blender 3D

Texture: GIMP

Client.Graphics Engine :JME2.StandardGame

Client.HUD: FengGUI If i can figure out how to get it to work with JME 2

Client.Sound:?

Client.Player.Mesh:Using MD5Importer. Any better suggestions?

Client.Player.Animation:Using MD5Importer. Any better suggestions?

Client.Static Objects:?

Client.Material Files:?

Client.Partical Files:?

Client.Physics(so character doesnt fall through floor):?



Server.Networking :?





Question1:

The MD5Import allows me to pull in one texture and one animation but I cant seem to figure out how to change to other animations.  IDLE,  RUN, SHOOT

On the texture it would be nice if I could have texture on the Body and a different Texture on the Head but it looks like ModelNode on the MD5Import only holds one texture.  I would be curious to know what other people are using  for their character model files.





Question2:

I would like to use the StandardGame approach.  I cant seem to find an Example of Best Practices.

I have a basic understanding of what  a GameState is but I dont get where you translate the Models at

Do you create a Class that Extends Node and store the location there and update it in its own Update() method

or do you Create a GameState for each model and Translate that around?





Thanks for any suggestions and help.  If anyone wants to help me create this let me know.

I get on irc  freenode #jme  but its not very active.



-Greg

hi i think i m not much more in it than u are but i hope i can help you anyway :slight_smile:


Client.HUD: FengGUI If i can figure out how to get it to work with JME 2

check this out: http://www.jmonkeyengine.com/wiki/doku.php?id=integrating_fenggui_with_jme

question 1:i m not sure (i didn t try it yet) but as far as i understood it you simply row the actions and than call lets say frame 5-8 for the walking animation.

for the physics i would try jme physics 2 https://jmephysics.dev.java.net/ its great and in the tests you ll find somthing like Rag Doll Physics on Death although i think it will take a lot of work to transfer it onto your own model

Thanks Slevin

What are you using for your models?





Any chance you want to help me code my First Person Shooter?

There's this FPS game written a while back by Fly which might serve as good sample code: http://www.jmonkeyengine.com/jmeforum/index.php?topic=2111.0


yunspace said:

There's this FPS game written a while back by Fly which might serve as good sample code: http://www.jmonkeyengine.com/jmeforum/index.php?topic=2111.0


I wasted about 3 hours playing that game...
EDIT: NOT saying the game is a waste of time--I am saying I dedicated 3 hours of my time to playing that game, which is definitely a compliment considering how I quickly become bored.

Im setting up my gun model.  Can anyone help me with rotation and translation.



right now i have gun.setLocalTranslation(cam.getLocation()+cam.getDirection());



This places it directly in front of camera, but I want the rotation to update(barrel always pointing away from camera) and I want it to be move to the right and down (so handle is off screen).



Any suggestions on the math and how to get the cameras rotation?


there is a method get direction which returns the direction u are looking in so u need simply to set the direction of ur weapon into this direction same with the location and you need to do this in the update method  cause it needs to be done every frame.

never the less if it shall be the weapon ur character is holding  i think it would be smarter to add it to the hud so you dont need to care about setting a position every frame


The easiest solution would be to put the camera inside a camera node, and then attache the gun to the camera node. Then as the camera moves, the gun does as well automatically. You would only need to set the location of the gun relative to the camera once. But this also depends on how you are handling the camera right now, your input handler would need to use the camera node instead of the camera.

The easiest solution

easier would be to make a rendered image of the weapon and add this in the hud with lets say fenggui or something ;)

I think im going to use the cameraNode approach.  Slevins HUD way would probably have the best performance but I want to have animation on the weapons and also show light changes(i.e. walking into dark section would make weapon dark)



In the jme 2.0 src I found a Class TestCameraNode that Im going to convert to use the StandardGame way.



Thanks again for the help.

gbluntzer said:

I think im going to use the cameraNode approach.  Slevins HUD way would probably have the best performance but I want to have animation on the weapons and also show light changes(i.e. walking into dark section would make weapon dark)

In the jme 2.0 src I found a Class TestCameraNode that Im going to convert to use the StandardGame way.

Thanks again for the help.


Yes thats the right approach, but you will run into the same problem like me. Your gun will stick into the wall. Only way to avoid this is to make the mesh smaller and add a clipping bouding box around you. But thats not a great sollution too, because things like trees or Brushes that you can barely touch will stick in your gun. Right way to do this is render the gun on top of all except the hud. Maybe someone can help me with that at this post.

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

I think my post was ignored because ist marked as SOLVED, but not for me  :'(

Hey redwolf. what you said about the going into walls happened.  I added a call to

weaponModel.setRenderQueueMode(Renderer.QUEUE_OPAQUE);

and it seems to help.



My next issue to solve is figuring out why when I move forward and backwards the weaponModel does not seem to update until I let go of the key(W or S).  It seems to be moving the cameraNode correctly but not the weaponModel attached to it.  Once I let go the weaponModel will correct.





any thoughts?


       
        // this in init
       camNode = new CameraNode( "Camera Node", display.getRenderer().getCamera());
        input = new NodeHandler( camNode, 15f, 1 );
        camNode.attachChild(player.getFpsWeaponModel().load(display)); // load returns the Weaponnode
        camNode.updateRenderState();
        rootNode.attachChild(camNode);

        // overwrite method
        protected void cameraPerspective() {
                cam.setFrustumPerspective(55.0f, (float) display.getWidth()/(float)display.getHeight(), .1f, 2000);
                cam.setParallelProjection(false);
                cam.update();
       }



This is my code hope that helps. Maybe

It may have something to do with your key-detect having repeats set to false?

I tried the key detect approach and that just made me have to hit w and let go for every step



Possible Solution:

I updated my WeaponState.update() method with this

weaponNode.updateGeometricState(0.0f, true);



Im not sure exactly what its use is but it fixed the problem of the gun not moving with the camera until i release the movement key.


I know that the MD5 Importer is not part of the JME com.model.md5.importer.MD5Importer, but does anyone have a code example of switching between two animations?



I have it loading my md5anim and md5mesh files but i cant figure out how to switch between animations.

My Character just WALKS.  I want to switch to IDLE, ATTACK animations



There was a mention on another post of setting the start and end frames but that doesnt seem to be available in the com.model.md5.controller.JointController. It looks like MD5Importer only takes one animation.


               
URL bodyMesh = HelloWorldMD5.class.getClassLoader()
                     .getResource("com/bluntzer/data/bigorc.md5mesh");
               URL bodyAnim = HelloWorldMD5.class.getClassLoader()
                     .getResource("com/bluntzer/data/bigorc.md5anim");
               try {
                  MD5Importer.getInstance().load(bodyMesh, "ModelNode",
                        bodyAnim, "BodyAnimation", Controller.RT_WRAP);
               } catch (IOException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
               }



any help?

-Greg