[Development] Sprite Reuse + Priority Queue | |
---|
|
---|
| | Olle Haerstedt
Posts 110 25 Mar 2020 14:38
| How about implementing sprite reuse together with a priority queue, so that if too many sprites overlap horizontally, they will take turn being visible (leading to a flickering, which is the trade-off). Anyone know of such a system? Compare with e.g. NES games and their flickering when too much happens on the screen. Use-case could be an RTS engine with troops, where each troop is a sprite no matter the total number.
| |
| | Gunnar von Boehn (Apollo Team Member) Posts 6254 25 Mar 2020 18:08
| Let us give a brief over view about Amiga Sprites features. The Amiga has 8 sprite channels. Each Sprite channel can display many sprites as long as they are below each other on the screen. For example if your have a game like 1942 then you could with one sprite channel display many bullets flying up. If you use a sprite channel you could even display 100 small stars with just one Sprite channel. This means which clever usage of the Sprite Channel a game can display quite a lot of Sprites. There are limitations. You can only show 8 Sprites in the same row - unless you use tricks with the Copper. The Copper could in theory increase this.
| |
| | Olle Haerstedt
Posts 110 25 Mar 2020 20:25
| Hi! 8 sprite channels, so 8 sprites on each horizontal line, 256 lines, that gives 2048 sprites in total if the sprite is 1 px high. You saying this is possible? What would such a copperlist look like? oO Any link to copper increasing number of sprites possible on one row?
| |
| | Samuel Crow
Posts 424 25 Mar 2020 20:34
| Horizontally muxed sprites must use the same image data. The data is fetched once in the left border of the screen and is typically used for repeating backdrops. SAGA has a special mode that allows horizontal clipping to be turned off which is more efficient than using the copper to move sprites right x pixels after being displayed the first time.
| |
| | Olle Haerstedt
Posts 110 25 Mar 2020 20:59
| Samuel Crow wrote:
| Horizontally muxed sprites must use the same image data. The data is fetched once in the left border of the screen and is typically used for repeating backdrops. SAGA has a special mode that allows horizontal clipping to be turned off which is more efficient than using the copper to move sprites right x pixels after being displayed the first time.
|
Cool. Sounds like a blog post waiting to happen. :)
| |
| | Gunnar von Boehn (Apollo Team Member) Posts 6254 25 Mar 2020 21:28
| Olle Haerstedt wrote:
| Hi! 8 sprite channels, so 8 sprites on each horizontal line, 256 lines, that gives 2048 sprites in total if the sprite is 1 px high. You saying this is possible? What would such a copperlist look like?
|
For vertical Sprite Re-use you not need any copper list. The Sprite Channel DMA can this by itself. The DMA "works" like a playlist. Between each Sprite,re-used Sprite will be 1 transparent row. This means 256 = 128 Sprite per Channel max. 128*8 = max 1024 Stars on Screen :-) You need a Copperlist trick only to re-use the Sprite horizontally. SAGA adds a new Register-BIT, which allows horizontal Re-used without Copper even.
| |
| | Olle Haerstedt
Posts 110 25 Mar 2020 23:00
| Gunnar von Boehn wrote:
|
Olle Haerstedt wrote:
| Hi! 8 sprite channels, so 8 sprites on each horizontal line, 256 lines, that gives 2048 sprites in total if the sprite is 1 px high. You saying this is possible? What would such a copperlist look like? |
For vertical Sprite Re-use you not need any copper list. The Sprite Channel DMA can this by itself. The DMA "works" like a playlist. Between each Sprite,re-used Sprite will be 1 transparent row. This means 256 = 128 Sprite per Channel max. 128*8 = max 1024 Stars on Screen :-) You need a Copperlist trick only to re-use the Sprite horizontally. SAGA adds a new Register-BIT, which allows horizontal Re-used without Copper even.
|
I definitely want to try this.
| |
| | Olle Haerstedt
Posts 110 26 Mar 2020 19:36
| Some guy made a sprite engine with 94 sprites moving randomly. No source code or explanation on how. EXTERNAL LINK
| |
|