Focus

Published February 05, 2010
Advertisement
Sometimes when working on a complicated project such as a game, it is very easy to become overwhelmed by the amount of work that has to be done. That is why keeping a log of your activities can be very helpful! Whenever I feel like there is too much work left to do, I look back at how much I have accomplished up until this point and it keeps me motivated.

I have done some thinking as to my next few steps on this project:

1. I need to implement a way point system for the camera. Each quest marker will link to a way point. The way point will determine the camera position and the camera will look in the direction of the quest marker. I would like to implement a tweening effect to make the camera follow a nice arc to it's destination.

2. I have decided to have WASD keyboard movements for the camera because I determined that a click to move system would be more work than it is work. The quest system will position the camera in the direction I want it, and then the user will be able to control the camera from there (at least that is the theory).

3. I have done some research today into making an FPS camera system, however the Ogre wiki's fps camera code seems overcomplicated... I do not understand why so many scene nodes are needed to manage rotations and to "avoid gimble lock" when I thought that was the whole reason for using a quaternion or a matrix to begin with as opposed to just straight euler angles. Also I ponder if I need to look up some sort of camera controller and what would happen when I add physics to the mix. I imagine I would need to visualize the camera as a ellipsoid where the camera is positioned at the head of the ellipsoid and the ellipsoid itself handles collision detection with the game world. I am not sure how all of this will work yet, but I do know that I need to do some heavy camera work.

4. Speaking of physics I realized that I can implement the physics engine and work on camera movement, ect without the need to have all of it controllable via the Ogitor editor yet. This means that I have a lot of stuff to focus on without needing to handle terrain or any sort of plugins for Ogitor....

5. The addition of the physics can also be met with the addition of a revised menu screen system and the addition of an options dialog. Any sort of options dialog would imply the need for a profile system and so I would need to implement profiles, name dialogs, a profile selection screen, ect... It is probably wise to handle profiles soon so that I can work my code and the game mechanics around the profiles and save the appropriate values as needed.

6. I need to implement the tutorial system which will handle the actual physics part of this whole game. I am planning to call this system the "Lab Manual" although I am not sure when all of that is going to happen..


Ok so from this writting you can see that there is a good amount of work to do! Lots of little issues to fix, lots of major features to implement.... it becomes overwhelming at times, but then I look back at what I have done. I have managed to create a full scene system with transitions, implement a title screen and a menu, load a scene from Ogitor into my engine, build Ogitor from source, start my own plugin to handle physics, I have implemented CEGUI layouts, and I have implemented mouse picking... and I have done all of this work in a little over a month... So even though the amount of work that lies ahead is great, I will continue to move forward with the knowledge that I have already made a lot of progress and that I just need to break these problems down and tackle them one at a time.

I think the first order of buisness is going to be focusing on the camera controls and the FPS camera system. Right now I am tired of not being able to walk around my nice 3d world and so I am going to aim to fix that problem. I will also start the tedious process of implementing the physics which I plan to do via an abstraction layer.

This journal entry is probably a bit long so I will share with you all some more stuff tomorrow!
Previous Entry Selection
Next Entry Crazy
0 likes 3 comments

Comments

zarfius
I've implemented a first person camera system in my game using a simple method. The basic idea is this:
// first setup a scene node I like to call the body node and attach the camera to it
bodyNode = sceneManager->getRootSceneNode()->createChildSceneNode();
bodyNode->attachObject(camera);
camera->setPosition(0,2.5,0);
camera->setDirection(Vector3::NEGATIVE_UNIT_Z);

// when your moving the mouse left and right change yaw of the body node
Real sensitivity = 300.0;
bodyNode->yaw(Ogre::Radian(-mx / sensitivity));

// when moving the mouse up and down change the pitch of the camera
Real deltaPitch = Ogre::Radian(-my / sensitivity).valueRadians();
camera->pitch(Ogre::Radian(deltaPitch));

// all you need to do then is move the body node around
Vector3 pos = bodyNode->getPosition();
Quaternion bodyOri = bodyNode->getOrientation();
Ogre::Vector3 mv = bodyOri * velocity * deltaTime;

bodyNode->setPosition(pos + mv);
When you get around to adding the physics engine you only need to update a couple of things when moving the body node around. The shape bounding the camera is going to be a capsule, sphere or box. You won't need to actually rotate the physics shape, just move it around and set the body node to it's position.

This type of camera system allows the player to look up and down while still walking forward (as opposed to walking in the look direction).
February 12, 2010 05:13 AM
shadowisadog
Thank you for the tip Zarfius,

I had thought about controlling the camera using a velocity but than I found a link here FPS Camera System for Ogre that describes controlling a camera using forces that I found fairly interesting. I will keep your method in mind though!

Thank you again.
February 14, 2010 10:44 AM
zarfius
I remember seeing that a while ago. Using forces for character control has it's own problems (with stairs, slopes and other objects hitting the player). It really depends what works best for you.

Either way, I'm very interested to see a good character controller using Bullet no matter what method is used. I look forward to reading about your adventures in this area :)
February 14, 2010 07:30 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

Finished!

1609 views

Progress

1675 views

Resolve

1693 views

GUI

1852 views

Making a menu

2276 views

Teddystein!

1770 views

Doodles

1575 views

Tool overview

2153 views

Welcome!

1430 views
Advertisement