Jump to content
Sign in to follow this  
José Pereira

The number of chars using on a soft sprite

Recommended Posts

post-6517-0-32225600-1319609070.gif

 

This, for example would have (just sprite, no shifting) 32chars in total.

Is it possible to use just the chars in use (that here would be those green cells and would be only 20chars more shifting)?

 

In the Bitmap Masking coding have the guy all joined (32chars) or, if possible, just the used chars (20chars) makes any difference (like CPU/cycles...)?

Just thinking in ways of saving usefull chars.

 

 

Thanks.

Edited by José Pereira

Share this post


Link to post
Share on other sites

You save cycles by not having to do the merge/draw/restore but lose out by needing to do the check.

 

e.g. in your 8x4 matrix of characters, there's 32 times the program needs to ask "Do I have to put a character here?"

But in the scheme of things the gain is much more than the loss, e.g. of a loss might be a 5x4 matrix where all cells get filled.

 

Another way to save is in circumstances where a cell is entirely sprite colour, ie no merge needed but in this case there doesn't seem to be any.

Share this post


Link to post
Share on other sites

That in a little A8 nº of chars on each charset, having, for example, a win of 12chars would be the best way to go, right?

 

Would that check/question if we 'need to put a char here' spend many cycles?

Share this post


Link to post
Share on other sites

Not too many. Some sort of RLE could probably be used, so a bunch of flag/length data could be assigned to each animation frame.

 

So if there was 4 cells to skip, the main part of the loop could be avoided and just adjust all the working variables accordingly.

 

Another method altogether might be to draw that figure as 3 seperate objects, minimising blank spaces but the overall saving would be less.

Share this post


Link to post
Share on other sites

yeah... go for joining soft sprites... so put 2 sprites because imho it gets too much code overhead for all kind of checks... my experience tells me... not worth...

 

the sprite copy routine will anyway check f.e. if it is an empty byte to copy and skipp the code which is not needed.

Share this post


Link to post
Share on other sites

or write separate sprite routines for each type of enemy... then you can tailor the code specific for each task...

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...