[Coco] DynoSprite Demo 1

Richard Goedeken Richard at fascinationsoftware.com
Sat Oct 5 01:08:39 EDT 2013


Hello again everyone!  After several months of intense work, I am proud to 
present the DynoSprite game engine.  I am releasing a demo based upon this 
engine, called Marbles in a Box.  The demo is relatively simple: there are 5 
marbles bouncing around the screen with a tilemapped background full of 
randomly placed tetris pieces.  You can affect the speed of the marbles by 
scrolling the background with the joystick and bouncing the marbles off of the 
sides of the screen.  The marbles ricochet off of each other when they 
collide. The exciting part is the engine itself, because this software could 
be used as a basis for lots of different games.  As previously mentioned, I 
intend to use this for a side-scrolling adventure game and maybe an overhead 
racing game in the future.  But it could be used for almost any game which 
requires sprites and a scrolling background.  The hardest work of achieving 
good performance with the graphics, dealing with disk i/o, and memory 
management is all done.

Before I get into the details, here's a link to download a ZIP archive of the 
disk:

http://www.fascinationsoftware.com/media/DynospriteDemo1.zip

The md5sum hash of .dsk image inside is: 8d0b906353c757d78f99d2cb25b9fc09

I'd say overall that the engine is about 75% complete. There are 2 important 
features remaining before I'll start work on the game, and those are data file 
compression and 6309 optimizations.  Once I get into the game development I'll 
also add audio and some kind of title screens and menus. But I'm really happy 
with the way this demo came out, and I hope that you all like it.  I've been 
thinking that I will release Dynosprite under some kind of open source license 
in the future, so I'm hoping to drum up interest and get other developers 
involved as well.  It would be really cool to see more awesome Coco 3 games in 
the future!

To play the demo, use a joystick in the right port.  After the level loads, 
you can use the joystick to scroll the background up, down, left, or right at 
variable speeds.  You can increase the energy and speed of the 'marbles' by 
bouncing them off the sides of the screen just as if they were in a box. 
Their speed decays exponentially until it is below 1 pixel per frame in each 
direction.  I chose not to decay the speed to 0 because it's cool to watch the 
marbles putter around and bounce off each other.  I'm pretty sure that the 
ricochet calculations are correct, but you might notice some interesting 
'artifacts' resulting from round-off error.  If you get the balls going fast 
enough they can pass through each other, since I'm not extrapolating their 
positions to handle this case.

If you press the first joystick button, the level will re-load and randomly 
re-generate the background tilemap and starting marble positions.  I used this 
feature to test the code for un-loading and re-loading a level from the data 
files.

I did nearly everything I could think of to wring out the last drop of 
performance from this engine.  The demo runs at 60hz even when scrolling in a 
single direction by the maximum speed.  It drops down to 30hz if scrolling 
diagonally at a high speed.  I ran a test with more objects on the screen to 
see how the performance will degrade as the load is increased, and it actually 
performs pretty well. The variable frame rate allows it to still feel fast 
even as the frame rate drops; only the jerkiness increases.  This demo proves 
the viability of a fast overhead racer game on the Coco, as (with the 
exception of sound) this demo is already beyond the computational load that 
this type of game would require (just 2 cars and a scrolling background).

Currently I only have support for Composite colors.  I do not have an RGB 
monitor setup on my Coco, so if someone has a working CM-8 (or one of Roy's 
VGA converters) that they would be willing to sell me, I'd be happy to add 
this to my hardware setup and add RGB color support.

Here's a feature list for the Dynosprite engine:

  - DynoSprite is a general purpose game engine for the 512k Coco 3 using the
    320x200x16 color graphics mode.
  - DynoSprite consists of a build system (makefile), a collection of python
    scripts for compiling sprites and processing data files, and about 5400
    lines of 6809 assembly code in 15 source files.  There is good
    engineering-level documentation with the source as well.
  - Game assets are loaded from disk files, including level and object
    handling code, sprites, background tiles, and tilemaps.  Supports
    multiple levels in a game.  Only those assets which are needed by the
    current level are loaded into memory, so the game can by very large.
    It is possible to add multi-disk support in the future.
  - Supports a tilemapped scrollable background plane.  Tiles are 16x16.  Up
    to 255 different tiles per level. Background tilemap size can be up to
    64k tiles, but height is limited to 68 tiles high (about 5 vertical
    screens).   Width can be up to 2000 tiles wide (100 horizontal screens).
  - At each frame update, the background can be scrolled up to 8 lines
    vertically in 1-line increments, and 8 pixels horizontally, in 2-pixel
    (1-byte) increments.
  - Graphics are double buffered, and a variable frame rate is supported
    (60hz, 30hz, 20hz)
  - Sprites are compiled to near-optimal 6809 assembly language (painting
    the sprite byte by byte) for maximum performance.  The computational
    load of each sprite is roughly proportional to the number of
    non-transparent pixels.
  - Maximum sprite size is 62x32.  Sprites can be positioned anywhere on
    screen with single-pixel precision.  They can overlap with the left/right
    sides and bottom of the screen.
  - Object oriented architecture reduces work required in writing code to
    handle game objects.
  - Tested and working with MESS coco3 emulator and a real Coco3 system
    using: Disk Extended Color BASIC and DriveWire (HDB-DOS)

Regards,
Richard



More information about the Coco mailing list