Author Topic: Amstrad Plus Sprites vs Amiga Sprites  (Read 769 times)

0 Members and 1 Guest are viewing this topic.

Offline zhulien

  • 6128 Plus
  • ******
  • Posts: 920
  • Country: au
  • aka Vorax
    • 8bitology
    • Awards
Amstrad Plus Sprites vs Amiga Sprites
« on: 06:41, 30 October 21 »
Hi sprite experts, just wondering if the plus machines allow such sorcery as described in this Amiga-related video?



https://www.youtube.com/watch?v=YdeUebxTt5M

like
0
No reactions

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.022
    • Awards
Re: Amstrad Plus Sprites vs Amiga Sprites
« Reply #1 on: 09:35, 30 October 21 »
You can multiplex sprites like this, although it's harder to pull off because:


  • There is no copper, the best you have is a raster interrupt that allows you to wait for a specific line. Horizontal timing can only be achieved with t-state counting.
  • Unlike the Amiga, you can't easily just repoint a sprite at a different image. Instead you have to write all 256 pixels of the sprite into the ASIC registers. This not only takes a far chunk of time, but it's also something you have to do at a point the sprite isn't being drawn, otherwise you'll get visual corruption.
Neither of those should put you off trying it out though.
like
1
Members reacted like:
Otto,

Offline Cwiiis

  • CPC664
  • ***
  • Posts: 141
  • Country: gb
    • Blog
    • Awards
Re: Amstrad Plus Sprites vs Amiga Sprites
« Reply #2 on: 11:58, 30 October 21 »
I added sprite multiplexing in a game I'm working on the other week and depending on what you want to do with it, it's actually surprisingly easy... My game only consists of a few unique sprites - the player, one enemy type (of which there are 8 instances) and another miscellaneous sprite. The enemy only has 2 frames of animations and can face in two directions, so takes 4 sprites - I decided to duplicate this in sprite memory 3 times and use multiplexing to be able to have 8 of them and alternate flickering if there are too many per scanline (which very, very rarely happens with that many duplicates - I may just duplicate them twice in the end).

So that's 12 sprites used for 8 enemies with 2 frames of animation, that leaves me 4. Two I use for the player so I can double-buffer animation. I can upload the next frame of animation over multiple frames (since it isn't 50Hz animation anyway) and flip once the frame upload completes. I only need 1 after that, which leaves me 1 last one to use for anything I like (or 5 spare if I choose to only duplicate the enemy frames twice).

With respect to the multiplexing, I split the screen vertically in 3 and recalculate the sprite registers based on the part of the screen that's going to display within that split - this doesn't take much, in the unlikely event I notice too much flickering, I (for now at least) have a lot of spare cycles to split the screen in a more granular fashion. I use Plus line interrupts for this, it makes the splitting and timing easier than relying on the standard CPC raster interrupts.


I quite like this scheme, but this only works for this particular game - I think the trick with multiplexing on the Amstrad Plus is to think of a scheme that works for your specific use-case and work around its limitations. It's not as flexible as a machine that lets you do hardware flipping or changing sprite pointers, but it's still very useful.
like
2
Members reacted like:
andycadley,Otto,

Offline dthrone

  • CPC6128
  • ****
  • Posts: 220
  • Country: gb
    • SOHDE
    • Awards
Re: Amstrad Plus Sprites vs Amiga Sprites
« Reply #3 on: 13:26, 30 October 21 »
like
2
Members reacted like:
Cwiiis,Otto,

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 1.155
  • Country: fr
    • urban exploration
    • Awards
Re: Amstrad Plus Sprites vs Amiga Sprites
« Reply #4 on: 15:34, 30 October 21 »

prehistorik 2 use multiplexing on moving sprites for foreground palm trees (leaves and trunks)




like
1
Members reacted like:
Otto,
use RASM, the best assembler ever made :p

I will survive

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.022
    • Awards
Re: Amstrad Plus Sprites vs Amiga Sprites
« Reply #5 on: 22:50, 30 October 21 »

[size=78%] I think the trick with multiplexing on the Amstrad Plus is to think of a scheme that works for your specific use-case and work around its limitations. It's not as flexible as a machine that lets you do hardware flipping or changing sprite pointers, but it's still very useful.[/size]


Yes 100% this. You have to craft your sprite usage somewhat and think about the limitations as you're arranging things rather than just having a generic multiplexer that you can use for most anything.


I have a shoot-em up multiplexer that worked similarly and would cycle which sprite is used for which enemy so that you could reuse animations as long as different enemies are on different frames. It would similarly only miss some sprites off if too many were in the same area (trying to flicker different sprites each frame)


I also have an idea for a space invaders clone but I haven't actually tried it out yet (and it may sit on the pile of half baked ideas for some time as I rarely get time for coding these days)
like
1
Members reacted like:
Otto,

Offline sigh

  • 6128 Plus
  • ******
  • Posts: 1.337
    • Awards
Re: Amstrad Plus Sprites vs Amiga Sprites
« Reply #6 on: 16:43, 25 November 21 »

I also have an idea for a space invaders clone but I haven't actually tried it out yet (and it may sit on the pile of half baked ideas for some time as I rarely get time for coding these days)
If you do - may I request for a co-op mode and also a split screen VS mode please? :D
like
0
No reactions

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.022
    • Awards
Re: Amstrad Plus Sprites vs Amiga Sprites
« Reply #7 on: 20:47, 26 November 21 »
I'm not entirely sure how a split screen space invaders would work (or if it would fit in with what I had in mind) but I'll certainly think about it. Assuming I ever actually do anything.  :laugh:
like
0
No reactions

Offline sigh

  • 6128 Plus
  • ******
  • Posts: 1.337
    • Awards
Re: Amstrad Plus Sprites vs Amiga Sprites
« Reply #8 on: 03:07, 27 November 21 »
Split screen would be side by side and it would be - who destroys all the enemies first. There could also be a special game mechanic where shooting the flying UFO that goes across the top of the screen, ends up sending an enemy onto the opponents side.
like
0
No reactions