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 / Trying to make an FPS game.

Author
Message
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 11th May 2008 05:14 Edited at: 20th May 2008 02:45
EDIT: 5-19-08: Removed IMG tags on first post so it's easier to view this page

I'm making an FPS game in Dark GDK, in an attempt to transition from Dark Basic Pro to C++, but I am having a funny issue. I got the camera positioned how I wanted it in relation to the gun so I was going to use the dbLockObjectOn() code, but when I did that, the gun disappeared. Here's my working code:



and a screenshot of the working code
http://zaibatsugames.com/fpsgame/nolock.JPG

Heres the code with the dbLockObjectOn() command



and the screenshot

http://zaibatsugames.com/fpsgame/lock.JPG

Any help will be greatly appreciated.

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 11th May 2008 05:46 Edited at: 11th May 2008 05:47
Quote: "dbLockObjectOn
This command will lock the specified 3D object to the screen. Locking objects to the screen commands the object to completely ignore the camera's influence. A locked object will be positioned as though the camera had never been altered from its default orientation. To make locked objects visible, simply set the Z position to a significant positive value.

Syntax
void dbLockObjectOn ( int iObject )
"


Check what's highlighted in bold... There's a serious confliction between that and what is in your code...

~~It's not who you are underneath, but what you do that defines you.~~
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 11th May 2008 05:51
Thank you, i can see it, but now I have to reposition it.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 11th May 2008 05:54
The trick for the whole locking thing I think is position your cam to 0,0,0

Rotate to 0,0,0

Position the Gun in front like Core2uu said, then lock the puppy when its where you want.

You might want to make enough code so you can display the gun x,y,z and move the gun with the keyboard... and toggle the lock object on/off thing via keybaord.. saves you a tone of time recomiling, trying new numbers etc.. more work up front.. but helpful.

Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 11th May 2008 06:36 Edited at: 11th May 2008 06:37
Thank you everyone for all the help!

Well, I have the gun positioned correctly, and I have WASD movement implemented, and I have added a small cube for reference to confirm that I am moving. Everything was going fine until I realized it was time to put in mouse aiming. No idea what I'm doing, none at all.

updated screenshot.
Window Size has been reduced for easier viewing on web browsers



EDIT:

Whoops, I'm an idiot

forgot to post the updated code



Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 11th May 2008 07:25 Edited at: 11th May 2008 07:29


See how that works... Don't forget to declare fCameraAngleX & fCameraAngleY as floats on the global scale...

BTW, that's mostly copied out of the game level tutorial included with DGDK... It's part of a game I'm working and it works good... I dunno how good it will be with the gun locked... You might have to set the gun to the camera's orientation... or lockobject might already have that covered... IDK, but try all of them...

Oh and BTW (again)... Try to understand how the code works... It will help you in the future and not always is everyone gonna give you the code you need straight up... Remember that...

~~It's not who you are underneath, but what you do that defines you.~~
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 11th May 2008 08:14
Thank you! I got the code working. I think I'm done for the night.

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 11th May 2008 08:36
Glad it's working for you... Nice progress...

~~It's not who you are underneath, but what you do that defines you.~~
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 12th May 2008 00:48
The game has been given a temporary name, "Project Rainbow Death."

I've made a video and uploaded it to youtube showing the progress.
http://www.youtube.com/watch?v=uwplLydUBHY

Since the video has been made, I have worked on it a little, I've added a HUD.



Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 12th May 2008 00:59
Cool... Now I wanna make an FPS...

But I'll have to put that till after I'm done my other games for my math project...

~~It's not who you are underneath, but what you do that defines you.~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 12th May 2008 01:27
Nice Progress... I didn't hear music in the video though.. maybe a glitch on my end....

How about another Name... as the RainBox thing is already a brand - I immediately think of rainbow 6.

Do you have a story at all? Or just shootem-n-bruise em FPS gameplay?

Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 12th May 2008 02:30
Quote: "Do you have a story at all? Or just shootem-n-bruise em FPS gameplay?"


No story as of yet, I'll try to develop a flimsy premise soon.

Quote: "I didn't hear music in the video though"

Works on both of my computers, I'm guessing it's your end.

Quote: "How about another Name... as the RainBox thing is already a brand - I immediately think of rainbow 6.
"


I said it was just a temporary name.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 12th May 2008 02:58
Quote: "I said it was just a temporary name."


You did. I'm tossing ideas at you.. not picking, on the contrary.. you made a lot of progress very quickly.. at least from what I saw in your posts.

Keep up the good Work!

Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 12th May 2008 05:04
Quote: "you made a lot of progress very quickly.. at least from what I saw in your posts."


Part of that is probably attributed to making all the media for this game before i even opened VS2008.

Quote: "Keep up the good Work!"

I'll try to, but now that I've got all the basic stuff done, I have to actually do something difficult.

I'll try to have a better name for it by next weekend.

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 12th May 2008 08:06
Can't wait to see your updated work... I guess for my third game I can do an FPS... I started like right now...

~~It's not who you are underneath, but what you do that defines you.~~
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 13th May 2008 01:51
I've added in the variable for the players health, and have in displayed in the proper area, while this is such a small matter that people probably don't care about, I'm posting about because I need a small bit of help concerning it.



You can see from the image that the text is indeed there, but the problem is, I want it in red, and can't seem to figure out how to properly convert the DBP code to DGDK.

My current health code is


and I've tried things like
with no luck. If someone could clarify how to do this, it would help me a lot. Thanks in advance,

Brett Snow.

BTW, I've started saving the screens as PNG files for better quality.

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 13th May 2008 02:40
Use your dbInk command in conjunction with dbSetTextOpaque(); ... dbSetTextOpaque will set the background of the current text settings to the color of the background ink...

I haven't tried it but it MIGHT work...

~~It's not who you are underneath, but what you do that defines you.~~
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 13th May 2008 02:56 Edited at: 13th May 2008 03:07
it might work if I used the dbInk command correctly, but I get build errors when I try to compile.

EDIT:

I've uploaded another video to youtube showing a map extension I've built.
http://www.youtube.com/watch?v=Sq669vjIiRg

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 13th May 2008 03:13
If you want completely red text the color number is 429xxxxxxx where x can be replaced with any random number you want but I assure you it will be most red...

So instead of dbInk(rgb(255,0,0)); try dbInk(429xxxxxxx);

Oh hey and the syntax is Syntax:

void dbInk ( int iForeground, int iBackground )

so put to values like dbInk(something, something);

~~It's not who you are underneath, but what you do that defines you.~~
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 13th May 2008 03:27
Well I got it by using the code


Yeah I know, that should make it blue, but it didn't. It make it red. It's like that with every DarkDGK thing I do. The RGB scale is reversed. Anyways, Now that the text is some other color besides white, I can see that the HUD is being drawn over the text.



Is there any way to set the text in front of everything else?

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 13th May 2008 03:39
For sure... Place the text command (dbText or dbPrint or whatever you are using) at the end of your loop so it is the last thing to be drawn...

And about the scale being reversed... I think it is something to do with the foreground and background together...

~~It's not who you are underneath, but what you do that defines you.~~
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 13th May 2008 03:43
Putting it at the end didn't seem to help, and about the scale being reversed, it was reversed when I made a spinning cube and colored it red.

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 13th May 2008 03:53
It all depends on how you are drawing the HUD and what you are using to draw it... I can't help you out more unless you post some source code... If you want to that is...

This shouldn't really happen... Even if I draw my text first it still gets drawn over everything else... And my RGB actually works the right way... Are you sure when you were D/Ling GDK the packets didn't transfer backwards?

~~It's not who you are underneath, but what you do that defines you.~~
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 13th May 2008 04:13
Quote: "I can't help you out more unless you post some source code... If you want to that is... "


Don't see why I wouldn't, it's not like it's ground breaking source code that I plan to sell later.



Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 13th May 2008 05:38
I dunno for sure but investigate the dbSetSpritePriority & dbSetSpriteAlpha commands... They can maybe help you achieve what you are trying to do... I dunno how much luck you'll have though... Let's wait for Jason's reply and see what he says...

~~It's not who you are underneath, but what you do that defines you.~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 13th May 2008 06:01
Well... (Hi Guys)... Experiment both dbprint flavor and dbText flavors of text... but thought you could do:

dbInk(dbRGB(200,0,0),0);
dbPrint(LONGLONG iHealth);

Or something like that - very tired .. must crash... Night.. sorry I don't have more for ATM

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 13th May 2008 06:16
Quote: "very tired .. must crash... Night.. sorry I don't have more for ATM
"


What time zone do you live on? We have NA Central (GMT -6:00)... So it's 9:15pm right now...

~~It's not who you are underneath, but what you do that defines you.~~
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 13th May 2008 07:58 Edited at: 13th May 2008 08:02
He was up all night last night, that's why! (Now, I must sleep soon because I have an interview tomorrow myself.)

Too tired myself to read it all, but if you are using a sprite, and painting your text on that, try draw sprites first, and use alpha to fade the sprite.

Also, using PNG from MSPaint will not give you alpha, and it will not fade at all. If you don't have a program capable of inserting an alpha channel, post the PNG, and I can get you some alpha control to fade it so it is just the way you want it.
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 14th May 2008 01:01
Quote: "He was up all night last night, that's why! (Now, I must sleep soon because I have an interview tomorrow myself.)"


Oh, OK....

Quote: "Also, using PNG from MSPaint will not give you alpha, and it will not fade at all. If you don't have a program capable of inserting an alpha channel, post the PNG, and I can get you some alpha control to fade it so it is just the way you want it."


Um... I wish to disagree... In my game I have a PNG made with MSPaint and the setalpha command works perfectly with it... Just my experience...

~~It's not who you are underneath, but what you do that defines you.~~
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 14th May 2008 02:26
How do you control the alpha in MSPaint, then?
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 14th May 2008 02:32 Edited at: 14th May 2008 02:33
Well I don't even know what an alpha channel is much less know how to insert one...

But you can control alpha with DGDK using PNG images made with Paint just the same...

~~It's not who you are underneath, but what you do that defines you.~~
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 14th May 2008 03:12
The alpha is used to fade an image. Try using the set alpha commands on this red button file to see what I mean.

Attachments

Login to view attachments
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th May 2008 03:19
what ya use to draw light mapped little sphere?

jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 14th May 2008 03:45
Actually, that is a little ditty from TextureMaker called an aqua button. It is done by a plug-in the comes with the Pro version. Its very nice, and not limited to round ones, either. I made a great set to use in GH clones. (Green/Yellow/Blue/Red/Orange)
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 14th May 2008 04:02
Quote: "The alpha is used to fade an image."


I knew that...

Quote: "Try using the set alpha commands on this red button file to see what I mean."


Was something different supposed to happen? That picture just behaved like a normal one under the setalpha command usually does...

~~It's not who you are underneath, but what you do that defines you.~~
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 14th May 2008 04:17
The Image was made in photoshop, it's on a layer above the background, which is transparent. The layer the image is on is set to about 80% opacity.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th May 2008 16:35
Ok... Code2uu... Here'a the deal...

32 bit pics are OFTEN stored in A8R8G8B8 format or some stupid acromym that MEANS EACH 32 bit pixel.. has a "format" that used to describe the colors. 32bits divided by 4 = 8. So, 32 bits cut into four channels leaves 8bits per channel. Its a computerese math nomar - everything is 2's compliment but I digress...

MS Paint... ALWAYS has a 255 (maximum value for a byte) in the ALPHA channel. I.E. Pixel ALWAYS fully Visible!

Fireworks, and maybe Gimp... (photoshop I think too) Allo you to "paint" with the color "a"lpha... zero = invisible, 255 fully opaque. These programs also allow you to manipulate image layers... which some are real, some are fake... bottom line? When you open one of those pics..... and make a memblock in DarkGDK... you simply have 32bits, R,G,B,A.

What DarkGDK and DBPRo do .. with set alpha... is write to the alpha channel... 255 where the r,g,b = color key - usually black.
Depending on the alpha setting you provide.. the Alpha channel for all the pixels (that do match the color key ..and set to zero) are set to the alpha setting you applied.

that's my take on it... though I know there are various "texture filter modes" that might effect this behavior - I don't know all the details... but...

The cool thing is with an application that allows you control the alpha BEFORE loading into GDK, allows you to have transparencies AND see through "holes" regardless of colorkey and "set alpha" commands... in fact I haven't tested this but I would think loading a picture like this and useing those commands MIGHT... MIGHT alter the picture in a way that you effectively "removed" the pictures original alpha settings. If DarkGDK handles in two buffers, this wouldn't happen... And it might not, after all, images are not stored in render pipeline... but they are in render pipeline when you see them./.. could be a "filtered" copy of the original.. hence safeguarding your settings... I dunno.

It does matter though. with alpha.. you can use any color.. and control at the opixel level how visible/opaue it is. I love it! Simple but effective stuff!

Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 16th May 2008 06:54 Edited at: 16th May 2008 06:55
Thanks for writing that book, it explained things to me quite nicely...

The original problem originated from when Jinzai said you can't control alpha in MSPaint (which is true...) but I said why do I need to when you can use the set alpha command... BUt anyways thanks for the info...

Also (BTW I'm in Grade 9 so don't expect anything too great from me), I thought it was 8 bits to a byte and that was it... Where does the 255 come in? And if the 8 bits are represented in hex then how does it equate into binary... I dunno, but I'm sure you can't have the same amount of digits to represent the same value in hex AND binary at the same time....

~~It's not who you are underneath, but what you do that defines you.~~
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 16th May 2008 07:06

Attachments

Login to view attachments
Core2uu
16
Years of Service
User Offline
Joined: 15th Mar 2008
Location: Saskatoon, SK, Canada
Posted: 16th May 2008 07:16
Thanks... I was missing this part: a BYTE is base 256!!!!!

~~It's not who you are underneath, but what you do that defines you.~~
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 18th May 2008 02:05 Edited at: 18th May 2008 02:37
I said that I would think up a title for the game, and here it is:



I even made an animated version.



I also said I would try to have a flimsy premise by this weekend, and so here it goes...



(I know that it sounds really bad, maybe I'll improve on it later)

EDIT: As soon as I stop stalling by writing the story, designing the logo, and adding onto the map, I'll try to add in collision.

Hayer
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 18th May 2008 13:36 Edited at: 18th May 2008 13:56
... flashy colors



I was bored so I made a new menu/splatter/whatsoever.
See attachment.

Feel free to use it. If you want the .psd file send me a mail at
peder at pederslekeland.com

Attachments

Login to view attachments
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 18th May 2008 16:44
Quote: "... flashy colors "


I like flashy colors.

Quote: "Feel free to use it. If you want the .psd file send me a mail at
peder at pederslekeland.com"


When I get to the point of making the menu, I might do that.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 19th May 2008 19:03
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 19th May 2008 22:14
Quote: "Did you have to pick "Iron" LOL
"


what's wrong with iron?

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 20th May 2008 01:38
... nothing... I'm quite fond of it myself ...

Mc Koding
16
Years of Service
User Offline
Joined: 13th May 2008
Location: Canada
Posted: 20th May 2008 01:58
I am an amazing gfx artist i can help you out with 3d if i can just get a way to make .x modeles also i can help you with hud, all free because I am bored and mine is in need of a good story plot.
Also i will make a coolish hud/overlay and menu back and see if you like. Also good work!

Rendetion a farcry from DarkGDK
Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 20th May 2008 02:43
Quote: "... nothing... I'm quite fond of it myself ..."


*feels really stupid*
Oh, I just saw your signature...

I was going to use steel caress, but it was already taken, I may end up changing the name altogether anyways, I think It sounds kind of funny.

Zaibatsu
18
Years of Service
User Offline
Joined: 1st May 2006
Location: Lost in Thought
Posted: 20th May 2008 03:51 Edited at: 20th May 2008 03:57
Quote: "I am an amazing gfx artist i can help you out with 3d if i can just get a way to make .x modeles also i can help you with hud, all free because I am bored and mine is in need of a good story plot.
Also i will make a coolish hud/overlay and menu back and see if you like. Also good work!"


Thank you, and I'll take any help I can get.

EDIT:

I'm now trying to stop the player from being able to look so far up or down that he can flip all the way around. None of the solutions I've tried have worked.



Didn't give me any error messages, but it didn't do anything at all.

Mc Koding
16
Years of Service
User Offline
Joined: 13th May 2008
Location: Canada
Posted: 20th May 2008 04:50
Can you give me your email.

Also try >= / <= and also if(angle < -90)
should be >

Rendetion a farcry from DarkGDK

Login to post a reply

Server time is: 2024-11-20 11:22:03
Your offset time is: 2024-11-20 11:22:03