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 / Matix collisions without collision commands

Author
Message
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 6th Feb 2003 16:30
I am tinkering with a game that involves a constantly changing matrix. i.e. parts of the matrix will change in height as game progresses.

I don't want to use any of the built in collision commands as presumably I would need to constantly create and destroy collision boxes.

I am in middle of writing my own sliding collision code so player can't walk up steep hills but slides along them. Player must be able to walk over shallow hills though.

Code is just about there as it has to look in front of you as you walk and work out if there is a hill in front of you, work out it's angle and then make you slide along it.

Is it worth me persevering with this idea or is there an easier way?

At the moment there are no objects on matrix, just the matrix itself.
I love it when a plan comes together
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 6th Feb 2003 18:30
I don't want to use any of the built in collision commands as presumably I would need to constantly create and destroy collision boxes.

I am in middle of writing my own sliding collision code so player can't walk up steep hills but slides along them. Player must be able to walk over shallow hills though.

- Sonic

Eh?

HeightLastFrame=HeightThisFrame
HeightThisFrame=get ground height(1,playerX,playerZ)
if abs(HeightThisFrame-HeightLastFrame)>5 then HillTooHeigh()

Pneumatic

Pneumatic of Xev@EQ
God made the world in 7 days, but we're still waiting for the patch.
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 6th Feb 2003 19:50
Thank you Pneumatic. Yes, in a few lines it is easy to wander around a matrix and stop if ground height of matrix directly ahead of you is a certain number of units higher than where you are standing now.

BUT I want to do sliding collision in these instances instead of just sticking to wall! But as matrix will be changing during game, and sometimes in a random manner, then sticking collision boxes all over the place is a no no.

I love it when a plan comes together
donkeygrapes
23
Years of Service
User Offline
Joined: 4th Oct 2002
Location: United Kingdom
Posted: 7th Feb 2003 14:41
Yes this code works but the problem is you'll find you can actually walk up steep hills if you approach from a shallow angle to the hill, as the path you are then taking across the hill is not very steep.

Is there any way to fix this?

Mamamia!
PIII 500MHz, 128Mb RAM, Voodoo 3 (!!!)
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 7th Feb 2003 17:06
donkeygrapes:

I've just about got the sliding stuff done. Just a couple of silly problems to iron out.

Exactly the same as you, I have the problem where you can still walk up steep hills if you approach at a shallow angle as the ground height just in front of you does not appear to be much higher than your current position, so program allows you forward.

I'll have to put on my thinking hat over the weekend!

I love it when a plan comes together

Login to post a reply

Server time is: 2026-07-26 08:18:41
Your offset time is: 2026-07-26 08:18:41