

Let's Make a Game Engine for XNA 4.0r, Part 5, Ren.Converting the Quickstart Game Engine to XNA 4.0.I might go more into some annoyances using Gamebryo later, but for now I'm still bound to an NDA on most subjects. It was always a fun task when trying to do something that involved aligning the camera based on a rotation that was in another system, you'll set them to the same rotations and then rotate the camera 90 degrees to line it up. There was no way we were going to use the X-axis as the forward for LEGO Universe, so we ended up having to deal with Gamebryo's wacky camera coordinate system. But I had never seen an X-axis be used for a 'forward' before. Seriously? What game has EVER done that? For those new to game programming, about 90% of games use the X-axis as a 'right' vector, and Z as a 'forward', the other 10% use the Y-axis as the forward and the Z-axis as the 'up'. Their camera coordinate system has a 'forward' vector of X, rather than Z. Here's another little chestnut that Gamebryo left me to deal with. Gamebryo likes to make sure the programmer is paying attention I guess. It's always fun to try and remember which way you need to rotate which type depending on the case you were using it in. quaternions. Those two rotation functions I listed earlier, if you want to represent the same rotation with a matrix as well as a quaternion you pass a positive angle into one, and a negative angle into the other. Gamebryo also thought it would be cute to use opposite rotation directions for matrices vs.
Game dev engine like gamebryo engine code#
Alternatively we could have just rolled our own Slerp code or altered Gamebryo's version to use ours, but Gamebryo made calls internally to its Slerp method so we didn't want to break something by fixing something. We ended up discontinuing the use of Gamebryo's Slerp method altogether and calling to Havok to have it do the rotations for us. On top of that, the Slerp ( spherical linear interpolation) did not even work properly with Gamebryo, often causing objects to rotate 350 degrees to get to the target, rather than 10 degrees. Want to lerp a Matrix? Sorry, convert it to a Quaternion, lerp it, then convert it back to a matrix. Want to lerp ( linearly interpolate) a Quaternion? Go for it. Want to do that with a Quaternion? Do it yourself, there is no function. Want to make your matrix an identity matrix? Call 'MakeIdentity( )'. Gamebryo included a lot of functionality in either the Matrix or Quaternion classes, but not both. Quaternion function: FromAngleAxisX( float angle) Matrix function: MakeXRotation( float angle)

Gamebryo (the game engine used to make LEGO Universe as well as other titles such as Fallout 3, Oblivion, Epic Mickey, and more) had some very annoying quirks that made my life a little bit more difficult, as well as some of my coworkers'.īoth the Matrix and the Quaternion classes had multiple ways to create rotations, and naturally Gamebryo used no naming convention between these two classes.Ĭreate a Rotation from the X axis and an angle? If you didn't catch it in the title, there was some sarcasm in there.
