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 / First Person Movement Made Easy

Author
Message
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 20th Aug 2009 01:25 Edited at: 23rd Aug 2009 00:05
Hi! Today I didn't feel like working on my game again so I thought I would make a First Person movement class. It uses Sparky's collision and is very very easy to use. So all beginners should have no problem using this. I attached a zip file that includes the first person movement class, sparky's collision library and header, and an example.

Special thanks to Paul Johnston for making Sparky Collision library and for the collision code!

Small Update:
-Included the Sparky's Library file
-Changed the strafing so it's speed is in between backing up and walking forwards.

Commands:


Games are like life, they should never stand still.

Attachments

Login to view attachments
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 20th Aug 2009 03:35 Edited at: 20th Aug 2009 03:40
This is a very good idea and will help people get some movement setup nice and quickly

Can I make a couple of small suggestions though if you dont mind ?

1. It might be a good idea, from the point of view of being for beginners to GDK, to add some more documentation in. Specifically to explain what the parameters that you are passing for setup are for.. I use sparky's myself and can follow the code to figure it out, but an outright beginner to GDK may not be able to. Perhaps like a tutorial doc aswell with you example(can be in the form of slightly extended code comments explaining how its all working, its up to you, just a suggestion)

2. You have compiled the example in debug mode and distributed it. Incase you didnt know, debug versions of programs(and their folders specifically) are much larger than the release version, as they include a heap of info specific to your compiler,pc and program(the "debug information") .. for example, the folder that you included unzipped is 12mb - if it was the release version, it may only be 500k to 1mb. The size thing though is not quite so important as the fact that a debug exe has a high chance to not run on other people's pc's, unless their pc software and compiler is setup in exactly the same way as yours, which may be the case sometimes, but not always, its much safer to get into the habit of deleting the debug folders and distributing the release.

These are just suggestions though and you can choose not to listen if you like, the documentation things, is probably not quite so important as the debug exe one...(it doesnt bother me personally but another reason is that you may find people getting a little unhappy about having to download more data than they need, as in the debug info for your pc lol)

All in all though, I do think this is a good idea, it would be good if we had more people contributing bits and pieces... now what we need is a GDK code snippets page, DBP and DBC have one, maybe we should start a petition lol...

EDIT : I should also have said, this class works well, the movement seems nice and the collision works, so it looks like just what a beginner to GDK might find very useful.... I did have to move the EXE file so that it could find the media though lol, not a big deal just thought i'd mention it

If it ain't broke.... DONT FIX IT !!!
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 20th Aug 2009 03:42 Edited at: 20th Aug 2009 04:22
Thanks for the suggestions! The reason that the collision code isn't documented is because it's from Sparky's and I understand what's going on but I can't really put it into words if you know what I mean. But, I will go back and document the actual class part of and such. As for the debug junk, I will definitely go back and fix that, the reason it is like that is well... I just didn't know the proper way of doing it lol. But thanks for the info I'll go back and fix that now.

EDIT: I updated the first post with the newer one (now only 800kb or so lol)

Games are like life, they should never stand still.
CokeBoi
15
Years of Service
User Offline
Joined: 19th Jun 2009
Location:
Posted: 22nd Aug 2009 06:48
I tired adding it in but it didn't work. It compiled, its just that I didn't move:

Main.cpp


GunSingle is a global variable that is set to 100. I load up an object in Debug.h that is set to GunSingle. If you need to know anything else just let me know.

LOL
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 22nd Aug 2009 19:32
Try putting the FirstPerson.MovementSetup(...) outside of the main loop then put FirstPerson.Update() inside the loop.

Games are like life, they should never stand still.
replax
14
Years of Service
User Offline
Joined: 25th Oct 2009
Location:
Posted: 30th Oct 2009 16:54
hey, i am getting a few errors whenever i try to compile my "game". your example compiles fine, but my own one doesnt.
it says:


my game code is:

do you know what the problem might be?
regards
replax
14
Years of Service
User Offline
Joined: 25th Oct 2009
Location:
Posted: 1st Nov 2009 12:16
hi,

doesnt anybody know what the cause of the problem might be?

regards
Chamill
16
Years of Service
User Offline
Joined: 29th Sep 2008
Location:
Posted: 13th Nov 2009 16:33
Open the Visual C++ included in his attached file, and open you own one. Check the properties for his project ( left of the main window, right-click the project, then propetries ) and make sure your own looks exactly like him. Most of the changes were in the C/C++ tab.

Chamillion

You can only get smarter by playing a smarter opponent.
replax
14
Years of Service
User Offline
Joined: 25th Oct 2009
Location:
Posted: 29th Nov 2009 11:40
hi,

it still doesnt work, i still get the two "LNK2019 unresolved external symbol" and one LNK2001 error. did anyone experience those before, if yes, can u please tell me how you solved it?

regards,

replax
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 1st Dec 2009 22:51
Sorry it took so long to respond for I didn't see that I got any new posts to this topic. Anyways the only thing I can think of that would be the problem is what Chamill already mentioned. But just to be sure make the following changes:

1. Right click your project and select "Properties"
2. Click on the "C/C++" drop down and select "Code Generation".
3. Change Runtime Library to "Multi-Threaded (/MT)"
4. Click on the "Linker" drop down (below the "C/C++" drop down) and select "Input"
5. Add "atls, msvcrt" to the "Ignore Specific Library" box.
6. Then click on System in the "Linker" drop down list and change SubSystem to "Windows".

Your bedtime story is scaring everyone
If found my very own Fail!: http://cheezburger.com/View.aspx?aid=2712171776

Login to post a reply

Server time is: 2024-10-01 18:30:31
Your offset time is: 2024-10-01 18:30:31