Login
Back to forumSee the full topicGo to last reply

Posted By

gerliczer
on 2011-09-05
15:51:41
 Re: Great Giana Sisters

Hi George,

The theory of softsprites is actually very simple:
1. Save the background where the sprite will be displayed.
2. "Mask" the background, which means to remove the content from the area where the sprite will be shown. It is done by ANDing the background data with an "inverse" sprite which is containing active (1) bits in the positions where there is no sprite graphic and inactive (0) ones in the others.
3. "Mix in" the sprite, which means to draw its content into the area cleared in step 2. It is done by ORing the prepared background with the actual sprite data.
4. Wait for the next display cycle.
5. Restore the background.
6. Repeat.

In plus/4 coding it works a little differently. Because of performance reasons sprites are usually coded for char screens, not for bitmap mode. First reason is that this way there is no need to store the original background. Actually it gets copied into the characters reserved for the sprite to be displayed, then gets treated as described above, and finally the characters are copied to the char-matrix. Second reason is that restoring the background requires only a small number of chars to copy.

Then there is the question of fine positioning of the sprite since the characters are quite large and movement would be rough and too fast otherwise. It requires to have more copies of the mask and the sprite for the possible horizontal sub-positions inside the chars, and the code must be prepared to be able to start its work in different vertical positions inside the character block of the sprite. (And there is animation, sprite priority and collisions too.)

But this is only my understanding of this technique. I never implemented this yet, only half of it in some experimental unlimited bob effect code.


Back to top


Copyright © Plus/4 World Team, 2001-2025. Support Plus/4 World on Patreon