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 Discussion / Static boxes from hell

Author
Message
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 17th Feb 2003 06:47
Alllrighty, this could be painful...

I have finally made an instant bullet using get static line of sight commands, and it works fine. BUT, obviously the static line of sight requires there to be static objects. I wrote an algorithm to convert all the objects in the level to static objects.

But, what about the enemy? The enemy MOVES! He's not static! What about your opponent! You can't delete static boxes, they are always there, with no number to identify them! You cant go about making a new static box for every position of the enemy! And it doesnt recognize for normal sliding collision, as in you cant use static line of sight on sliding collision boxes, someone help me out here!

The enemy moves, damnit! static boxes dont!
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 18th Feb 2003 00:46
so thats a no?
freak
21
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 18th Feb 2003 01:01
what about using an other method for your instant bullet collision?

The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 18th Feb 2003 01:47
It all depends on how accurate you want the bullets to be. Since you are using collision boxes, and your enemy character probably isn't a cube, I'm assuming you don't need very accurate collision. Either that or the enemy is made up of a load of collision boxes. That means you can use standard easy self-implemented box or sphere collision, I hardly even bother using the built in static collision commands. For either of these types of collision, you need to know the smallest box or sphere size and use that as your bullet increment value. Standard box collision just takes two 3D coordinates and checks to see whether the bullet is in the axis aligned box they form, and sphere collision is just checking the distance from the bullet to the sphere against the radius of the sphere.

Simple, really.

Once I was but the learner,
now, I am the Master.
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 18th Feb 2003 02:08
hmm, i think i could help you out here ^_^ i created a new static line of sight command that is based on object collision boxes rather than static collision boxes, you could use that to detect your static line of sight against moving enemies ^_^ i was gonna release the code later on with others as a DB header file but if you really want i could give it to ya it doesn't slow the game down at all (didn't slow my game down) and it uses a custom build object (must be used with the function!)

your birth was a blessing, sent to live and die on earth as a lesson, we each have a star all you have to do is find it, once you do, everyone who sees it will be blinded - DMX
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 18th Feb 2003 05:12
hey hexgear that would be awesome

and darthstar is wrong as usual...sorry
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 18th Feb 2003 15:21
ok, i'll e-mail the code and custom object to QuoteTheRavenX@aol.com (hope thats correct) and a small example to show how it works.

your birth was a blessing, sent to live and die on earth as a lesson, we each have a star all you have to do is find it, once you do, everyone who sees it will be blinded - DMX
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 18th Feb 2003 19:26
thanks hex, (I havent got it yet), but i'm sure it'll help
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 18th Feb 2003 21:42
wait a minute, just thinking, u use the static line of sight to detect if two objects can view each other right? so if your using your instant bullet technique you could like check for line of sight between the two objects (your character and the enemy) if there is one then u can shoot him, else u can't (the command only returns a 0 if theres a static collision box blocking the path! if that still wont work then tell me, i'll send the code (just cleaning it up ^_^ ) 'cus i was just thinking of a way i could apply my code to your situation and couldn't find any.

what it does is basically checkk for line of sight betweem two objects (like the default one), the only difference is that this one checks for an object collision box blocking the way of the line of sight rather than a static collision box! + the one i made was a lot more accurate.

your birth was a blessing, sent to live and die on earth as a lesson, we each have a star all you have to do is find it, once you do, everyone who sees it will be blinded - DMX

Login to post a reply

Server time is: 2024-05-18 12:16:25
Your offset time is: 2024-05-18 12:16:25