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 / Starting a third person free roam game. Help with bits and pieces

Author
Message
EliteACE
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 28th May 2008 02:23 Edited at: 28th May 2008 08:54
hi guys,

I'm new to Dark GDK, and have been enjoying it so far with my experiments

I'm starting to make a third person free roam game. I'll probably stretch this games development out a couple years as I'm in no hurry, and wish to learn as I go.

I'm using the Dark Dungeon sample game as the start for this.

So thats basically all the code I have in the moment.

What I am having trouble with. Is changing it from first person to third person, and I wish to keep the crosshair.

I'm not sure where the camera related code if for dark dungeon. When reading through it. So I don't know where to replace the first person camera code with third person camera code, and I'm abit stuck as to how you make the third person camera.

And finally. How does getting into vehicles and driving them work theoretically?

thankyou for all your help in advance.

Regards ACE
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 28th May 2008 10:00
If you want third person camera, you first need to load a model for a guy.
EliteACE
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 28th May 2008 10:19
yeah I get that much, I'm not sure how to do the actual camera. I guess you set a point of origin somehow, where the character is, and then move back so many pixels or whatever behind. And then make the camera move around the character to a maximum of completely horizontal either side. so you can still aim with the crosshair. I just have no idea how to do this.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 28th May 2008 13:18 Edited at: 28th May 2008 13:19
After getting into the car using the usual methods, you'd turn the key thingy and drive off with some sort of internal combustion device providing the impetus using a very expensive and old dinosaur of some description.

Okay, here's an even more vague answer, using DBPro:



First, you need to set some parameters for the camera, or accept the default ones. The first function does that using the same commands available to you using GDK. Look under camera commands in the GDK docs. It is very much like an ordinary optical camera with a min/max range and field of view (FOV). I like to use one radian (~57 degrees), but I'm old and don't often care to know what's on my periphery. (I get p'wned from the side...alot!)

All three of the camera functions use an object to orient the camera, there are also some functions in GDK to do this automatically. You can use the arrow keys to control the camera, too.
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 28th May 2008 14:41
I wrote a full 3rd person class much like mario64 with cam controls, but if your interested in writing it your self look in to dbSetCameraToFollow should get the job done.
EliteACE
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 28th May 2008 15:33
ok, thanks everyone.

I have another question. With using bsp maps, do you need to set lighting etc... with GDK code. Or will it stay at what the map was made with?
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 28th May 2008 21:20
BSp lightmaps shoudl stay with the BSP to light the map itself, but they wont light up other objects within the level (i think), so you ahve to create other lights to light up charactes etc.
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 28th May 2008 22:49
jezza, your thought is correct, WYSIWYG with bsp. Nothing is dynamic, except the collision.
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 29th May 2008 11:12
Hmmm debateable. In the quake 3 engine some of the lights are dynamic. not in Dark GDK though. Also in all versions of BSP ive seen except when loaded in GDK, brushes can move as doors and stuff. i think jinzai was doing somehting about that....
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 29th May 2008 12:03 Edited at: 29th May 2008 12:05
Here, this might help you. I am in the early stages of an RPG, wrote this up last night. Sorry, didn't comment very much, but the code is fairly straitforward. The code is also pretty sloppy, was rapidly prototyping the engine.

Anyways, enough talk, do ahead and download it and feel free to ask any questions.

EDIT - WASD to move, hold-rightclick to rotate/raise/lower camera using mouse. It's pretty intuitive.

Source Files:

classes.h


main.cpp



Tux is my guildmaster.

Attachments

Login to view attachments
EliteACE
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 29th May 2008 14:12
WOW! , that is awesome Bishop! I am, and will continue learning alot from your code! Thankyou heaps!



interesting jezza and unitech.
EliteACE
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 29th May 2008 14:55
I've been trying to find a page with information on all the GDK functions, key states etc... But can't find anything?
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 29th May 2008 15:12
Glad it was useful =)

As to the info, you should have a link to the documentation in the Start Menu under The Game Creators -> Dark GDK -> Documentation

Cheers


Tux is my guildmaster.
EliteACE
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 29th May 2008 15:55 Edited at: 30th May 2008 02:54
ah, I found it, thanks

I've commented out the player as a box code. and am using the model one now, and I'm using the goblin model that comes in Dark GDK. But the model doesnt turn correctly. It turns how the box did, in a spinning kind of way, How do I smooth out its walking to make it move normal, instead of spinning the model ?
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 30th May 2008 08:13
Quote: "ah, I found it, thanks

I've commented out the player as a box code. and am using the model one now, and I'm using the goblin model that comes in Dark GDK. But the model doesnt turn correctly. It turns how the box did, in a spinning kind of way, How do I smooth out its walking to make it move normal, instead of spinning the model ?"


That's an animation issue. You would need to have a model that has a "turn right" and "turn left" animation. Then, in my code, switch the animation function to incorporate those new animation states instead of the normal walking one.


Tux is my guildmaster.
EliteACE
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 30th May 2008 08:46
ok, thanks

Login to post a reply

Server time is: 2024-09-29 21:27:49
Your offset time is: 2024-09-29 21:27:49