Newbie Alert

Hi, I’m brand new to jME. So I had a quick question. I couldn’t find anything that worked well from the wiki…



I’m trying to make a TBS (Turn-based Strategy) game. I have bullet loaded up and working (mostly) thanks to the tutorials, but I was wondering about the camera and movement. I tried loading up the Chase cam instead of Flyby. Which gives the look I want, but not the feel. So I was wondering if you guys had any tips on getting a system that steers the character with the keys, and leaves the chase cam independent. In other words I want to be able to walk my character around the level in any direction with out the camera view controlling the direction.



So I need help in both the camera rigging and basic character movement.

Oh btw. Heres my current update function…



[java]

@Override

public void simpleUpdate(float tpf) {

Vector3f camDir = cam.getDirection().clone().multLocal(0.2f);

Vector3f camLeft = cam.getLeft().clone().multLocal(0.1f);

walkDirection.set(0, 0, 0);

if (left) {

walkDirection.addLocal(camLeft);

}

if (right) {

walkDirection.addLocal(camLeft.negate());

}

if (up) {

walkDirection.addLocal(camDir);

walkDirection.y = 0;

}

if (down) {

walkDirection.addLocal(camDir.negate());

walkDirection.y = 0;

}

player.setWalkDirection(walkDirection);

cam.setLocation(player.getLocalTranslation());

}

[/java]

Abbies posted a RTS camera control here http://hub.jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/rts-camera-control/

Maybe you should try it



The character moves forward following the camera direction because you tell it to do in your update function.

the chase cam just follows the target.Look at TestChaseCam to understand, the target moves only on the x and z axis with th e arrows.



What you would need (i guess) would be to keep in a variable the direction of the character. up would make it go in that direction, right would rotate the direction vector to the right, left to the left.