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 / FPS question!

Author
Message
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 20th Jun 2008 17:27
Hey I wanted to start using 3D and I want to start with a FPS. I am looking for the concept of how to start making a FPS. Also I've been trying to draw a model to the screen and be able to control that model. If anyone has code for that, that would be nice. Thanks

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 20th Jun 2008 17:41
Quote: "Hey I wanted to start using 3D and I want to start with a FPS."


That is a little hard to START with.

Quote: "Also I've been trying to draw a model to the screen and be able to control that model. If anyone has code for that, that would be nice"


I would say, you aren't ready to make an FPS, no offense, but that is like the easyest code ever.

Use dbMoveObject.

Hopefully that was helpful

Your signature has been erased by a mod - 120 high maximum please
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 20th Jun 2008 17:59
Ok, and I can't seem to find my object after I position it.



Do I have to make/move a camera?

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
CAJUN57
16
Years of Service
User Offline
Joined: 29th May 2008
Location:
Posted: 20th Jun 2008 18:15
Moving the camera is extremly simple,
Go to this site they got a quick little template for moving and rotating the camera with mouse movement

http://gdk.thegamecreators.com/

aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 21st Jun 2008 00:06
dbPositionCamera(x,y,z)
and
dbPointCamera(x,y,z) are both necessary.

http://overspace.panddpictures.net
SourceForge: OverSpace
Antigroup
16
Years of Service
User Offline
Joined: 21st Jan 2008
Location:
Posted: 21st Jun 2008 08:39
You may not have loaded the object correctly.
It should probably look something more like this.
dbLoadObject("ColZ.x",1);
dbPositionObject(1,300,400,300);

The X in ColZ.x should usually be lower case. I dont really think that it has a difference but unless when you put player that is actually an int variable with the number of the object you need to have a number there. This number points to where the object is in memory. And last, Your object is positioned way up in the air with 400 as its y position. If you are new then you should go look at the tutorials that come with DarkGDK. It is a really good start.
They should be at C:\Program Files\The Game Creators\DarkGDK\Tutorials

They include the source code to get you started and see what they mean in the tutorials.

Good luck.
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 30th Jun 2008 22:31
Sorry I was delayed by other problems. Back to programming. I got the model to show up. I've been messing around with dbPlayObject/dbLoopObject, but how do I just play a certain animation. Like if I only wish to call the walking animation when the model is moving. I think i will have to use dbLoopobject and then put in a start and end frame of the frams that the model is walking? If anyone can help please post.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
dbGamerX
16
Years of Service
User Offline
Joined: 23rd Nov 2007
Location:
Posted: 30th Jun 2008 22:38 Edited at: 30th Jun 2008 22:46
The documentation ( Start -> All Programs -> The Game Creators -> Dark GDK -> Documentation -> Information.chm ) is a very helpful reference. You can use the overloaded function:
Quote: "
void dbPlayObject ( int iObject, int iStart, int iEnd )
"


Here is an example.


I wouldn't use dbSync- I would use vSync. I used it just to simplify the process of explaining. By the way, "dinput.h" is a DirectInput header that defines keyboard keys.

Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 30th Jun 2008 22:41
Yes, i understand their is a documentation to Dark GDK, i use it continually.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
dbGamerX
16
Years of Service
User Offline
Joined: 23rd Nov 2007
Location:
Posted: 30th Jun 2008 22:46 Edited at: 30th Jun 2008 22:47
I edited my post (included an example). Look two posts above this one.

Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 30th Jun 2008 22:55
Yes, I figured it out with your first post, Although the code above is very helpful thank you. I ended up with this.

dbLoopObject (1, 300, 318);


That is ColonelX's running animation.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Jun 2008 22:58 Edited at: 30th Jun 2008 23:06
spooter - its annoying to have to do - but saves you headaches in the long run. Simple? Make your application in WINDOWED MODE! (For now) Make a function for each dbload thingy....

like... for dbLoadObject, make a function called LoadObject or something. That function shold take a parameter - the filename, and the ID for the object.

Then in the function do something like:



I personally use a log file. I use native GDK commands. Which means I need to delete the log if it exists when my program starts, open my log file, and keep it open until the application ends. I then write information to it instead of using a message box. This allows me the flexibility of both windowed and fullscreen mode. I just read the log. If the program crashes - I usually can see my last log entry.

This lesson - if applied to ALL your dbLoad.... ???? whatevers - textures, bitmaps, images, sound, etc. Will help you immediately dicern between camera location and object placement issues - versus media loading issues. DarkGDK doesn't usually tell you media didn't load right. worse, if you use the GDK terrain - it says silly things like Error 6...... Error 6? What is Error 6?

It's often useful to utilize functions like FileExist(FilenameGoesHere) type functions before even trying the load. And STILL testing after the load to make sure it loaded correctly.

Programming maniac might be a bit blunt - but FPS can be difficult. However, you're more than welcome to start there, and making a simple FPS is a GREAT way to learn so don't give up!

Practice moving camera around using the keyboard and maybe the nmouse to control it... try out LOTS of things - and eventually you'll start having a little budding fps under way!

--Jason

[edited code - had FALSE where a true should have been]

dbGamerX
16
Years of Service
User Offline
Joined: 23rd Nov 2007
Location:
Posted: 30th Jun 2008 23:04 Edited at: 30th Jun 2008 23:04
Jason usually (always) has a way of motivating people, and he's really good at it Keep trying and don't give up on your FPS. If you reach a bump on the road.. Well, what else is the forum for?

Login to post a reply

Server time is: 2024-09-30 01:36:45
Your offset time is: 2024-09-30 01:36:45