Invisable Collisions

BlitzMax Forums/BlitzMax Programming/Invisable Collisions

Trader3564(Posted 2008) [#1]
I could start an F.A.Q. maybe? no? :-P

Thanks again for the help that was given to my latest posts. I really make some progress altough im still learning the details about various tricks and stuff in BlitzMax. Ill post some when i get to something working, as in, useable.

My next problem i in the progress of trying to build an RPG in BlitzMax is, how i preform collision checks without actualy rendering the image or object on the screen. I have done my homework and noticed there is 32 layers. However, i really lost it when i was trying to find a way to draw on these, and to have it not display anything.... i feel like its a small thing im missing out. So... if anyone knows. please tell me. (oh, and is it possible to toggle like, from visable to non visable?)
I know there is a work arround of setting alpha's to 0% but i didn't hope to be using that solution.


Dreamora(Posted 2008) [#2]
Drawing an image has nothing to do with collision nor does it actually affect it at all.

CollideImage and CollideRect are the only 2 commands affecting layer 0 to 31. 32 is for ImageCollide (2) which is the "old way" how blitz3d / blitzplus did it. But it is only suitable for very few cases if you have more complex scenarios, the usage of layers is much more performant.


Schragnasher(Posted 2008) [#3]
the layers really don't "exist" they are simply a way to order your collisions. so if you want 2 balls to collide with eachotehr, but what 2 other balls to collide with themselves but NOT the other 2, then you put each pairing on differnt layers.


Trader3564(Posted 2008) [#4]
hmm, i dont know how its possible but i have missed out on the example that was included in the docs. I now understand it. lol. thanks all! it works.
*makes progress*


Trader3564(Posted 2008) [#5]
WOW! i did a test: if i setup collisions for my RPG map on anything else OTHER then COLLISION_LAYER_ALL, its going to cost me 60FPS!!! I was in shock. Imagine the releive when i found out that creating a collision mask on COLLISION_LAYER_ALL costed me virtualy no FPS. Pfew...


MGE(Posted 2008) [#6]
I don't use any Blitzmax collision routines. I just use a map layer that doesn't get rendered and then check the sprite on the layer to see if it's interacted with a tile. Same with sprite to sprite checks. I just use either circle to circle or rect to rect with hot spots. Fast, easy.


Trader3564(Posted 2008) [#7]
I see.. well this works to.. its not costing me no to a bitty bit FPS. I have a 8 directional circular movement with customized characters and gridfree movement. All comes down to pixel accurate collisions.


computercoder(Posted 2008) [#8]
I do the same as MGE for collision detection except I also throw in the pixel perfect collison from BMax when the basic collsion occurs. Even with a grid, I get pixel-perfect detection this way. The grid merely is for rendering and moving the map around, the moveable objects are free floating, but relate to the map by coords and layer.

It works well enough. :)