Jump to content
IGNORED

Any "fancy" tricks for 10px wide players?


Recommended Posts

Posted (edited)

Noticed a lot of A8 games use 10px wide players by probably attaching a missile next to it..

 

Having been thinking about that, are there any clever techniques how to simplify that process or would you just render a player into a 8 pixel byte and a 2 pixel byte and do some OR stuff to get that into the missile RAM? Plus keeping everything X and y aligned of course.

 

Just asking, because you never know with those Jay Miner machines if there aren't sometricks hidden somewhere... ;) 

Edited by Steril707
  • Like 2
Link to comment
Share on other sites

Posted (edited)

That's about it.  The problem with missiles is you have to do the load/mask/OR - at least once you've already rendered the first one.

You can have tricks to speed up the copy process.  If you know a player will never move more than a few pixels from it's old Y position you could do a copy to e.g. Y-2 and pad each end with a few zeros which saves needing to do an erase process.

 

With missiles you could just erase all by storing 00 in the appropriate places then render the first one by load/store direct.  Then the other 3 by the load/AND/OR/store sequence.

Obviously to save time, have the source missile data already preshifted, and more cycles again could be saved by using unique code to render each missile (think immediate mode masking here), or of course you could use the same routine and self-modify the immediate mask each time.

 

And of course, use absolute/indexed rather than indirect - though again that can mean self-mofified code or seperate routine per player.

Edited by Rybags
  • Like 3
Link to comment
Share on other sites

There are no tricks that I know of :)
Players are 1 byte wide, missiles 2 bits... Kinda have to store data into them one at time.

Even the offsets in memory are different for each missile vs it's "player" however you pair them.

It's pain anyway your turn it, so just do it :)

 

  • Like 1
  • Haha 1
Link to comment
Share on other sites

there is a clever trick you can use for a wider 3 color sprite and no missile.

Soooooo to get 3 colors you need to overlay 2 sprites. Now, in most games, these are overlaid one directly over the other.

But you can shift the second sprite e.g. 2 pixels right to get 10 px wide combined sprite. Downside - 2 leftmost and 2 rightmost columns of the sprite must be a single color, so it will work only for specially crafted designs.

 

If you have spare processor cycles you can do all sorts of tricks when "chasing the beam", e.g. duplicating existing sprites with HPOSPx or manipulating shape with GRAFPx

  • Like 2
Link to comment
Share on other sites

6 hours ago, pirx said:

But you can shift the second sprite e.g. 2 pixels right to get 10 px wide combined sprite. Downside - 2 leftmost and 2 rightmost columns of the sprite must be a single color, so it will work only for specially crafted designs.

That's a fun idea, @pirx... :)

Link to comment
Share on other sites

Yeah, fun idea but kinda limited :)
Most left pixels can only be in single color of left player, and similar for right sprite...
So it's good for sprites that go in single direction like in horizontal shooter etc. If you're making something like a platform game with sprites turning left right, you're f....d :)

 

Link to comment
Share on other sites

Posted (edited)

overheads shouldn't be too much?

 

as you are overlapping, wouldn't 2 of the missiles actually be the same patterns on the same line and so you are working with nibbles and not bit pairs?

 

So as @popmilo suggests, pre-shifting the missile data should result in a set for both the 0/1 and 2/3 combinations.

 

Depending on how many sprites vertically you are maintaining and their height then I would think an approach would be loop through both their Y's (-1 to +1) and erase, then loop though and set 0/1 and then loop through and load/OR 2/3. 

(I'll assume here just the two are used with a simple 10 pixels height and a maximum y-movement of 1 pixel per frame and you update when players aren't in VCOUNT range, e.g. during the VBI)

 

Edited by Wrathchild
as->a
  • Like 1
Link to comment
Share on other sites

On 5/16/2024 at 2:26 PM, popmilo said:

So it's good for sprites that go in single direction like in horizontal shooter etc. If you're making something like a platform game with sprites turning left right, you're f....d :)

No, not really - just switch the horizontal position of those two sprites and the object can be drawn facing in the opposite direction.

  • Haha 1
Link to comment
Share on other sites

16 hours ago, +Adam+ said:

No, not really - just switch the horizontal position of those two sprites and the object can be drawn facing in the opposite direction.

Omg, can't believe I didn't think of that :)
Sorry, I'm exhausted of coding Tony each night :)

 

  • Like 1
  • Thanks 1
  • Haha 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.

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