Retro birdseye view shooter - need help
by ben calder · in Torque Game Engine Advanced · 08/19/2008 (5:59 pm) · 37 replies
I am trying to use TGEA to make a retro feeling birdseye shooter game, like the one shown in this youtube video (http://www.youtube.com/watch?v=PnXi_mIiHn4&feature=related). Does anyone know how I could approach this, please bear in mind that I am really new to TGBA, so the more specific the better.
Thanks
Thanks
About the author
#22
08/27/2008 (6:23 am)
Not good either. I got the player and tried to update his view rotation based on the cursor position but all it does is make him look like hes having a seizure or something.
#23
08/27/2008 (9:08 am)
Here is what i have so far..its not right thoPoint2I ext = getExtent()- evt.mousePoint;
Point2I pos = evt.mousePoint - getPosition();
F32 YawSpeed = MoveManager::mYawRightSpeed;
F32 PitchSpeed = MoveManager::mPitchUpSpeed;
GameConnection* conn = GameConnection::getConnectionToServer();
if (!conn)
return;
ShapeBase* control = dynamic_cast<ShapeBase*>(conn->getControlObject());
if (!control || !(control->getType() & ObjectMask))
return;
Player* Psubj = dynamic_cast<Player*>(control);
MatrixF cam_xfm;
Point3F dummy_pt;
if (GameGetCameraTransform(&cam_xfm, &dummy_pt))
{
Point3F cameraPoint; cam_xfm.getColumn(3,&cameraPoint);
Point3F screen_pt((F32)evt.mousePoint.x, (F32)evt.mousePoint.y, 1.0f);
Point3F screen_pt_temp((F32)evt.mousePoint.x, 1.0f, 1.0f);
Point3F world_pt;
if (unproject(screen_pt, &world_pt))
{
Point3F mouseVec = world_pt - cameraPoint;
mouseVec.normalizeSafe();
mMouse3DPos = cameraPoint;
mMouse3DVec = mouseVec;
F32 selectRange = arcaneFX::sTargetSelectionRange;
Point3F mouseScaled = mouseVec*selectRange;
Point3F rangeEnd = cameraPoint + mouseScaled;
Psubj->setCameraFov(360);
//MoveManager::mYaw = evt.mousePoint.x;
MoveManager::mYaw = mouseVec.x;
//Psubj->setTransform(cam_xfm);
//MoveManager::mXAxis_L = mouseVec.x;
//Point2I CursorPos = GuiCanvas::getCursorPos();
//PLAYER TRANSFORM
//Psubj->mRot = screen_pt;
//Psubj->setRenderTransform(cam_xfm);
//Psubj->setPosition(Psubj->getPosition(),mouseVec);
//arcaneFX::rolloverRayCast(cameraPoint, rangeEnd, arcaneFX::sTargetSelectionMask);
}
}
#24
08/28/2008 (10:33 am)
Hows it coming Callum?
#25
I will let you know if he has any luck, as at the moment I am fairly stuck, although I am not giving up just yet.
08/28/2008 (11:23 am)
Havent made any progress as far as the user using the mouse to turn the player is concerned, I still have a lag problem, I am pretty sure i am going to have to rethink the way I have done it all together. I have tried to make a start on the camera effect, where the position of the cursor moves the camera slightly along the x axis. But I am still familiarising myself with the AFX camera system. The Good news is that someone who knows tgea far better than I ever will is helping me out, but I don't know if he's had a chance to look at it yet.I will let you know if he has any luck, as at the moment I am fairly stuck, although I am not giving up just yet.
#26
08/30/2008 (5:35 pm)
Hi Tim, have you made any progress?
#27
09/02/2008 (6:16 am)
Nope, i think im going to move on to something else and come back to this later.
#28
09/02/2008 (11:47 am)
I am now going to put my full and undivided attention into trying to get this work. I have coded myself into all kinds of trouble with the way I took, so I have given up with that idea. I have browsed through your code, and tested its effects. I now understand what you mean by the way the player doesnt face the camera. I have a few ideas how to fix it, I will give them a whirl and let you know how i get on. But im not gunna put all my eggs in one basket so to speak, so I will make a post in the TGEA private forum, to see if anyone has any ideas or advice. Mainly because I am pretty sure that the solutions I am thinking of will all result in significant problems when I come to stop the camera from rotating, so that only the player turns and the camera stays fixed. Can I ask a question, in this line if (!control || !(control->getType() & ObjectMask))why do you use ObjectMask? I just took it out as I didnt see any need for it.
#29
09/02/2008 (1:24 pm)
That was copied from another section i wasnt sure what it did so i just left it in.
#30
09/02/2008 (1:26 pm)
What do you define it as?
#31
09/02/2008 (1:31 pm)
What do you define it as?
#32
09/02/2008 (2:13 pm)
Just remove it, it doesnt need to be there.
#33
09/02/2008 (2:18 pm)
What do you define it as?
#34
IMPLEMENT_CONOBJECT(afxTSCtrl);
//TCASTAGNA
static const U32 ObjectMask = PlayerObjectType;// | VehicleObjectType;
09/03/2008 (6:13 am)
In afxtscrtl.cpp right after the includesIMPLEMENT_CONOBJECT(afxTSCtrl);
//TCASTAGNA
static const U32 ObjectMask = PlayerObjectType;// | VehicleObjectType;
#35
www.garagegames.com/mg/forums/result.thread.php?qt=78726#553224
09/03/2008 (9:50 am)
Tim Take a look at this post I made, I have had some really good advice:www.garagegames.com/mg/forums/result.thread.php?qt=78726#553224
#36
09/03/2008 (11:41 am)
Yea i saw that post earlier
#37
09/04/2008 (7:47 am)
Yes, I have finally got it to work, all thanks to terrence tan. The code he has very kindly provided does most of what we wanted. Have you had a chance to implement it yet tim?
Torque 3D Owner ben calder
Also I dont even know where to begin to try and create the camera effect where the camera shifts slightly depending on the cursors location.
How about you?