Posted: 14th May 2003 14:28
I have been working for a few days on trying to find a quick way to do sliding collision like the BSP style collision, but I don't feel like learning Worldcraft/Hammer/Using the BSP compiler.

So, what I did instead was to make a small piece of code that does it using only the DBPro commands only loading one .X level. I made mine in CShop. (It's in the download below) The code allows you to slide in any direction on the X-Z plane. It plays like regular sliding box collision, except no setup. You just call the code and it positions the camera. Oh yeah, I forgot that this in only camera collision. You'd have to change the code to work for an object. Just replace all the camera calls with the object and number. I made a cheap level so that you can play around and I think I got enough angles in it to test it ok. Let me know if you find any defects/oddities.

I get about 100 FPS on my system. Please post your FPS and system specs. Feel free to try and improve on this if you so desire. I just wanted the base part working so I can start on my RPG.

Controls:
RMB=mouselook (No boundaries, sorry, lazy)
RMB&LMB=move forward & mouselook
Space resets the camera to initial position

Download: Http://d.koren.home.comcast.net/xcol.zip

-Kensupen
Posted: 15th May 2003 3:02
nice, very nice! Smooth, perfect collision detection and adjustment from what I can tell, but I only had 6 FPS... course my comp is a pile of dog crap!
Posted: 15th May 2003 17:27
Its very good! But i did manage to break it, sorry
I managed it twice, walking off the top cat walk type thing. First time i was just about to fall off and sneezed.. lol, well i jolted the mouse whilst sneezing and when i finished recovering i was stuck in the cat walk. I reset it and a while trying to break it again to find out exactally how, finally did it but it wasnt very helpful, i just kinda walked off the corner and into the connecting catwalk on the otherwall and i ended up in it.. i tried to do it again for a third time so i could take better note of the angle i was at n what not but after around 15 minutes i gave up

But great work all in all! and for me it ran between 95 and 111 fps
Posted: 16th May 2003 9:40
I have updated the code so that it's about 4-5 times faster, but a little bit less accurate. Not really noticable, but I'm picky about it. Anyways. I lowered the number of collision checks from 72 to 8 and it seems to have doubled to tripled the speed.

Previous bugs fixed:
1. If you leave the map, you don't fly to infinity anymore.
2. If one of the collision checks doesn't make contact it won't push you. It just ignores that check.

Right now on my system, I went from 101fps to 400fps.

Once I have it the way I like it, I'll remake & recomment the code, build a new demo and repost the xcol.zip. I'll let everyone know when it's ready to download.

-Kensupen
Posted: 20th May 2003 7:01
Ok, I've updated the source and EXE. It's the same download from above.

I fixed a few problems:
-Walking off the map no longer hurls you into outer space
- Walking when there are no walls no longer includes that vector in the collision check.
-Made a new map in MS3D. It's the same as the last one from CShop, except it's floor then catwalk, then another floor. I put a really cheesy ladder in it, but it thinks it's a ramp. (Box with a transparent ladder texture)

The number of checks has been dropped to 8 from 72.
I created a variable (checks I think) and that's all you have to change. The code calculates the rest. It's only accurate from 0 to 360 every 45 degrees. (360/8) The more checks you allow it to run, the more accurate it will be, but only at the angles of (360/numchecks) Play around with the code and see what works for your needs.

The default EXE is in 640x480 Exclusive at 16Bit. I get between 198 to 856 FPS when unlocked the sync rate and depending on what I'm looking at. Try changing around the exclusive/windowed and color depth and post your FPS.

Feel free to use this code in any of your programs. I made it cause BSPs made from CShop on my system get about 15 fps on the BSP of the level included as a .X here. This way I get 200+ fps. It's not as accurate as a BSP, but you can't walk through the object, just the sliding is wrong at times. The only thing I ask, is that you don't claim to have created the code. Give credit where credit is due.

-Kensupen
Posted: 20th May 2003 7:57
The new code is freaking awesome people, TRY IT!

Zep--
Posted: 20th May 2003 7:58
I was getting 21 FPS with the old code, with the new stuff and 8 checks I am getting 200fps.

Zep--
Posted: 20th May 2003 10:08
SUPER COOL!!!! that code ROCKS!
Posted: 4th Jun 2003 20:42
Kensupen, in a word - WOW! Are you in a development team? If not, you should be, this pretty cool code.

Me and a few friends have tossed the idea around of creating a dev team in the Pacific Northwest useing the OGRE engine. We are also all members of the PagDig game dev group,i.e IGDA members.

Anyway, you've got talent, be sure to use it in the Industry!
Posted: 5th Jun 2003 0:00
I mainly got Darkbasic to be able to make stupid games for me and my roommate to play. Right now, it's just me and him that work on games. If you want to check out our work...

Go here

Nerok was done in DBC
Curse of the Four Towers was done in Pro.

-Kensupen
Posted: 11th Jun 2003 2:08
hi Kensupen
i just found this,great stuff i hope
you develope this some more

dave
Posted: 12th Jun 2003 19:58
This is some damn fantastic code! I strongly reccomend anyone who wants to even consider creating dynamic and interesting levels to strongly look at it!
Posted: 13th Jun 2003 1:14
dammmm!! great code!! 200-700 frame. do you know if this works well in 3rd person view?
Posted: 13th Jun 2003 7:17
It works in any view, you just have to change the code from camera positions to object positions.

-Kensupen
Posted: 13th Jun 2003 13:13
thanks just one other thing..if I run the exe that came with the zip the option to unlock the sync rate works fine, but if I open the DBP project even if I dont make any alteration that option dont work anymore..the game stays always in 60 fps..and the code is untouched..

Tanks for this excelent piece of code Kensupen
Posted: 14th Jun 2003 0:31
If you compile it in full screen exclusive, the max FPS is your sync rate set in windows.

-Kensupen
Posted: 14th Jun 2003 13:58
ahh.. thanks again m8
Posted: 17th Jun 2003 13:18
Is there also a way to create such a program in DBC ??
I just want to create a whole map in a .x model (using milkshape)
And i dont want to walk through the walls and don't wanna fall through the floor and ceiling. can you help me ????

-AO
Posted: 17th Jun 2003 23:14
No, this is only possible in DBPro as far as i know. DBPro has a command called Intersect Object which returns the distance to an object using Poly detection. It's math based and really fast. If someone wanted to make a function/DLL like this for DBC, then it would be possible. As of right now, it's not.

-Kensupen
Posted: 3rd Jul 2003 1:48
Ahhh! Were is the code> I get a 404 error when trying to download! After all the good comments youre getting Kensupen, I would like to learn from you.

I worked on some similar things recently but I would appreciate it if I could find out whats going wrong from your code.

Even though I haven't seen it,considering all the good appraisal youve been geting, well done anyway