18 August 2022, 05:47 | #1 |
Registered User
Join Date: May 2022
Location: Canada
Posts: 139
|
HAM game with sprites - Proof of concept
Hello Amiga hardware programmers!
After asking around a bunch of questions on the Copper, timing, etc., I've decided to come up with a proof-of-concept and I would like to share and get your insights of what you think about it. The goal: - Imagine a game that would leverage the power of the HAM mode - Game should run on a plain unexpanded Amiga 500/1000/2000 - Using Copper to recycle sprites and change sprite colors Here's how I would see it: - The background, in HAM, would be made of 16x16 tiles. - Since every tile would have their leftmost pixel always using a Palette color, no HAM fringing would occur, as long as the horizontal scrolling is done in increment of 16 pixels (i.e.: basically, jumping from one tile to another, so no smooth scrolling*) - *Note: smooth scrolling could be possible by using a 16-pixel wide "black sprite" which would mask off the 16 leftmost pixels of the screen to hide any HAM fringing, but for now I am not considering doing that. - The HAM color palette is composed of a simple grayscale ramp (from black to white, 16 shades) - This palette would allow semi-realtime shadows: basically, any scanline of a tile on the screen could be tinted in realtime by subtracting a value from 0 to 15 to all its pixel values: whether that pixel represents an index-color OR a R-G-B modify value, the tinting would work by making the shade darker. - It is almost equivalent to consider the screen a 'true-color' mode in a way. - The sprites are set using DMA to be all enabled, position outside the visible display, and go from 0 to 255 lines (so spanning the whole screen vertically) - Using the copper, every 16 pixels, a sprite is repositioned. So any sprite can appear anywhere on the screen, and even multiple times, per scanline. This is thanks to the fact that using 6 bitplanes, the copper has exactly just enough cycles to perform one CopMove every 16 pixels. - During hblank, the Copper sets all of the 12 color palettes for the sprites. There is about just barely enough time to do that. - It means that all sprites are composed of many colors. See the attached screenshot to view my current test sprite sheet. The 3rd screenshot is running in WinUAE: In total currently this proof of concept is showcasing: - a background with 1243 colors (in HAM) - 320 simultaneous sprites on the screen, using a total of 533 colors (Technically the maximum possible would be 4096 colors for the background, and 3072 colors for the sprites). During the screen display, the CPU is pretty much completely starved by display DMA and copper, so only the Vblank period would be usable for game logic, scrolling, blitter, etc. What do you think of my idea? I'm eager to hear from you amiga experts! (I've added a screenshot of the DMA debugger to show the screen is packed; I do not know what the colors mean however since I never used that WinUAE feature before) Thank you, Rem |
18 August 2022, 10:31 | #2 |
Registered User
Join Date: Feb 2008
Location: Northampton/UK
Posts: 525
|
There are a couple of HAM games out there, Pioneer Plague is one of them,
most are slower paced RPG style affairs. The demo HAM Eager by Platon really shows HAM strutting it's stuff. I guess there are not so many HAM games as it is technically challenging, and rather slow. Looking forward to seeing what you achieve, looking great so far! |
18 August 2022, 15:36 | #3 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,411
|
Very interesting stuff, thanks for making this proof of concept. I've always wondered how you could do a HAM game with more flexibility than what Pioneer Plague is doing, so this is nice to see
I do wonder a little bit about the Sprite multiplexing you suggest. How do you see this working with freely moving Sprites? At a guess, I'd say that this would require not just Sprite repositioning, but also reloading the Sprite data. If you also need per-pixel movement horizontally, that would mean doing 4 Copper moves per Sprite channel reloaded/positioned, or 64 pixels worth of 'space' between each reloaded Sprite channel given that each Copper move takes 16 pixels. Makes me wonder how easy/hard that would get with multiple freely moving objects on the screen. As for the Visual DMA debugger of WinUAE, it's a great tool to see the use of the various DMA sources and the CPU in Chip RAM. Each 'pixel' in the Visual Debugger represents a DMA cycle in Chip RAM and the colours each represent a DMA or CPU source. Here's a small list of colours used: Magenta = Sprites Yellow/Dark yellow = Copper Red = audio Dark Red & Gray = CPU (read/write) Dark gray = memory refresh Cyan/Green/Light blue-green = Blitter Blue = Bitplanes White = Disk Last edited by roondar; 18 August 2022 at 15:44. Reason: Corrected the colour listing for the current versions of WinUAE |
18 August 2022, 16:07 | #4 |
Registered User
Join Date: Jun 2020
Location: Druidia
Posts: 389
|
I really like this! Love to see a novel approach!
I especially like the idea of using three color sprites but changing their palette every line. You see that a lot for backgrounds but I don't think I've seen it used for sprites so effectively. You might consider scaling back your ambitions for the sprites and only multiplexing them vertically. That would still allow for 8 sprites on a line and would free up more DMA slots for the CPU or blitter to use. That might be more practical for a real game system. With 6 planes for the screen and tiles you'll likely run into memory constraints on an OCS A500 so you might want to plan on the background remaining single buffered and arranging blits so they race the beam. Anyway, great stuff! |
18 August 2022, 16:09 | #5 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,411
|
Yeah, using only 8 sprites per line would make this a whole lot easier for sure
|
18 August 2022, 16:50 | #6 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 4,884
|
Really interesting concept as well as nice and cute gfx.
Hope to see some animated gif or video soon. |
18 August 2022, 22:39 | #7 | |
Registered User
Join Date: May 2022
Location: Canada
Posts: 139
|
Quote:
Also you are correct, normally in a dungeon there would never be 320 objects on the screen at the same time, so there would be some spare cycles for allowing two objects on the same tile (for example, the Hero jumping on a Coin to collect it, or the Hero walking past a Torch hanging on the wall). I also wanted to have door archways that the Hero can walk underneath, so sprite numbering for priorities would also be considered carefully. Next step I'll attempt to implement basic character movement and more realistic sprite multiplexing to see how feasible it could be. And then provide an ADF disk file here so in can be tested on various configs. About memory: I was intending to use a single buffer for the HAM display 48KB, and possibly a single copper list (if possible) to save on memory. The copper list is quite big at about 17KB. Plus 8KB of sprite DMA data. So figuring out maybe 48KB of tile graphic data, and 32KB of sprites data (so total of around 153KB out of 512KB). Some space needs to be available for music and sounds, that part I haven't looked at all so far. For horizontal scrolling, I was thinking of simply moving the starting address of the bitmap by 16 pixels (2 words), so only one tile column needs to be drawn at the right edge. For vertical scrolling, it would be resetting the address of the bitmap at the appropriate point. (I haven't completely investigated how scrolling would be done, but I was heading toward scrolling only by 16x16 tile increment) |
|
18 August 2022, 22:58 | #8 |
Moderator
Join Date: Jan 2002
Location: Chicago, IL
Posts: 3,375
|
Interesting concept, why not use AGA HAM8?
|
19 August 2022, 05:58 | #9 |
Registered User
Join Date: May 2022
Location: Canada
Posts: 139
|
|
19 August 2022, 10:57 | #10 |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 540
|
This is going to sound weird, but I think this look would also work really well for a sokoban-type game. It'd also let you play with the game mechanics a bit without having to push too hard (no pun intended).
For an RPG this looks amazing and I would love to try it. I'd be a little concerned the RPG scope might be a bit too big to build, fit into an A500 and get out of the gate depending on how much time you have for it. Would you be interested in maybe trying something smaller first to get a basic full game working then expanding? I really love the approach though. The 16x16 tile model works far better than I ever thought it might. We definitely need more OCS/ECS HAM games. I've been playing LINKS lately and I'm surprised there are so few HAM games out there. |
19 August 2022, 11:07 | #11 | |||
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,411
|
Quote:
Cool stuff Quote:
Quote:
|
|||
19 August 2022, 13:10 | #12 |
Registered User
Join Date: Dec 2018
Location: Earth
Posts: 1,064
|
Bill Williams Knights of the Crystallion was HAM only and did run on a Standard A500.
https://hol.abime.net/2597 and also Pioneer Plague https://hol.abime.net/1068 But i guess you already knew those Last edited by Torti-the-Smurf; 19 August 2022 at 18:06. Reason: adding Links to HOL |
19 August 2022, 15:37 | #13 |
Registered User
Join Date: Feb 2008
Location: Northampton/UK
Posts: 525
|
I often wondered If Heroes of Might and Magic: Clash of Heroes could be done in such a HAM format, with AGA+ resembling (vaguely) the big boy version in 640x512, and OCS looking like the DS one in 320x256.
360/PS3/Android (Quick resize to 640x512) Nintendo DS |
19 August 2022, 16:39 | #14 |
Moderator
Join Date: Jan 2002
Location: Chicago, IL
Posts: 3,375
|
I would love to see a HAM8 platform game for some strange reason.
|
19 August 2022, 17:00 | #15 | |
Registered User
Join Date: Apr 2018
Location: UK
Posts: 487
|
Quote:
I think a slightly scrolling one could be possible if it was laid out right. Or maybe something along the lines of bubble bobble is more feasible. That sprite multiplexer would have to be top notch. |
|
19 August 2022, 18:33 | #16 |
Moderator
Join Date: Jan 2002
Location: Chicago, IL
Posts: 3,375
|
We need more HAM games. Only Bill Williams created a couple of them years ago. He was a very talented developer that was lost unfortunately. It would be exciting for more HAM games to be developed. The Amiga has those unique and interesting features like HAM for example that give it character.
|
19 August 2022, 19:36 | #17 | |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,894
|
Quote:
[ Show youtube player ] |
|
19 August 2022, 19:43 | #18 |
HOL/FTP busy bee
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,606
|
|
19 August 2022, 21:07 | #19 |
Registered User
Join Date: Apr 2018
Location: UK
Posts: 487
|
Does the nighmare fest that is top banana use HAM mode? Some of the later levels are pushing some really weird colour depths. Or is it just hammering the blitter in 32/64 colour mode? It's an odd one.
[ Show youtube player ] |
20 August 2022, 00:40 | #20 |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,180
|
if stuff not moving around too much or at all is a requirement, then maybe imitating something like the Valhalla adventure games?
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Proof of concept: Network bootdisk and installer for real hardware | Firestone | Amiga scene | 12 | 17 July 2021 15:02 |
Hang On proof of concept | skyzoo73 | Amiga scene | 25 | 21 February 2020 22:33 |
Please Help me find this HAM game | Gilbert | Amiga scene | 9 | 05 April 2014 11:07 |
Amikill Amiga Concept Doom Weapons Game | Amiten | project.Amiga Game Factory | 6 | 04 March 2013 18:18 |
Game that used 'HAM' mode | Big-Byte | Looking for a game name ? | 24 | 28 August 2002 10:37 |
|
|