| |
TBH
Registered: Mar 2010 Posts: 21 |
Dynamic Character Set
For some years I've been curious about the potential for dynamic character set definitions in scrolling games. It's not a new idea and there are many limited implementations (Bounder, Katakis, Hawkeye, Golden Axe, etc).
But, so far I haven't seen a transition-less scrolling game that was not limited to 256 char definitions. My idea is to treat the viewable screen as two edges - one incoming, one outgoing.
The incoming edge is 16-bit to hold the character definition indices. I'll call these Tiles.
The outgoing edge is 8-bit to hold the outgoing indices of the character definitions.
A section of char IDs can be set static so that Tile IDs fall straight through to the screen instead of undergoing transformation.
LIMITATIONS
1) No more than the number of characters allocated to use by the routine can appear on screen. If all 256 chars are set to be dynamic, then the screen cannot display more characters than that. Maps have to be designed with that in mind.
2) CPU Cycles.
Assuming a 75-byte edge (for diagonals), it's likely no more than 10 new char definitions will be introduced in one hit. YMMV.
No new chars takes about 2500 cycles. 10 new chars about 4500 cycles.
It's a lot, but my prototype code isn't optimised.
TECHNIQUE
Incoming Edge
1) Copy the incoming Tile indices to the Incoming Edge table. For example, if scrolling to the left, these images will appear in the rightmost column.
2) Check each Tile index to see if it is currently assigned a Char ID.
2A) If so, increment the char's counter of onscreen-occurrence and push the Char ID onto the screen or a buffer.
2B) If not, assign an unused character and copy the Tile image to the char's definition.
Outgoing Edge
1) Copy the outgoing char indices to the outgoing Edge table. These are the chars that are scrolling off the screen.
2) Use the char as an index to the table holding the counter for its onscreen occurrences and decrement that value. If there no further occurrences of that char onscreen then place it back into the pool of unused char Ids and mark the corresponding Tile ID as having no associated char.
OTHER USES
This could also work for regions of a non-scrolling screen. For example, a Bard's Tale style RPG where lots of character images need to be plotted and animated. For any region of the screen that needs to use dynamic chars applied, just "swipe" the origin of the edges down each row of that region.
BACK TO REALITY
Anyway, I wrote a prototype routine which works as expected, but that CPU hit is probably why no game seems to have adopted a similar approach. |
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
why not just use a character screen that emulates bitmap mode (5 charsets one every 6 lines), thus "character" usage is totally free. there are 25 entering chars, but everything can be optimised to unrolled loops, because of the simplicity. |
| |
Stone
Registered: Oct 2006 Posts: 172 |
When creating Disney's Pocahontas for the SEGA MegaDrive, we (Funcom) used oversized tilesets, but instead of dynamically allocating Char IDs, we used a stochastic method to determine a somewhat optimal set of static "zones" where characters were updated from precomputed tables. This worked out quite well and gave us large levels with varied backgrounds. |
| |
Digger
Registered: Mar 2005 Posts: 437 |
Monroe 6569 uses charmode with the technique described by Oswald. It could probably be good for a pinball implementation. |
| |
Fresh
Registered: Jan 2005 Posts: 101 |
@Oswald
One year ago I released a simple scroller based on the same technique. For stuff like that it works great, but in a game the main problem is that you're going to lose many char based effects (ie bullet). |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
Quote: @Oswald
One year ago I released a simple scroller based on the same technique. For stuff like that it works great, but in a game the main problem is that you're going to lose many char based effects (ie bullet).
you can have 16 free characters even in the most tight setup for bullets water animation, etc., or you can have just 5 rows per character set and have 46 free characters :)
charset switch can be done via nmi, so sprite multiplex will stay (more or less) unhurt.
scrolling will be a bit more complicated this way tho, but on the plus side these special chars dont need to be redrawn. |
| |
Fresh
Registered: Jan 2005 Posts: 101 |
Ok, sorry, I misunderstood the gfx mode you were talking about. You're talking about having normal badlines and changing d018 every 5 or 6 row while I meant having just one badline every 6 row: that means *fast* scrolling but limited char effects.
So yes, using normal badlines and changing every 5 rows gives enough freedom but scrolling the whole screen and updating X chars sounds heavy... |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
25 chars. thats 200 bytes, and even that can be spread over 2 frames if your max scroll speed is 4 pixel per frame.
so extra work is copying 100 bytes per frame. (lda (),y sta abs,x iny .. * 8)
~20-25 rasterlines time.
and as we scroll only horizontally even VSP may be used. at the cost of heaps of ram flimbo style parallax could be done with > 256 charset :)
but looking at sam's journey, or mayhem I dont think a game really needs more than 256. rather a skilled gfx artist. |
| |
Repose
Registered: Oct 2010 Posts: 225 |
I thought of something like this many years ago, for a very real purpose: 9600 baud scrolling 80 column terminal. You can't use too much time at once because you need to read the incoming bits in real-time. |
| |
Martin Piper
Registered: Nov 2007 Posts: 722 |
Flying Shark does this IIRC. |
| |
Spinball
Registered: Sep 2002 Posts: 88 |
Quote: I thought of something like this many years ago, for a very real purpose: 9600 baud scrolling 80 column terminal. You can't use too much time at once because you need to read the incoming bits in real-time.
The Diskmag Relax featured a fullscreen proportional font upscroller. I think it was also done with charsets like this. |
... 12 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 | 3 - Next |