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.

Newcomers DBPro Corner / n00b Question about FPS game...

Author
Message
DBAlex
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 26th Dec 2004 22:43
How do i make a bullet? im using mouselook code as well so...it needs to shoot in the direction your looking...Yes please call me a super n00b...

>_0
demons breath
20
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 26th Dec 2004 23:03
read the monster hunt tutorial - it explains it in there.

Am I the only one here who's really confused?
DBAlex
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 26th Dec 2004 23:09
Im using DBPro though...

>_0
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 26th Dec 2004 23:39
He said READ it.

It does explain it in there. If you want to follow it, I suggest downloading the trial version of DBC, since the concepts taught apply pretty much in DBP .

The 3d chat is coming...
Rights For Traffic Cones!
Mr Pointless
19
Years of Service
User Offline
Joined: 17th Oct 2004
Location: Stuck in the UK
Posted: 27th Dec 2004 01:01
Failing that here's a little method (unfortunately without code - just thought of it):

-place the bullet anywhere
-rotate it to match the camera/player's direction
-now place the bullet where the gun is
-FIRE! Now move it forward.

Sorry I can't type up (and debug) an example in five seconds, but I could work on it if you like.

Mind you, I haven't bothered with the tutorials myself. Learning each command when I need it seems to work for me, but it might not for anyone else.
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 27th Dec 2004 03:40
The problem with that method, is say you wanted a machine gun. Are you going to use loads of different objects to test collision for each bullet it fires? You'd need maybe 50 odd "bullet" objects for each person with a machine gun. In a deathmatch game, that could be pretty high. You have 20 "bots" on the level, and you've have the possibilty of 1000 bullets flying through the air at any one time, anc calculating all that takes a lot of processing power.

However, i can't think of a faster method at the moment...


Cubes with guns? Something isn't right...
DBAlex
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 27th Dec 2004 04:25
Hmmm...Ill think about this, and look at the monster hunt tutorials...

Thankyou!!

>_0
Mr Pointless
19
Years of Service
User Offline
Joined: 17th Oct 2004
Location: Stuck in the UK
Posted: 28th Dec 2004 05:06
I think DBAlex needs to start small, ReD_eYe (that took some effort to type). Besides, I haven't though of machine guns. Anyway, if you ask me, FPS machine gun bullets seem to go from barrel to target instantaneously. May not be as difficult as you think...

Or I'm talking b******s.
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 28th Dec 2004 08:20
Just use neuclear glory's collision dll. It has built in ray cast commands that do the whole "instant-bullet" for you

"
"Timesoft: Your wife is death. HOW?!! No idea. But it is murder! REVENGE!"
“What, on Christmas?”
Sol462
20
Years of Service
User Offline
Joined: 12th Sep 2004
Location: playing with the spazookeedoo
Posted: 29th Dec 2004 05:11
is nuclear glory free?

coffee + monkeys + creativity = games
punkfan91
19
Years of Service
User Offline
Joined: 23rd Dec 2004
Location: England
Posted: 29th Dec 2004 18:33
No. I think it costs about $15 though, so it isn't much at all.

www.somethingfishystudios.tk
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 1st Jan 2005 01:02 Edited at: 1st Jan 2005 01:03
here one way. it worked for me.
this should come after the trigger has been pressed.

instead of using a "bullet", use a box(make object box 1,1,RANGE OF WEAPON).obviously, the range of weapon in the example needs to be substituted for the range of the weapon the player is using. if you can pick up many weapons, set the range as an array with the different ranges stored in it(dim ranges(50) ranges(1)=... ranges(2)=... etc)
i chose 50 so the array has 50 "parts". position the box at the end of the gun and set it to the same rotation(set object to object orientation...)

check for collision with objects(the only problem is multiple collisions, but i haven't fixed that part yet)(ex. hit=object collision(BULLET,0) if hit=... then gosub monster_die etc)

NOTE: if you want to make it easier, save a group of models and use them for all of your models(ex models 100-700 are monsters,701-900 are buildings, etc) this makes it easier to check what kind of object the bullet hits.

if the bullet hits an enemy, go to a subroutine that makes it die. if it hits a building or other structure, go to a subroutine that shows a bullet hitting the wall.
demons breath
20
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 1st Jan 2005 01:54 Edited at: 1st Jan 2005 19:29
object collision is really slow though, you'd be better doing co-ordinate based collision - I changed the code from object to co-ordinate in an FPS I've been making and it went from a frame rate of 2 to one of about 1000! Of course, it won't be this drastic a change unless you have a graphics card as bad as mine [img] [/img]

Am I the only one here who's really confused?
http://db1games.topcities.com
(used to be demonsbreath)
Major Payn
20
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 1st Jan 2005 12:12
Quote: "instead of using a "bullet", use a box(make object box 1,1,RANGE OF WEAPON).obviously, the range of weapon in the example needs to be substituted for the range of the weapon the player is using. if you can pick up many weapons, set the range as an array with the different ranges stored in it(dim ranges(50) ranges(1)=... ranges(2)=... etc)
i chose 50 so the array has 50 "parts". position the box at the end of the gun and set it to the same rotation(set object to object orientation...)

check for collision with objects(the only problem is multiple collisions, but i haven't fixed that part yet)(ex. hit=object collision(BULLET,0) if hit=... then gosub monster_die etc)

NOTE: if you want to make it easier, save a group of models and use them for all of your models(ex models 100-700 are monsters,701-900 are buildings, etc) this makes it easier to check what kind of object the bullet hits."


Thats pretty smart way of looking at the problem, wouldn't have thought of that one, however, using projectiles can have their advantages, if you want the range to slowely die out, or if you want the projectile to drop, or fire wildely, then that method would have problems.

Guns arn't the problem, people are the problem, shoot all the people and guns arn't a problem anymore.
Mr Pointless
19
Years of Service
User Offline
Joined: 17th Oct 2004
Location: Stuck in the UK
Posted: 8th Jan 2005 05:37
Has DBAlex had any luck with the tutorials, anyway?

"I shall avenge your death!"
"Er, I'm not dead!"

Login to post a reply

Server time is: 2024-09-23 08:27:50
Your offset time is: 2024-09-23 08:27:50