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.

Code Snippets / 130 line bsp style sliding collision code for imported objects in DBPro.

Author
Message
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 28th Jul 2004 16:08
This is the conversion of '133 line bsp style sliding collision code for imported objects in DBC', to make it work in Pro.

Its the exact same as before really:

http://forum.thegamecreators.com/?m=forum_view&t=35342&b=6

Just with some slight alterations.

All you have to do is stick a .X or .3DS model in there, and you'll be running around it in no time.



Infra-Dark
#coding, like coding, but with a #
http://www.knova.dbspot.com/
Oliver
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Switzerland
Posted: 6th Aug 2004 05:10 Edited at: 6th Aug 2004 05:11
This works really well, though could I ask you to explain the gravity part of the code?

And one other thing, why is the collision offset on the x values? In other words, why do you have to subtract -25 to position the camera correctly?...

Quote: "rem position camera at the position of the players sliding sphere
Position Camera X#-25,Object position y(10),Z#"


Thanks
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 6th Aug 2004 06:51 Edited at: 29th Apr 2010 02:49
Glad you replied. That deserves a big reward in the shape of an explanation of what's actually going on in the code.

The gravity is quite simple really. look at it as two objects, one stops the player going through the ground, and the other raises the player when he does.

the lattest being the lower of the two.

The offset bit.

This would appear to be a result of checking for collision within the sliding code titled 'Heres the magic' on the X axis, after that of the Z. Either that, or some mistake I made. Anyway, it works.

I have updated this code a tad more aswell to enable some of the more common FPS controls and movements, such as WAS and D for moving, shift to walk, control to crouch and space to jump. I'll be sure to hand in this code when I have revised it some more, as it will be in a project starting in a few hours(Gold day is nearly upon me!).

Once again, thanks for the reply, and be sure to check back for the better code.



Oliver
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Switzerland
Posted: 6th Aug 2004 06:59
Thanks for the quick reply, im still not sure about the strange offset, i know it works but it annoys me . And im certainly looking forward to the improved code,

Thanks again,

Oliver
Oliver
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Switzerland
Posted: 6th Aug 2004 17:01
Sparky's old code didn't have the offset problem, so i'm thinking it has something to do with the gravity bit, and how it now requires 2 cubes. Please fix this in the next code, its making me .
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 6th Aug 2004 18:28
It was also made for DBC. I'm working on it!

Infra-Dark
Bring the 20 liners back!
#coding, like coding, but with a #
Terabyte
21
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 7th Aug 2004 08:57
wow...
i'm really impressed...

I tried to do this ages ago.. and failed
This code is going to be really usefull.. And might even save me eight quid on the ngc dll

thanks alot

Next on ITV. I'm a DBPRO Bug forum moderator get me out of here.
Terabyte - The only user to have a newton cradle hoisted above the F5 button when making a game.
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 7th Aug 2004 09:32
Can you use it in games that you make money off?

-Ilya
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 7th Aug 2004 19:10 Edited at: 14th Aug 2004 10:58
Thanks dudes.

@Terabyte

Not sure its that good, but I'll be using it as an alternative anyhow. Cheers

@Ilya

Do you mean NG's DLL, or this code?
Feel free to use this code anyway.

@Everyone

New code:



The controls are the standard FPS ones. WAS and D to run around, space to jump, control to crouch and shift to walk.

@Oliver

Your not going to like it!

Update:

I'm in the process of revising this code further now. This time, there will be no annoying bobbing up and down while walking up hills. That portion of the code is complete, but I will also be adding more features.

Check back for further updates of my WIP FPS engine.

Infra-Dark
Bring the 20 liners back!
#coding, like coding, but with a #
Oliver
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Switzerland
Posted: 16th Aug 2004 01:38
Hey, i like the new code .

As for the offset thingy, i have come to the conclusion it is a dbpro bug . The code works fine with a level made out of boxes and 'set object collision to boxes x' however if you change it to 'set object collision to polygons x' it offsets the x value! Think i'll post this in the bug forum, .
DARKGuy
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 1st Dec 2004 00:54
Awesome code Aura!! don't mind if I use this in my own games?

Quote: "
-= 933 Mhz - SiS 630/730 8Mb - 128 RAM - 2.1Gb / 6.2Gb HDs - Sound: C-media CMI8738/C3DX PCI - CD-RW 52*32*52 - Windows 2000 =-
"
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 2nd Dec 2004 04:14
Nice code, however on my level, (supplied) at the top of the ramp thing, you fall down into it. Any Idea how to stop this?

1800+ XP - GeforceFX 5600 - 256MbDDR - 60Gb Hdd - XP Pro (SP2)

Attachments

Login to view attachments
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 2nd Dec 2004 16:59
Wow, thought this one died ages ago... Heh, car just skid outside...

Where was I.

Yeah, that will be a bug Mobiius. A result of using polygon collision. Very buggy. I should probably point the bug out to Mike. But do not fear, for I am soon to release my new collision function, that allows you to call collision using one line of code. Well, kind of. Meh, you'll see.

You are not alone.
DARKGuy
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 4th Dec 2004 15:52
Heh Aura, I was fiddling with the code to do the same as you XD! but it was a mess so I left it, but kinda got the hang of it. Though you did it and know how does it works, so I bet the function will rock

Quote: "
-= 933 Mhz - SiS 630/730 8Mb - 128 RAM - 2.1Gb / 6.2Gb HDs - Sound: C-media CMI8738/C3DX PCI - CD-RW 52*32*52 - Windows 2000 =-
"

Login to post a reply

Server time is: 2024-11-23 17:21:21
Your offset time is: 2024-11-23 17:21:21