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 / Gravity in BSP Map

Author
Message
Wana7262
12
Years of Service
User Offline
Joined: 23rd Nov 2011
Location:
Posted: 7th Jun 2012 19:33
Hi, all i am a new game programmer that's why i m asking for help for every problem....
i am using BSP Maps in my FPS game using GDK for my final year Project... BSP maps have auto collisions feature... but i am unable to add gravity in my game... i read many threads and used the mentioned codes in them but all in vain...
please anyone help me to add gravity...here is my complete code


waiting for best response Thank u all....
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 7th Jun 2012 23:37
To add gravity constantly move the camera downward.
Wana7262
12
Years of Service
User Offline
Joined: 23rd Nov 2011
Location:
Posted: 8th Jun 2012 08:31
how?
and how to react on stairs while moving camera downward????
thanks
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 8th Jun 2012 12:49
Use the void dbSetBSPCollisionHeightAdjustment ( int collisionIndex, float height ) to set the height of "player eyes" also remember to set the BSP camera using the void dbSetBSPCamera ( int cameraID ) command otherwise you wont get the benefits of BSP PVS culling.

To pull the camera down just call the void dbPositionCamera ( float x, float y, float z [, int cameraID] ) with dbCameraPositionX, dbCameraPositionY and dbCameraPositionZ. Add a negative motion to the Y axis and thats it. If you call this command every loop you will pull the camera down, so when you step off the edge in your BSP map you will actually fall.


Intel Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP2, PureBasic 4.61 + DarkGDK 2.0
Wana7262
12
Years of Service
User Offline
Joined: 23rd Nov 2011
Location:
Posted: 8th Jun 2012 20:38
i tried ur instructions....see my code and please tell me where to add these commands...?
Wana7262
12
Years of Service
User Offline
Joined: 23rd Nov 2011
Location:
Posted: 9th Jun 2012 20:59
anyone please rply.... i need gravity in my BSP map please...my teachers are noob they can't help me in game development...
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 9th Jun 2012 23:42 Edited at: 9th Jun 2012 23:42
Put this:



in your loop. Replace the word "gravity" with your desired rate at which to pull the camera down (2 or 5 may be okay).

Olby gave you everything you need, you can't expect us to do everything for you, especially if this is for a class.
Wana7262
12
Years of Service
User Offline
Joined: 23rd Nov 2011
Location:
Posted: 10th Jun 2012 12:28
Thanks that is working bro... but not on stairs
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 10th Jun 2012 18:57
For stairs you probably need sliding collision, which is included in Sparkys Collision or DarkDynamiX.
Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 11th Jun 2012 00:10
DB BSP's use sliding collision furthermore BSP's cannot be used in tandem with Sparky's or DarkDynamix unless a separate copy of BSP mesh is loaded as X or either DBO.

Try tampering with dbSetBSPCollisionThreshhold ( CollisionIndex, Sensitivity.f ) this will allow you to affect collision responsiveness to change of surface. I once used to use BSP maps a lot, they are limited and copyright restricted (no free-ware, open source BSP compilers exist) but are good starting point in DB programming.


Intel Core2Duo 2.2GHZ, 2GB, GeForce 8600M GT 1280MB, Windows Vista Ultimate SP2, PureBasic 4.61 + DarkGDK 2.0

Login to post a reply

Server time is: 2024-11-19 00:21:09
Your offset time is: 2024-11-19 00:21:09