CPCWiki forum

General Category => Programming => Topic started by: zhulien on 06:41, 30 October 21

Title: Amstrad Plus Sprites vs Amiga Sprites
Post by: zhulien 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
Title: Re: Amstrad Plus Sprites vs Amiga Sprites
Post by: andycadley on 09:35, 30 October 21
You can multiplex sprites like this, although it's harder to pull off because:


Neither of those should put you off trying it out though.
Title: Re: Amstrad Plus Sprites vs Amiga Sprites
Post by: Cwiiis 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.
Title: Re: Amstrad Plus Sprites vs Amiga Sprites
Post by: dthrone on 13:26, 30 October 21
See Sudoplus for very simple but clever use of plus sprite multiplexing -
https://www.cpc-power.com/index.php?page=detail&num=14639

https://www.cpcwiki.eu/forum/games/sudoplus-need-your-participation/
Title: Re: Amstrad Plus Sprites vs Amiga Sprites
Post by: roudoudou on 15:34, 30 October 21

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

(https://i.postimg.cc/3dPNbj2q/prehisto2-00.png) (https://postimg.cc/3dPNbj2q)

(https://i.postimg.cc/8jFsHXfW/prehisto2-01.png) (https://postimg.cc/8jFsHXfW)
Title: Re: Amstrad Plus Sprites vs Amiga Sprites
Post by: andycadley on 22:50, 30 October 21
Quote from: Cwiiis on 11:58, 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)
Title: Re: Amstrad Plus Sprites vs Amiga Sprites
Post by: sigh on 16:43, 25 November 21
Quote from: andycadley on 22:50, 30 October 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
Title: Re: Amstrad Plus Sprites vs Amiga Sprites
Post by: andycadley 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:
Title: Re: Amstrad Plus Sprites vs Amiga Sprites
Post by: sigh 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.
Powered by SMFPacks Menu Editor Mod