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 / Need help with code/methods

Author
Message
sw124
16
Years of Service
User Offline
Joined: 29th Jun 2008
Location:
Posted: 29th Jun 2008 21:43
I am Trying to make a simple WWII fps and am getting problems the gun spins around (it wont stay exactly with me )
and I can fly(I need to be able to stay on the ground)

here is my code
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Jun 2008 03:28


Are you declaring that twice on purpose?

jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 1st Jul 2008 15:42
Jason they arent the same thing? one is X and the other Y. unless im not undertanding what you're saying...
For stay on the ground with your BSP is quite simple, use something like dbPositionCamera(dbCameraPositionX ( 0 ) , dbCameraPositionY ( 0 ), dbCameraPositionZ( 0 )+gravity); I think. I always get confused when it comes to which axis is which and whether you add or minus to go up and down etc. gravity would have to be a var. More acurately you would have a velocity that increases by 9.8 m/s squared every second.

And as for gun position the following should work
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 1st Jul 2008 20:07
Y is the up-down axis in the GDK. I've always seen it as z in other games, though. Never understood why the GDK has the y as the up-down axis.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 1st Jul 2008 21:42
Ok - but you're missing my point. You do the same thing I'm refferring to with your camera positions. You keep calling DarkGDK functions multiple times for the same piece of information. My point is this is a waste of CPU time - and in it of itself it doesn't matter - but if that is "how you roll" then you have all these little CPU suckers all over your code.

I'm just trying to point out a simple optimization you can get into the habit of to speed up your code.

See?


How about:


SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 2nd Jul 2008 05:21 Edited at: 2nd Jul 2008 05:21
It's good to sort that sort of thing out early in development, to keep things running smooth all the way to the finish. Small things like that can make a noticeable difference in a final game.

You can fly because you point the camera up and move it forward in a direction relative to the camera's angle. What you want to do is move the camera relative to the world. You can easily accomplish this in one of two ways. Leveling the camera with the terrain, moving it forward, and angling the camera back to where it was before called dbSync() again would be the easiest.


My site, for various stuff that I make.

Login to post a reply

Server time is: 2024-11-20 15:34:52
Your offset time is: 2024-11-20 15:34:52