Jump to content
IGNORED

Blend characters with background


Recommended Posts

If you look this WIP :

You will notice a rectangle behind the main moving characters. It seems character mode was used and no PMG. The clipping area of the software sprites looks funny.

 

Is there a way to fix that? How do you blend the character with the background once it goes over other character ?

I am more interested in the logic behind it than giving me the code that does it

 

Tnx

Link to comment
Share on other sites

Basically, yes. I'm not sure how damaging the CPU overhead would be or whether all possible combinations of superimposed bitmap could be pre-computed (this would require a lot of spare characters).

 

I'm no game programmer, unfortunately, so am not well placed to point out any tutorials, but at the very least you'd require a background mask for the image in front. Bits in the background would be ANDed with the background mask to clear a silhouette of the image in front, and then the foreground bits are ORed in.

Link to comment
Share on other sites

The interesting part of that "demo" is that it is demonstrating the limits of the A8. Character modes won't help much for speed, if people want to have fluent and detailed animation with high fps on the screen.

Every character mode steals too much CPU cycles already, before a software sprite is moved.

The solution for such games is still Mode D with underlaying or overlaying PMg .

Link to comment
Share on other sites

Zone Ranger is one example that uses XOR but to perfectly mask, especially on a character that stays in focus like this, you would want to pre-render or use an AND and then an OR. The explanation that resonated most for me was in the "Image Masks" section of this article:

https://en.wikipedia.org/wiki/Mask_(computing)

 

I know Popmilo has done a lot of work in this area. See this thread as well which discusses performance and other concerns:

 

http://atariage.com/forums/topic/242523-software-sprites-too-much-complicated-on-atari-8-bit/?view=findpost&p=4082808&hl=%2Bsoft+%2Bsprites

  • Like 3
Link to comment
Share on other sites

Thanks Schlortt!!

They didn't answer your question.

The Bit calculations for Software sprites could take 7 times more CPU cycles per sprite, than just using byte boundaries. Well, it depends on the size of the sprite, but it takes a lot CPU . The coder aimed the 25fps for a smooth gameplay and, of course clean displaying of the scrolling. You might know that the scrolling is at 25fps, so you have to assure 25 fps updates on all software sprites, to have no jitter in the movement of the sprites.

And , as there were several different objects in different direction with 25 fps moving , there is no real chance to handle the borders without ruining the animations.

Link to comment
Share on other sites

Gremlins / Conan / Hard Hat Mack / Droll etc use XOR sprites...

 

gets messy with background but its easy to use and easy to erase ;)

 

i must say that conan has a very poor performance. the characters are flickering , the movement is not smooth and very slow.

in gremlins the background is mostly black so not many overlaps between characters

hard at mac is faster than conan, but still flickery and the XOR looks not so good.

Link to comment
Share on other sites

pang does an excellent work with blending the software sprites (chars) with the background. not sure it is XOR though,i think AND and then OR was used.

In Pang it doesn't matter , if a sprite is moving at either 3,5,7,1,15, 25 or 50 fps, as the screen is still. As soon as HW-Scrolling is used, all software sprites have to be synchronized to the scrolling speed.

Link to comment
Share on other sites

Btw: The Atari has several options to show a moving object on a scrolling screen, without Bit handling.

If wanted, the background could be exchanged to COLPF2 and 3, the object is allowed to walk over a chessboard, without any bit calculations.

Then there is still the option to multiplex the PMg. For the stones in the background (for example). It may take a lot CPU , but every moving object would be saved from extra Bit calculations.

 

The really nifty solution could be to build the main Sprite on character graphics, as in the game, but to also use the PMg for that range of where the masking is needed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...