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 / Impossible..? "DBC"

Author
Message
Nic
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location:
Posted: 19th Jan 2005 15:47
Is it impossible to have a decent and playable collision in dbc without any plugins. Ive searched the forums and tried most methods. such as objY=oldobjY and all the kinda stuff. A simple code to stop my guy walking through a building and allowing him to walk on a premade .3ds file and following all its contours...Impossible?
Ali M Oldboy
20
Years of Service
User Offline
Joined: 6th Nov 2004
Location: England, UK
Posted: 19th Jan 2005 16:30 Edited at: 19th Jan 2005 16:31


That should do dandy!

Ali M

-- Nukesoft --
-- Tv has changed our lives...FOREVER! --
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 19th Jan 2005 16:49
Ali... You didn't answer his Question at all. And I am sure that he wouldn't have asked for your help had you offered it. Please stop trying to act like you know what your talking about... It is quite boreing now.

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Nic
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location:
Posted: 19th Jan 2005 17:02
Thanks anyway but i get that much, ive been using DBC for a while.
jess you always know exactly what your doing(obv as your a moderator), can u help?
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 19th Jan 2005 17:23
Actually, being a Moderator isn't a judge of our DB Skill, it's simply a judge of our ability to handle responsibility

Having said that, I am fairly Savy with DB

Give me a couple of hours to finish what I'm up to now, and to dig up some old collision code I have that I may be able to work in DBC for you

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Nic
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location:
Posted: 19th Jan 2005 17:34
thanx its much appreciated. ive found alot of people on these forums acan be rude, if i cant do something its automatically assumed im a newb.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 20th Jan 2005 11:13
Here's the DBP code for a rotated box collision routine;



That includes an example of how to use the function

I'm having some trouble converting that to DBC atm though ( all the types and stuff are giving me greif ).

Also, if you want really simple collision, remember to try distance checks, that gives you circle collision.

Also, if you want to mix circle collision, and box, then simply check every ten degree's around the circle of collision with the box, that way it reduces the amount of checks needed ( only 36 ) for the circle. THere's probably a better way, but at the moment, I'm a bit rushed.

Enjoy.

Jess.

PS Here's what I have for DBC so far:




Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Nic
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location:
Posted: 20th Jan 2005 13:08
thanks for putting so much time into it.when u say find the distance do u mean use trig?
thanks again
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 21st Jan 2005 17:33
Yeah.
The distance equation in 3D is;


For 2D, just take out the Z part

Most collision techniques and routines can be easily solved using either Trig, Vectors, or a combination of both.
Also, don't forget that Google's your friend A good place to search is probably GameDev.net
However, if you get some source code from there, it'll most likely all be in C++.

Did you get that code that I posted to run in DBC?

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Nosnevel Xela
20
Years of Service
User Offline
Joined: 14th Dec 2004
Location: MA, USA
Posted: 22nd Jan 2005 03:11
Jess, that code for DBC doesn't work in DBC. I even have the enhanced version.

I think, but i'm not sure, that you should use wrapvalue() instead of _wrap(), and there were some other lines the compiler pointed out.

Too bad, maybe you'll fix it later.

I am who I am
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 22nd Jan 2005 16:20
Yeah, it's a really dodgy hack at the DBP code that I tried to fix up.

I too have DBCe, but I wasn't able to get it to work, and alot of the logic and speed optimization for the routine rely's on being able wrap the angle between 0 and 180 degree's, whereas the WrapValue command wraps between 0 and 360 only That's why I wrote my own function, but it only works with integers, and the angle value can be a float, which can throw the calculations out...



Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Hop a long
21
Years of Service
User Offline
Joined: 12th May 2004
Location: The Code Dump
Posted: 23rd Jan 2005 11:59 Edited at: 23rd Jan 2005 12:00
Niclaw
I haven't really tried out the code myself, but if we wait till I do everything I'd like to we'd all have long, gray beards. So with that in mind this may help:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
Hoppy
Nic
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location:
Posted: 23rd Jan 2005 13:31
thanks im really busy too atm , got a busy week at work. thanks alot tho, youve all helped out loads.

Login to post a reply

Server time is: 2025-05-24 03:23:56
Your offset time is: 2025-05-24 03:23:56