Jump to content
IGNORED

Player missile questions


Recommended Posts

I haven't programmed an Atari 8-bit in about 20 years ... but I used to be quite good at Turbobasic. But here are some questions I have:

 

First off, I have discovered Action. Are there any libraries out there which are good for player-missile graphics movement?

 

Secondly, I have been thinking about trying to do an update of the Super Breakout game. This time I want to make it more like the 2600 version. The idea I have is to use a GRAPHICS 0.1 screen (mode 0, GTIA 1, 16 shades) with a display list interrupt on register 712 to shade the bricks (which will themselves have 16 shades).

 

The question is, is there any facility to detect a collision between player/missiles and a GTIA playfield? If not, then is there a formula for translating a players position into a character position? That is, being able to take a player's position and read the character where it's located? Keeping in mind of course, this is for a Graphics 0 screen.

 

The last question, is: Is it possible to have 2 DLI's running? I had thought about using a DLI on register 712, but also a GTIA (623) DLI so that the top line of text could be normal Graphics 0 (gtia mode 0). Would this be feasible?

Link to comment
Share on other sites

The last question, is: Is it possible to have 2 DLI's running? I had thought about using a DLI on register 712, but also a GTIA (623) DLI so that the top line of text could be normal Graphics 0 (gtia mode 0). Would this be feasible?

You can achieve the effect of multiple different DLIs by changing ANTIC's DLPTR register during a DLI. Use the VCOUNT register to make the DLPTR change on a specific scanline.

Link to comment
Share on other sites

I don't think so, the collision is checked on the fly when drawing each pixels on the screen IMHO. So during VBLANK there can't be any change of collision registers.

 

Ad. player position to char conversion, of course you can calculate it, HPOS=48 when the top most bit of player is the first pixel in normal mode screen width and each char has four pixels ((HPOS-48)/4=X pos of char 0..39). The same works for Y position, but it depends on your display list and I don't know right now the exact number of the first player line in visible screen.

Edited by MaPa
Link to comment
Share on other sites

I don't think so, the collision is checked on the fly when drawing each pixels on the screen IMHO. So during VBLANK there can't be any change of collision registers.

 

Ad. player position to char conversion, of course you can calculate it, HPOS=48 when the top most bit of player is the first pixel in normal mode screen width and each char has four pixels ((HPOS-48)/4=X pos of char 0..39). The same works for Y position, but it depends on your display list and I don't know right now the exact number of the first player line in visible screen.

 

Well, for the moment, I am only using a normal GRAPHICS 0 screen, not modified in any way, except for having the GTIA set to mode 1 (graphics 9) and a DLI on register 712 used to color the bricks. I also will use double-line resolution to save on memory, so 2 vertical lines of GRAPHICS 0 should equal the vertical size of a player pixel?

 

And in actuality, the collision would be between the playfield and one of the missiles (which will be used as the ball).

Link to comment
Share on other sites

Yes, in double line pmg resolution one line of pmg equals two lines of one character in gr.0.

 

IMHO when GTIA mode is set (by setting upper two bits of gprior register to any non zero value) then no collision checking is made. The collision bits should be set up on the fly as the screen is drawing, pixel by pixel there is decision what should be displayed in depends of gprior register and simultaneously appropriate collision registers are set. But I just think so, don't know if it's true.

Link to comment
Share on other sites

If you enact the Scanline 240 bug, you can have PMGs displayed in the normally black offscreen area, even during VSync.

 

You need to put Antic in Wide mode though, otherwise the HSync pulses get sent at the wrong time, and you need to put it in Blank mode during VSync.

Then after VSync you goto Wide mode again. But you need to the change to Blank at the correct time, otherwise an unwanted HSync gets generated and will foul up the display.

Edited by Rybags
Link to comment
Share on other sites

Yes, in double line pmg resolution one line of pmg equals two lines of one character in gr.0.

 

IMHO when GTIA mode is set (by setting upper two bits of gprior register to any non zero value) then no collision checking is made. The collision bits should be set up on the fly as the screen is drawing, pixel by pixel there is decision what should be displayed in depends of gprior register and simultaneously appropriate collision registers are set. But I just think so, don't know if it's true.

 

I think there is collision checking for GTIA mode 2 (Graphics 10) but I am not sure. I'll probably just end up by using character position to detect collisons on this one. :)

Link to comment
Share on other sites

Success I think!

 

Turns out the formula for Y position of player/missile in Graphics 0 (or any text mode with 23 rows) is: (YPOS-16)/4 using double line resolution, or /8 with single line. My collision routines are working!

 

I'll keep posting about this project as it happens.

 

You mean 24 rows right? :) Yes, the vertical position is something like (YPOS-16)/4 if you have standard modes, if you use your own display list you have to adjust according to it. In single line PMG mode it should be (YPOS-32)/8 IMHO (double the first 16 scanlinas above too).

Link to comment
Share on other sites

Success I think!

 

Turns out the formula for Y position of player/missile in Graphics 0 (or any text mode with 23 rows) is: (YPOS-16)/4 using double line resolution, or /8 with single line. My collision routines are working!

 

I'll keep posting about this project as it happens.

 

You mean 24 rows right? :) Yes, the vertical position is something like (YPOS-16)/4 if you have standard modes, if you use your own display list you have to adjust according to it. In single line PMG mode it should be (YPOS-32)/8 IMHO (double the first 16 scanlinas above too).

 

Very true. I have another question now!

 

I plan on using each character block to represent two bricks, like so:

 

########

########

########

######## top brick

--------------

########

########

########

######## bottom brick

 

So this means I will have 4 possible characters: Both bricks, top only, bottom only, and no bricks. My collision routine for (ypos-16)/4 works, but is there a way I can break it down further so I can tell whether the ball is touching the bottom part of the character or the top part?

 

Edit: Just had an idea ... (ypos-16)/8 ... whether it's the top or bottom brick is dependent on whether (ypos-16)/8 returns an odd or even number?

Edited by Synthpopalooza
Link to comment
Share on other sites

  • 9 years later...

I resurrected this thread because it is proper place to point something out. I had in my mind that missiles can be set to different sizes by setting SIZEM (53260). I experimented a little and it worked well. But reading De Re Atari it mentions that something like that can't be accomplished:

https://www.atariarchives.org/dere/chapt04.php

 

  • Like 4
Link to comment
Share on other sites

Yes, that text in De Re is very much wrong.

 

But one thing that should be pointed out - if using the missiles as a 5th player grouped together then you need to take the sizes into consideration when doing the H-positioning.  Although usually you'd have them all set to the same size so all the offsets would be the same.

  • Like 4
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.

Guest
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.

Loading...
  • Recently Browsing   0 members

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