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.

DarkBASIC Professional Discussion / So now that p4 has been released...

Author
Message
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 22nd Mar 2003 01:04
So now that p4 has been released does any body know a routine to allow you to shoot bullets either by using moveing objects or by using this 'line of site thing'
AND I EMPHASISE THIS:
IF IT SHOOTS THROUGH THE WALLS OF MY BSP, I DONT WANT TO KNOW!

i have now posted this question 3 times and so far i have got people replying with "yes i know how to do this" but never actually left any source code or even an explanation of how they did it (if they did it at all!)
I have a word of advice...
..don't piss on an electric fence!
ZomBfied
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 22nd Mar 2003 01:09
I'm tellin ya, the best way I know is like this (psudo code)

Have a mini loop to let your bullet run it's entire course the moment it's fired within your main loop.

do `main loop
stuff

if you shoot bullet
repeat 'mini bullet loop
move bullet
bullet colision code
until bullet hits something or runs out of range
endif

sync
loop

Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 22nd Mar 2003 01:57
wouldnt that slow your program down while you shoot

I have a word of advice...
..don't piss on an electric fence!
ZomBfied
23
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 22nd Mar 2003 02:46
It seems like it would, but its never caused a noticable slowdown when I use this technique. But then I use purely math collision for everything so its ultra fast. I don't know how well it would work with bsp hit(), but try it and see. You might be surprised.

Plus even if it does take some time, it's only at that 1 moment when you shoot so it's not nesessarily every frame. Even Machine guns don't have to fire every game loop.

Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 22nd Mar 2003 14:51
Frobscottle, moving an object is very simple as it is just a maths thing, so it is very quick.

Current Project: Retro Compo. Entry.
the architect
23
Years of Service
User Offline
Joined: 6th Jan 2003
Location: United Kingdom
Posted: 22nd Mar 2003 15:51
For bsp my bullet routine fires at a rate of 80 units, checks for collision every 1 unit and accuratly records a bsp hit. At the moment it does not seem to slow down the speed too much although at the mo I have no opponants on screen and can only simulate their firing rates. Also I have not set up a routine for bullets hittinf other models yet.

This method is only temporary as BSP collision does not seem a sensible method as I am looping in DBPro. I would a proper LOS command for BSP. Hope we get one soon!

Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 22nd Mar 2003 19:30
I don't use BSP enough to fully understand the commands but I thought BSP Collision Hit() was updated on the sync command? Therefor looping in such a manner would not return the desired result?

Pneumatic Dryll, Outrageous epic cleric of EQ/Xev
God made the world in 7 days, but we're still waiting for the patch.
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 22nd Mar 2003 20:19
PneumaticDryll - There is a PROCESS BSP COLLISION command though which you can use to process collision before the sync command.

Current Project: Retro Compo. Entry.
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 22nd Mar 2003 20:30
Ah yeah Rob thanks for the correction

I only used BSP's in one project and it involved hacking things with swords - so I never really got that far!

Pneumatic Dryll, Outrageous epic cleric of EQ/Xev
God made the world in 7 days, but we're still waiting for the patch.
Terabyte
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 22nd Mar 2003 21:19
thanks allot
im not convinced about the method that zombified used. remember some people dont have geforce 4's so not every one can afford to waste time in their loops moveing objects from your camera to a target.
i still think that the plane equation at real game tools.com could fix my problem if only it wouldnt shoot through walls so i think i will contact the author of that code. but thanks anyway everyone [img][/img]

I have a word of advice...
..don't piss on an electric fence!
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 22nd Mar 2003 23:33
"im not convinced about the method that zombified used. remember some people dont have geforce 4's so not every one can afford to waste time in their loops moveing objects from your camera to a target."

Err Frobscottle... moving objects is a CPU thing ... it has NOTHING to do with your graphics card. Your graphics card is only involved when the SYNC command is called. The speed of your processor is important here. Also, this code is NOT slow - I have used it before and it works just fine, as long as you do the object movement code on a simple level. The other option is to use INTERESECT OBJECT.

Current Project: Retro Compo. Entry.
madcaddy
23
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 22nd Mar 2003 23:46
please could someone direct me to this equation on rgt for maths based collision that i keep hearing about - thx

Login to post a reply

Server time is: 2026-07-11 08:46:59
Your offset time is: 2026-07-11 08:46:59