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 / 3D: Load character into map?

Author
Message
jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 22nd Jan 2010 00:39
Hi! I'm kinda new to Dark GDK, I've done some 2D games now to learn a little bit about it, but now I wanna go 3D!

I have gone through all the tutorials wich came with Dark GDK, I DO know how to load a character into the world, and I DO know how to load a map into the world. But what I DON'T know is how to get the character into that map and be able to move it around with the keys WASD... (with gravity)

I belive this is pretty easy, but since I am new to Dark GDK, I'm not sure how to do this correctly.

If this has been answered erlier, I apologise, did not find anything when I searched for it. But if it has, please post me a link to it =)
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 22nd Jan 2010 07:38 Edited at: 22nd Jan 2010 07:42
ok:

include dinput.h:


first, make the simple movement with WASD:


that won't make you able to stick to the ground, so, we position it on the terrain:


now lets add jumping code:


final code should look like:



now that's a very very simple movement method, without physics, if you want a mode advanced code, see sparky's collision sliding example

hope that helps

jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 22nd Jan 2010 12:31
Well Yes, that helped alot with the movement =)

So I just load both my map and character into the world, then put my character as an object like this for example?

//Load the map and character
dbLoadObject("Map.dbo",1)
dbLoadObject("Character.x",2);

// make the character stand on the ground on th map?
dbPositionObject ( dbObjectPositionX ( 2 ), dbGetTerrainGroundHeight ( 1, dbObjectPositionX ( 2 ), dbObjectPositionZ ( 2 ) )+1 jump , dbObjectPositionZ ( 2 ) );


Is this the code to make the character load into the map and stand on the ground? and not at some random place in the world? or am I totally wrong?
jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 22nd Jan 2010 14:59
Ok, so i got it working, but how do i make so that the camera spins around the characters Y axis? and how can i steer the characters turning + camera with the mouse?
Grenadiac111
14
Years of Service
User Offline
Joined: 23rd Dec 2009
Location:
Posted: 23rd Jan 2010 02:58
if your trying to make a 3rd person game i recomend using the dbSetCameraToFollow command it basically makes the camera follow an object the code even can cause the camera to react with collisions i havnt tried the code personaly so i cant help you set it up but someone elese should be able to.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 23rd Jan 2010 06:49
i never tried this command which is simple, i usually make my own buggy system to use the camera, pcRaider wrote a good code for moving the camera behind an object, ill search for it and post it here.

Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 23rd Jan 2010 06:54 Edited at: 23rd Jan 2010 06:54
pcRaider's code:


jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 26th Jan 2010 18:18
ok, so no i have the camera avout as i want it.

Now just a question, does Dark GDK includes a physics engine? or do i have to download some oher? if so, which one do yo prefer?

and, how do i check for collisions? like i walk into a wall or tree, hen i ofcourse want to stop there, not walk through. and if i wanna walk up stairs, i'd like that to be possible ;p
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 27th Jan 2010 10:14
@jCedborger: Did you try the tutorials? They will explain you everything you need to know in the beginning.

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 27th Jan 2010 10:45
Yes, but they does not explain collision in a 3d world? I found a nice physics engine last night that i will try to implement.

"Fulcrum physics". Just waiting for mu nVidia PhysX acc to be accepted.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 27th Jan 2010 16:11
nVidia PhysX acc???
What is this?

You dont need an account to run physX.
If Fulcrum physics isn't working then post your problem in that thread and I will try and help you with it.
jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 27th Jan 2010 17:26
i needed to create an account to be able to download PhysX...? anyway, will try to implement fulcrum later tonigt.
jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 27th Jan 2010 19:31
ok, so i cant get PhysX to work...

tried my own code, but did not work, so i tried with this sample code that came with Fulcrum, didnt work either... =S



And here is the build log:


What can i do to solve this?

Login to post a reply

Server time is: 2024-10-01 23:39:14
Your offset time is: 2024-10-01 23:39:14