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 / FPS Question: Which way is better?

Author
Message
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 15th May 2005 12:44
I've reached my "FPS" fase now and I've come fairly far with my engine. So far I have sliding collision, dynamic jumping, the usual FPS controls with the mouse look, and Im working on the actual shooting of it now.

I've gotten to the point where you can shoot 60 bullets rapidly like a machine gun, and with a seperate gun shoot bullets slowly, like a pistol. Im trying to work out the reloading, and I was wondering which way lags less and is more commonly used:

- Creating the bullets when fired and deleting them when they collide with something/get far enough away. Then recreating them the next time the gun is fired.

- Making all the bullets in the beginning and hiding them. Then showing them while being fired and hiding them when they aren't in use.

The later one is simpler for me but simpler doesn't always mean better so I'm hoping any of you can give me an idea of which way to go with this, or a different way all together. (Im not going to be creating a long rectangle to detect collision so don't suggest that please).

Thanks, RUCCUS.

Your signature has been erased by a mod because the filesize was too large.
hyrichter
20
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 15th May 2005 15:35
What I did in my FPS was create 6 bullet objects, then just loop through them when the gun is being fired.

I dug up this source code that should help you understand what I'm talking about. It should work with either DBC or DBPro.



RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 16th May 2005 00:16
I know how to do it I was just wondering which way is less lagy, Im assuming the recycling of already-made bullets is since you're the third person to suggest it to me. Thanks for the info Ill go with thr recycling instead of re-creating.



Your signature has been erased by a mod because the filesize was too large.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 16th May 2005 02:08
It's probably going to be the recycling techinique. This assumes that bullets are low-poly and low/non-textured. If the bullets are high-poly and high texture quality, then I believe there is some cross-over point where creating them will become faster for the most part (unless you have all possible bullets flying around constantly anyway).

"Droids don't rip your arms off when they lose." -H. Solo
REALITY II
DK_
20
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 16th May 2005 04:49
I think it's best not to use bullets at all, and instead when the mouse is pressed detect if the object is in the center of the screen then it is a hit.

Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 16th May 2005 06:15
Yeah if you are having realistic weaponry (and by that i mean like bullets...so the body fired mores to fast too see) and you arnt doing bullet time...then id go for casting a collision ray.

Genesis Rage
20
Years of Service
User Offline
Joined: 5th Oct 2003
Location:
Posted: 16th May 2005 19:25
i agree with Baggers for fast moving objects, however, making a slow moving bullet (ie plasma ball) then go with recycling.

i have also seen when the "bullet" is nothing more that a short yellowish 3D line. personally i would go with a 3D line because it will take up far less resources than an actual model.


P4 3.5 GHz HT, 1 GHz FSB, 1 GB PC4000, ATI Radeon 9800XT
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 17th May 2005 10:23
Thanks for all the help I know what Im doing now Ill be using flat plains for fast-paced movement and spheres for slow movement that are recycled. Thanks again!

Your signature has been erased by a mod because the filesize was too large.

Login to post a reply

Server time is: 2024-09-23 19:34:44
Your offset time is: 2024-09-23 19:34:44