View Single Post
Old 04 February 2017, 15:46   #1
Master484
Registered User
 
Master484's Avatar
 
Join Date: Nov 2015
Location: Vaasa, Finland
Posts: 525
32 color shmup demo



This is a small demo that I made to see if Blitz could run a 32 color "arcade" bullet rain shmup with 100+ objects on screen.

ADF is in the attachment. Source code is included, you can freely use the code in your own projects.

And this time the graphics too are actually made by me, these objects were taken from a work-in-progress OCS 32 color shooter gfx set, and once the whole set is ready I'll post it to OpenGameArt for everyone to use.

---

Demo Requirements: ECS with 1 MB of RAM

Keys

1 - delete objects
2,3,4,5 - create enemies and bullets

L - fire mega laser

Fire - Shoot lasers (hold down for auto-fire)
Space - Shoot many lasers at once

---

The drawing routines in this demo are optimized for extremely high BOB amounts, or at least I tried to make them so, and below is short explanation on how it works.

Firstly players ship is a 32 pix wide 16 color sprite, using 4 channels. But everything else are BOBs or Tiles, and use 32 colors. Two commands are used : "Block" and "Blit", and everything in the screen is drawn every frame with 2 drawing "passes".

First the whole screen is filled every frame with size 32*32 Tiles. But instead of drawing the tiles, they are "BlockScrolled" from a separate "scroller bitmap" into the main playfield. And the "scroller bitmap" is updated with a new set of tiles at 2 screen intervals, that means when 2 screens have been scrolled. This is the only time when tiles are blitted. On A500 at least you'll notice a short pause in the scroll every 2 screens. In an actual game I think a 6 screen interval or so would be better, but in this demo we use just 2 screens.

The tile filling "BlockScroll" always completely erases everything that was drawn to the game area during the previous frame. And scrolling too is achieved with the Blockscroll; the area which is Blockscrolled from the scroller bitmap gets it Y-position updated by 1 pixel every frame.

And after the Blockscroll is done, other objects are then drawn to the game bitmap, using a simple "Blit" command. Blit is the fastest Blitz drawing command that still offers transparency, but it's rarely used because it can't "save and restore" the background like BBlit does. But in our case we don't need to care about this drawback, thanks to screen being filled with tiles every frame.

The demo also has collisions on place: Bullets and Enemies are checked vs Player, and Player bullets are checked vs Enemies. So the speed at which this runs is close to what it would be in an actual game.

---

So, the whole thing works like Xenon 2, everything is drawn every frame. Basic speed is always 25 FPS, and when screen gets crowded you get 14-17 FPS on average.

But 14 FPS is still very playable, and the drawing system is very resistant to "additional graphics". For example 40 bullets + 20 enemies on screen still remains quite playable.

The biggest benefit of this system is that the "background damage" caused by 100 BOBs is cleaned as fast as the damage of just 1 BOB. Normally doing BG copy-saves and repairs in 32 colors for 100 BOBs would be extremely slow, but here it costs only 1 frame.

So we get a 25 FPS shooter engine, with the a capability to support lots of BOB at a still playable 14-17 FPS frame rate.

Another benefit is that there is no need for "re-draw buffers" or "queues" that are needed for QBlit and BBlit. So we can draw an unlimited number of images every frame, without the fear of running out of Buffer or Queue space. The only limit is the game object collection, which I limited to 1000 active objects at once.

---

So surely one could make a "bullet hell" shooter with Blitz, with full 32 colors. Although a red "14 FPS" warning sticker would be required on the game box.
Attached Thumbnails
Click image for larger version

Name:	BulletRainV3shot.png
Views:	813
Size:	6.8 KB
ID:	52059   Click image for larger version

Name:	Bullet_Hell_demoV5.png
Views:	821
Size:	11.4 KB
ID:	52313   Click image for larger version

Name:	AGADualPlayfieldShooter.png
Views:	3009
Size:	23.4 KB
ID:	52668  
Attached Files
File Type: zip BulletRainV3.zip (49.5 KB, 188 views)
File Type: zip BulletRainV6.zip (130.1 KB, 251 views)
File Type: zip AGADualPlayfieldShmup.zip (135.8 KB, 193 views)

Last edited by Master484; 31 March 2017 at 14:22. Reason: added AGA demo version
Master484 is offline  
 
Page generated in 0.04563 seconds with 12 queries