Posted: 3rd Aug 2003 10:01
HOLY MACCARONIA! i think i spelled it wrong but anyhow here are my system specs

P4 1700MHZ Celeron onboard lan,onboard sound,onboard video, 256mb's of DDR ram with 64mb's of shared ram totaling 198 megs or so of free ram for total useage...

OK when i switched the sync rate to 0 i got 114-115fps!! woo! thats liek the highest i'v ever gotten but then again i guess its becuase Counter-strike is online heh...
Sync rate at 60 i got 66fps! good job
Posted: 6th Aug 2003 20:02
I've been thinking of using a method like this to make sliding collision in DBC. Could I try? Using that intersect command probably isn't the only way.
Posted: 7th Aug 2003 5:41
You could do it using memblocks, but I have no idea of how to implement that. It would prolly be slower as well.

-Kensupen
Posted: 7th Aug 2003 18:55
Cool. I have already started actually. I am not using memblocks, although I thought of that. I would probably have to write my own polygon collision rountine to detect which polygon in the object I am colliding with, then use another routine to find the intersection of a vector and polygon, but to be honest I wouldn't have a clue , so I'm using collision objects instead.

I did look at your code and as far as I can tell you are using a circle of collision points, and if one of them comes near enough to a wall then you push the camera in the direction of the vector between the camera and the collided collision point. You push the camera back by the distance between the collision point and the wall using "intersect object".

Seeing as DBC doesn't have that command, I am using collision "objects" in the form of rotated boxes all around the main object (Im doing 3rd person). They work the same as the collision points in your code, but you cannot detect which one is closest to the wall, you only know if they actually collide with the wall (the first object to collide will usually be the one at the nearest angle to the wall). This is less acurate as if the object is moving too fast, several collision points will collide and this will cause inaccurate collision because the object may be pushed in the wrong direction. That means that I have to be careful with the size of the collision points, to make sure they are as far apart as possible (so that the correct point will collide with the correct wall), at the same time as covering as much of the outside of the main object as possible.

Here is what would happen in an illustration, this is with 4 collision boxes/points:

Top row: Too small boxes: The wrong collision object hits wall, object pushed in wrong direction (right instead of back).

Bottom row: Too big boxes: Three collision object hit wall, object on the left is the first to be checked in loop and therefore it pushes the object right instead of back, causing massive collision mistake .



Any solution to this would be appreciated .

Also I have to take into account the thickness of the collision boxes according to the speed the object is moving and the distance of the collision points from the main object.

<end of long winded unneccesary explanation>

So far I have got the sliding collision working with a loaded .x object, but I still have to do some slope collision, which I have been using in other projects so thats fine.
Posted: 10th Aug 2003 2:32
I wish you luck. I didn't even want to attempt this in DBC. Too much bubblegum and duct tape.

-Kensupen
Posted: 10th Aug 2003 22:38
I'm actually having trouble with the slope collision. May be a while before it is sorted.
Posted: 13th Aug 2003 17:24
Hamish McHaggis - I havw registered here just to answer you about the slopes collision
I also had this problem, and it took me 2 hours of staring at the code to figure out what to do. The answer is just a simple line. The snippet is the original code, with the line that solves the problem between two notes. In my code, object 2 is the x file, and cx#, cy# and cz# are the coordinates of the player.
Posted: 15th Aug 2003 19:06
Amazing code i got over a 1000 fps at times, i'm gonna stare at the code now till i understand how you did it!
Posted: 18th Aug 2003 17:07
Anyone have and ideia how to make the camera dont pass through walls ?
Posted: 19th Aug 2003 3:46
You'd have to use the same collision check for the camera. It'll slow things down a bit, but not much.

-Kensupen
Posted: 21st Aug 2003 11:31
Kensupen,
Have you tried this .X collision Code with Upgrade5? It doesn't seem to like it..

gbuilder.
Posted: 21st Aug 2003 23:43
Yeah, I noticed this as well. Someone found out what the problem is. In v4.1 and prior, intersect object was buggy and would check to infinity no matter what number was set in it. The new version in U5 works as it is supposed to. All you have to change is the distance in the intersect object lines and it works again. I think I have them set to 1. Try setting them to 100 or so.

-Kensupen
Posted: 22nd Aug 2003 8:27
No,I can't get it to work,
Is this the general area...

-------------------------------------------------
`They return the distance when they hit an object
for x=0 to checks-1
chx#=newxvalue(cx#,x*angwidth,1)
chz#=newzvalue(cz#,x*angwidth,1)
ang#(x,1)=intersect object(1,cx#,cy#,cz#,chx#,cy#,chz#)
if ang#(x,1)=1 then ang#(x,1)=999999
ang#(x,2)=x*angwidth
sort#(x,1)=ang#(x,1)
sort#(x,2)=ang#(x,2)
next x
-------------------------------------------------
Perhaps someone who has got this '.X collision code' working with upgrade5 could kindly post it for the mathematically-challenged like myself.

gbuilder.
Posted: 22nd Aug 2003 12:42
Hold that request
Got it, change these two lines..

--------------------------------------
chx#=newxvalue(cx#,x*angwidth,100)
chz#=newzvalue(cz#,x*angwidth,100)
--------------------------------------

gbuilder.
Posted: 22nd Aug 2003 12:44
It's simple.
Just change these 2 lines:
chx#=newxvalue(cx#,x*angwidth,1)
chz#=newzvalue(cz#,x*angwidth,1)

to this:
chx#=newxvalue(cx#,x*angwidth,100)
chz#=newzvalue(cz#,x*angwidth,100)

Re-compile, and voila! Fixed.

-Kensupen
Posted: 22nd Aug 2003 12:45
Darn, you beat me to it while I was typing...

-Kensupen
Posted: 2nd Sep 2003 20:08
VERY GOOD!!!!!
The best collision code i've ever seen, totally!
I've been working with same style code for days, and haven't found any good solutions...
Without pressing enter, it was about 60fps, but after pressing enter, i got 400-450fps.
Posted: 3rd Sep 2003 15:35
hi

er......

dont know if those last 2 posts are going to answer this question but im on patch5. The executable you provide works fine but the source code you have given doesnt work.

The executable gives perfect collision
The source code untouched when compiled allows me to walk straight through walls.
Posted: 3rd Sep 2003 18:59
lol,Read the above posts

change:

chx#=newxvalue(cx#,x*angwidth,1)
chz#=newzvalue(cz#,x*angwidth,1)

to:

chx#=newxvalue(cx#,x*angwidth,100)
chz#=newzvalue(cz#,x*angwidth,100)
Posted: 4th Sep 2003 2:37
hmm i had a feeling they were relevant

If i wanted more than one object to be detected for collision what would i do. i.e. if my world wasnt made up of one object and it was made up of several or if i made a world and had extra objects put in like er.. desks or chairs.. or some other object. could i detect for colision with these objects...