View Single Post
Old 29 November 2015, 20:11   #95
2 contact me: email only!

Codetapper's Avatar
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,099
Originally Posted by Mrs Beanbag View Post
If it is only 1 pixel high, surely it can cover a maximum of only 2 different tiles.
Obviously I meant 1 pixel high after all your calculations needs to be plotted in each of the 4 tiles (by potentially blitting a 2x2 pixel object right in the corner of 4 tiles). Just the blitter setup for such a tiny blit is horrendous. (And let's not extend this discussion by saying you'd have yet another special case for using just the CPU for certain size objects too. Imagine the code!)

With some careful thought, it is possible to have bobs less than 16 pixels wide. Yes it will necessarily take up the full word width in memory, but if it has a few blank pixels down one side, obviously you don't need to draw or redraw that part, if it crosses a word boundary.
But once again all these special cases you have to handle (and check every frame when drawing) cost you CPU time. For a constant frame rate, you have to consider the average case. The expense of having a 15 pixel wide object so that in the 1 in 16 chance it doesn't have to span 2 tiles is not worth the added complexity imho.

A constant 8 pixel wide object on the other hand might be worth storing twice in memory (one version shifted 8 pixels) so you only have to blit one word depending on the type of game.

But coming back to Chuck Rock again for just a second, it makes me wonder about their design choice, if they are using the normal save/draw/clear method but drawing on the background layer, why have they bothered to do this? It must be because they want to use that colour palette, since it can have no performance advantage.
They kept spare colours on the back playfield for the enemies, that's why the palm trees are not a particularly nice colour on the first level - a weird dark greenish colour mixed with a kind of grey.

And the foreground playfield is drawn to in a couple of places (most notably the dinosaur that craps on you on the 2nd level). But that is blitted in front of that playfield like normal. Almost all enemies live on the back playfield.

If, however, you wanted to use the foreground palette, but were content with bobs appearing "behind" the playfield, it might be advantageous to use the method i speculated about earlier. Are you aware of any games that use such a technique?
Very few games use that, and I can't think of any off the top of my head. Usually it's just only to make it look like the enemies are going behind or through something on the screen, but more often than not, they just blit the obscuring object over the top to make the code simpler.

Last edited by Codetapper; 29 November 2015 at 20:17.
Codetapper is offline  
Page generated in 0.06233 seconds with 9 queries