Teen Programmers Unite  
 

 

Return to forum top

How to build a world...

Posted by duckbob [send private reply] at December 29, 2001, 03:28:11 AM

Ok... i've been having problems with this for a really long time, what is the best way to define a world for a fps. I've been using colision boxes and test points at the feet and head of my character, but that means anything the size of a small truck could fit though the mid section of my character.

I understand 3d geometric collsion detection but what is the most effective way to apply it so that a character could move across an enviroment coliding with things along the way but still able to move between with surfaces with height descrepancys. ie, going up stairs, right now i can test if the feet have passed into a collsion box for the next stair, if they have and the feet are within .5 units of the top of the collsion box then the character steps up ontop of the box to the same horizontal cords he passed into the box on. but this won't work very well if i have somthing like a suspended walkway where my character jumping would have his torso pass right though the walkway, head going above and feet going below.

Posted by CodeRed [send private reply] at December 29, 2001, 12:28:22 PM

How to build a world:

mix 100 billion tons of variouse matter with 1 trillion joules of energy and stir for about 10000 years, let cool and start populating (my favorite part)

Posted by Psion [send private reply] at December 29, 2001, 01:50:07 PM

There is this book mentioned on gamedev.net:
http://www.gamedev.net/columns/books/featuredbook.asp?productid=101

It apparently gets very mathematical, but I think you need to get into the nitty gritty if you actually want to make something like you've asked.

Posted by CodeRed [send private reply] at December 29, 2001, 02:19:34 PM

Okay, I've got a seriouse answer now. Create a logical box around the character and all other object in your world and use these boxes as the boundaries for collisions, makes incredibly complex math incredible simple, of course some of the realism is lost.

Posted by KeNnY [send private reply] at December 29, 2001, 06:27:29 PM

If you want to built a world you can use .3ds or .ms3d formats.
You create a "world model" in MilkShape for example(http://www.swissquake.sh/chumbalum-soft/) and than you load it in your program.
Source code for loading .ms3d files you can find at http://nehe.gamedev.net and .3ds at http://www.gametutorials.com
Have fun :]

Posted by KeNnY [send private reply] at December 29, 2001, 06:29:16 PM

Oh, i forgot...
Next month I'll release my "kEngine" with all this stuff (collision detection included)... I'll leave URL when i'll finish

Posted by max621 [send private reply] at December 29, 2001, 08:56:18 PM

Most games with collision detection use either cubes or spheres to detect collisions (if distance of point from center of sphere is less then radius of the sphere, a collision occured)

Posted by CodeRed [send private reply] at December 30, 2001, 12:50:00 AM

Thanks for restating what I just said...

Posted by max621 [send private reply] at December 30, 2001, 03:14:49 PM

Well you started saying "logical boxes" and you forgot to mention the easiest col-det: spheres. (Some guy might not know what a logical box is, hehe)

Posted by DakeDesuDx [send private reply] at December 31, 2001, 08:52:09 PM

You know I hate it when a fighting games uses boxes to detect hits !ARGH! Like the stuff never hits me, and yet I still get hurt...

Oh wait.. FPS...

Well, just make sure that when you look down you can see your body and feet, that is the most irretating thing I find about FPS.

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.