Page 1 of 1

Colision detection

Posted: Sat Aug 04, 2007 7:40 pm
by cosmito
Well I don't think i'll create the tetris of the y2k (who knows?) but making a small game would be nice to start exploring the homebrew tools. There are interesting and powerful libs (gsKit and the old gsLib) but I saw no support for colision detection...

I'm not very familiar with low level programming of PS2 and I'm not a expert in game development, but an approach to get some col. detec. would be keeping a bitmap mask for borders of each sprite for later to check if any of these pixels overlap with other sprite mask (or background interest regions). This means access to the PS2 video buffer which I must admit I have no clue if its accessible under gsKit... Is this the best way to do things? Is there currently a solution?

Posted: Sun Aug 05, 2007 1:29 am
by emoon
Don't access the ps2 vram for these kind of things (it should never be need as its both really slow and complex to do in a good fashion) Just do the collision separated from the graphics instead.

Posted: Sun Aug 05, 2007 2:53 am
by cosmito
emoon wrote:Don't access the ps2 vram for these kind of things (it should never be need as its both really slow and complex to do in a good fashion) Just do the collision separated from the graphics instead.
I see. So a possible solution would be writting the borders masks into normal (not video) RAM using the CPU and checking it there? Hmm ok.

Posted: Sun Aug 05, 2007 4:23 am
by emoon
yes. Collision code for a regular Tetris game on PS2 should take like ~1% (or less) of the CPU.