Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Bring it!

Sign in to follow this  
Mayan Obsidian


360 goodness
So this sunday I finally got myself a 360. And of course, I got Gears of War to go along with it. I had already beaten it at a friends house, but I loved that game so much that I had to get it myself.

And of course, I wanted the achievement points as well. Not that I'm an achievement point whore or something, I just think it's a brilliant system of encouraging gamers to do their best. Plus, I'm really enjoying the community and connectivity of this new generation of gaming consoles. I don't think I'll get rid of my PS2 for a while though.

Mainly because of Final Fantasy Tactics.

Everyone has one game that they always go fall back to when some other game in that same genre blows. Whenever I try a new strategy RPG, I just realize it's shit and then I go back to playing tactics. After playing Doom 3 what did I do? Went back to playing real Doom.

My Fallbacks:
Strategy: Final Fantasy Tactics (The job system is a requirement for a strategy game IMHO)
First Person Shooters: Doom (20 imps, 10 shells ... whatcha' gonna do?)
Puzzles: Super Puzzle Fighter (Super Tug-of-war battles, with strategy!)
RPG: Final Fantasy VII (Growing Materia is like crack to me)
Fighting: Capcom vs Snk 2 ( Like the 6 different "grooves" you can fight with)
I don't play Sports or Racing games.


So I spent most of this week wresting with default model viewing directions and allowing the character face where they are actually moving. At first I had big problems with this implementation. My movement model is restricted to the axis'. Moving up would be moving in the positive Z direction, and left would be in the negative X direction. My problem was letting netwon know the angle between the direction that the model was facing and the intended direction of travel. Once I had that angle stuff figured out, I forgot to normalize my intended direction vector so the player was facing in strange directions when not moving up and down.

I had some really overly complicated algorithm using a lot of quaternions but then I finally came to this simple way to make an actor face where they are moving:

//Get this actor's current direction and normalize it
Quaternion CurrentHeading = orientation;

//Multiply it by the default facing direction to get the currently facing vector
Vector3 VecCurrent = CurrentHeading * a->getFacing();

//Then get the last direction we wanted to move in.
//So that when the player taps a key, this will automatically turn the actor into the last direction
Vector3 VecDesired = mLastDirection.normalisedCopy();

//Do a cross product to get the upvector, this will be the angle we apply the torque to
Vector3 CrossAxis = VecCurrent.crossProduct(VecDesired).normalisedCopy();

//Get the steering angle between the current vector and the desired vector
Radian SteerAngle = Math::ACos(VecCurrent.dotProduct(VecDesired));

//Get the amount of time that passed since the last timestep
//Real fElapsed = body->getWorld()->getTimeStep();

//Calculate the torque needed to turn in that direction
Vector3 thetorque = ((CrossAxis * SteerAngle.valueDegrees() * 20.0f) - (body->getOmega() * 100.0f));

//Add the torque to the physical body
body->addTorque(Vector3(0.0f, thetorque.y, 0.0f));

Later on, I'll have to add movement that's not just relative to the axis', but maybe to the camera as well. But at least I got a good start on movement.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!