Colision detection

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Colision detection

Post 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?
User avatar
emoon
Posts: 91
Joined: Sun Jan 18, 2004 10:03 pm
Location: Stockholm, Sweden
Contact:

Post 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.
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post 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.
User avatar
emoon
Posts: 91
Joined: Sun Jan 18, 2004 10:03 pm
Location: Stockholm, Sweden
Contact:

Post by emoon »

yes. Collision code for a regular Tetris game on PS2 should take like ~1% (or less) of the CPU.
Post Reply