Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Chase camera for racing game

Author
Message
GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 10th Dec 2011 02:40
Hi all, im trying to make my first Dark GDK game, its a racing game and even though ive got my track and vehicle all setup ready and moveable, the issue is with a chase camera.

Does anyone have any basic examples of a properly incorporated chase camera or advice on how to achive it?.

Any help is appreciated.

Thanks.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 10th Dec 2011 05:53
Erm, where to start...

1. Position the camera to the objects position and set it also to its orientation.

2. Pitch the camera down and move backwards. These values play with til you get it right. Then pitch the camera back up.

a) When moving the camera backwards from the object you can also add the speed of the vehicle, so that the faster it goes, the further the camera goes backward.

b) Either before or after moving the camera backward, depending on the amound of turning the vehicle is doing you can rotate your camera (usually on the Y axis) to give a more realistic feel of turning motion.

My recent bike game has used the turning effect on the camera but not the speed. If you want to see the source, it is freely available in the Program Announcement forums.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 10th Dec 2011 18:04
Hi WLGfx, thanks for the info, am looking at your game and source code now, great work!.

GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 10th Dec 2011 18:07 Edited at: 10th Dec 2011 18:15
I seem to be havig trouble downloading the code, its keeps saying its corrupt when i try to unzip it, not sure why.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 10th Dec 2011 18:53
I'll change the file format to a 7z file instead. A few people have said that. Give me a mo and I'll fix it for you...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 10th Dec 2011 19:05
Ok great thanks.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 10th Dec 2011 19:45
Changed the attachment in the GDK version, either see the forum or hopefully this will work too: https://forumfiles.thegamecreators.com/download/2286931

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 11th Dec 2011 01:55
Awesome it worked, thanks

Now to study it lol

GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 11th Dec 2011 03:00
Thanks for all your help WLGfx.

Here is what i have:



So my next question is how can i make the camera move more smoothly, like a slight delay in it matching the objects angle??.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 11th Dec 2011 03:28
My bike in the game uses variable turning speed, so I position the camera accordingly which gives a smooth angle on it. The only part that isn't smooth which I couldn't do at the time was to make the up and down movement smooth.

ie. The turning speed of the bike is between -4.0 and +4.0 (left is negative. The inputs left and right move towards those directions, so the camera just adjusts to the current speed. And looks reasonably smooth.

You could use a similar calculation for a vehicle speeding up and slowing down. The camera would get further away as it got faster.

Hope I get to see what you come up with...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
GeneralFOL
14
Years of Service
User Offline
Joined: 29th Mar 2010
Location:
Posted: 11th Dec 2011 16:07
Ahhh right i see, thanks again for all your help, it is very much appreciated.

Will post back once i got it working.

Login to post a reply

Server time is: 2024-04-26 14:33:08
Your offset time is: 2024-04-26 14:33:08