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 / Is it a good idea to program collision detection in DBPro?

Author
Message
Vitamin
15
Years of Service
User Offline
Joined: 15th Oct 2010
Location:
Posted: 20th May 2012 04:47
Hey everybody,
I'm working on a project, and I really want to program the collision detection myself, but the problem is, I don't know where to start. So I have some questions.

Is it a good idea to program every aspect of the project in DBPro? Is it possible for the program to run smoothly, even if the collision detection is programmed in DBPro? Or should I do it in something like C++?

That brings me to another question. If it's not viable for the collision detection to be programmed in DBPro, what are the steps I would have to take to reference another file that has a lower-level programming language with the collision detection in it? And, would the end user have to download anything else to be able to run the program that references that file?
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 20th May 2012 04:58
2D collision or 3D?

Basic 3D collision works fine for smaller, less intense apps, but for a larger game/app you can use Sparky's which is very fast and available for free. Using Sparky's can be a bit fiddly to get used to but the examples will help out a lot. Apart from Sparky's there are many physics plugins, some free, some not. I'd prefer to use just a collision system most of the time.

For 2D, someone else may have a better idea.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
basjak
16
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 20th May 2012 05:02
although sounds simple but, you're looking for a very complicated project. using vectors and object position may help you creating some sort of collision similar to the one exists in the ode engine.

for pixel collisions, it needs internal drivers that run in the GPU as such threads will take high usage in the CPU.

never mind, good luck with your project

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 20th May 2012 07:34
Depends what sort of collision you are after really. I used to do manual collision in most my old DB projects using DB commands and no plugins. What sort of project is it? What do you need the collision to do? Depending on the answers someone may give you an idea of a good way to achieve it.

Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 20th May 2012 12:36
for 3d I did my own sliding box collision by making a box in a 3d modelling program, I separated all the sides of the box into separate limbs.

I then performed a collision check between each limb and the environment model.(eg map, level, inverted box in my case) if there was collision then i moved the box in the opposite direction. with each face of the cube detecting and repelling you get a pretty good sliding collision system with very little maths involved.

there is 1 for collision, 0 for no collision and -1 for inside but not colliding.

i use this system because it is the most logically simple method for creating basic 3d sliding collision. if you use eg. if object collision = 1 then stop moving, your motion will freeze and its annoying.

I wanted to program it for myself too. once I managed to do it by myself I took the sensible option and started using sparks collision which has an awesome sliding collision system.

anyway, i could post an example but that may spoil the fun eh?

hope this helps

Sometimes I like to use words out of contents
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 20th May 2012 13:22
I am considering Nuclear Glory but it seems nobody knows anything about it...

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 20th May 2012 14:00
Sparky's collision is very good. For most games it is fine. It does depend on what you are doing however. Some games work better with some old retro code.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 20th May 2012 14:26
HI guys.
I think Sparky's that is free, is the best solution. As other people comments, that depends of what you need....there are many way to achieve that, even without any collision at all. I remember that in old game engines,the collision was checked just limiting x,y,z and you didn't need any collision with polygons. There are a bunch of good dll out there....depends how much you wanna pay

Cheers.

I'm not a grumpy grandpa
Vitamin
15
Years of Service
User Offline
Joined: 15th Oct 2010
Location:
Posted: 20th May 2012 22:44
Thanks for the info everybody, I think I have some ideas now.

Login to post a reply

Server time is: 2026-07-22 00:35:30
Your offset time is: 2026-07-22 00:35:30