Question about collisions

Blitz3D Forums/Blitz3D Programming/Question about collisions

Santiworld(Posted 2010) [#1]
Hi, i'm making a strategic game.

i use alingvector function to align all units to scenery.

i'm trying to use as less resources as possible.

now i don't know how to have collision between:

1 - units-units
2 - units-buildings

i don't want realistics collisions and i need something that i can use to findpatch to avoid buildings when the AI drive a vehicle.

what you recomend?, i think to use a 2D map for set the objetc position and use distance to detect collisions, something like sphere collisions but in manual mode.

other option is use blitz Collisions functions, but i don't know if that going to make slower the game proccess.

any advice?

i post a image showing the game.



Kryzon(Posted 2010) [#2]
Sphere-to-Sphere collisions are pretty fast, for your unit-unit collisions.
Perhaps you can benchmark their performance to see if it's acceptable.

About the level (this was taken from a "Blitz3D Tips" thread from the Tutorials section):

Originally posted by Matty:

Collisions with levels:

Make a detailed level model as normal and split it up into sections. Don't give this mesh a collision type but rather create a mesh that has basically the same layout with as few polygons as possible, with as little detail as required, set its alpha to zero and use it for detecting collisions between characters and the level.


That's one way to go.

You could also come up with a zone system to the walkable areas, and have the units procedurally place waypoints in that so as to keep things more organic.
Firstly, defining the "shape" of the entire walkable area of the whole map; then, generate waypoints based on the clutteryness of each part of the map (more cluttered areas require more waypoints to allow more choices to be made).

I'd advise taking some time far away from any computer to design this properly.


Stevie G(Posted 2010) [#3]
Use Blitz collisions but only on a proxy collision mesh. This will be plenty fast. You will need to create a lower poly version of the scene ( each building is a simple cube for example ) and set the proxy versions entityalpha to 0 so that it isn't rendered but can still be used for collisions. The rendered mesh will have no collisions.


Santiworld(Posted 2010) [#4]
Thanks!, i goint to make some test using the blitz collisions and proxy mesh for buildings.