Jump to content

Understanding missile/playfield collision detection and GTIA modes

Recommended Posts

Hi everyone,


I'm trying to understand how missile/playfield collision detections (do not) work. I know that in GTIA modes 9 and 11, it is not possible to detect whether a missile has collided with playfield graphics. But I'm trying to get my head around at what stage this detection becomes no longer possible.

The background if my question is that I'm only using some lines in my display list where I set PRIOR to 192 and thus enable GTIA mode 11 for these lines. This change in PRIOR is done as part of a DLI. If I remove these lines, I get the ordinary GRAPHICS 8 (ANTIC mode $0F) lines, and collision detection works as expected.

I'm wondering at what stage the collision detection takes place and if it would be possible to somehow work around this. My (maybe naive) idea was to set PRIOR back to 0 as part of the VBI, so that collision detection would happen during the virtual blank and thus would not affect the image which would remain visible as GTIA mode 11. But I guess if it would have been that easy, others would have come to that conclusion way before me. OTOH, GTIA modes are rarely used, so maybe there is a slim chance that this is a solution?


The other idea I had would be to test collision right after STA WSYNC, before PRIOR is set to 192. But I haven't really gotten this to work either.

My assumption now is that the collision bits are set the moment the image is rendered in the Atari. So if the missile is rendered over a GTIA mode line (as it should), it is the status of PRIOR at that moment that determines whether the collision bits are set or not. If that is the case, then it wouldn't make a difference at what other time I'd change the value of PRIOR because it would either be before the rendering or after.


Can anybody confirm whether these thoughts are right/wrong and if there is any other way to detect missile/playfield collision in GTIA mode 11?


Thanks in advance,



Link to comment
Share on other sites

You're correct that collision detection happens when the graphics are generated, so you can't get GTIA to "defer" collision detection to a different time with different settings.


The problem is that GTIA modes 9 and 11 largely bypass the priority/collision section of GTIA. They disable the playfield layer outputs from the decoder, and tap off the player layer signals to disable the GTIA mode effects where there are P/M graphics. This is why collisions don't work and the priority of the playfield can't be controlled.


Mode 10 can trigger collisions, because it works by triggering the normal P/M and playfield layers. It's of limited use due to the lack of color registers, though.



  • Like 1
Link to comment
Share on other sites

C64 has fairly poor/basic collision detection so most games make us of the bounding box method to at least enhance it.

At least with GTIA modes you're dealing with fairly fat pixels so lack of precision wouldn't be a huge problem.

Link to comment
Share on other sites

In it's simplest form, just getting the difference in X/Y position of 2 objects which can tell you if they potentially overlapping (taking into consideration h/v size for each)

Of course most objects aren't just rectangular so you can either use multiple boxes per object or just give some leeway.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...