i thought i'd post my code anyway cos it runs quite fast i think and it might help someone. this is only a very rough version with no jumping or ramps included but it does seem to stop you going through walls quite well.
rem mouselook
mx#=wrapvalue(mx#+(mousemovey()/2))
my#=wrapvalue(my#+(mousemovex()/2))
mz#=wrapvalue(mz#+(mousemovez()/2))
rotate camera mx#,my#,mz#
rem store old values
oldx#=x#
oldy#=y#
oldz#=z#
rem arrow key controls
if upkey()=1
x#=newxvalue(x#,my#,5)
z#=newzvalue(z#,my#,5)
endif
if downkey()=1
x#=newxvalue(x#,my#,-5)
z#=newzvalue(z#,my#,-5)
endif
if rightkey()=1
x#=newxvalue(x#,wrapvalue(my#+90),5)
z#=newzvalue(z#,wrapvalue(my#+90),5)
endif
if leftkey()=1
x#=newxvalue(x#,wrapvalue(my#-90),5)
z#=newzvalue(z#,wrapvalue(my#-90),5)
endif
rem calculate possible future movement values
newx1#=newxvalue(x#,90,50)
newx2#=newxvalue(x#,90,-100)
newz1#=newzvalue(z#,0,50)
newz2#=newzvalue(z#,0,-100)
newy1#=newyvalue(y#,90,50)
newy2#=newyvalue(y#,270,50)
rem gravity
y#=y#-1
rem sliding collision
if intersectObject(1,1,newx2#,y#-15,z#,newx1#,y#-15,z#,0)=1
x#=oldx#
endif
if intersectObject(1,1,x#,newy2#,z#,x#,newy1#,z#,0)=1
y#=oldy#
endif
if intersectObject(1,1,x#,y#-15,newz2#,x#,y#-15,newz1#,0)=1
z#=oldz#
endif
rem update camera position
position camera x#,y#,z#
set the level or whatever you want to collide with to group 1 and it should work.
something like this has probably been done before but even if it has i couldnt find it
ps. this is dbpro code but i think you can convert it quite easily (it might work fine in dbc anyway)