Jump to content
IGNORED

Chained vs. un-chained SCBs


42bs

Recommended Posts

17 minutes ago, bhall408 said:

Of course ;-)

 

I really should have just asked if that theory was plausible (and thus worth pursuing)... My gut says yes...

Yes. At least I would do. Static objects that just vanish (thus setting the SKIP flag in the SCB). Makes a lot sense.

Link to comment
Share on other sites

Ms. Pac-Man has 200+ objects per screen (if you count dots as objects).

 

I thought earlier I recall it being said that 130 or so was OK (presumably for 60fps)

 

Would 250 or so be reasonable (on actual hardware) for 30fps or 20fps? (and given that the majority of them are single pixel)

 

...and at some point I'll see if I can get an max chained object count for Ms. Pac Man and report back ;-)

 

Link to comment
Share on other sites

19 hours ago, 42bs said:

Don't judge a 30 year old machine by today's possibilities.

 

 

I'm far from judging Lynx, I just see a different between two 34 year old solutions - amiga's one and Atari's one.

For a "clean" mode the first one reaches 1.79MB/s and the second one 4MB/s - thanks to using all available memory slots.

 

We don't know yet how internally Lynx's blitter works, but we know it can shows much much more sprites in one VBL than amiga and ST gathered together.
 

 

 

Link to comment
Share on other sites

1 hour ago, Cyprian_K said:

 

I'm far from judging Lynx, I just see a different between two 34 year old solutions - amiga's one and Atari's one.

For a "clean" mode the first one reaches 1.79MB/s and the second one 4MB/s - thanks to using all available memory slots.

 

We don't know yet how internally Lynx's blitter works, but we know it can shows much much more sprites in one VBL than amiga and ST gathered together.
 

 

 

The latest sprite record on the ST is 268 4 color sprites. Let's see if Suzy can beat this.

 

 

Ah and this one (unchained):

 

https://demozoo.org/productions/180262/

Edited by 42bs
  • Like 1
Link to comment
Share on other sites

3 hours ago, 42bs said:

The latest sprite record on the ST is 268 4 color sprites. Let's see if Suzy can beat this.

 

https://demozoo.org/productions/180262/

 

yep, Leonard did a great job, but this is a software record for 16x16 two bitplane (4 colors) sprites.

In case of hardware blitter's sprites, Lynx is still ahead of both machines:

- STE: 21 sprites 32x32 16 colors with background clearing:

 

- STE: 17 sprites 32x32 16 colors with restoring background:


- A500: 13 sprites 32x32 16 colors with restoring background

 

- A500 with FastRam: 21 sprites 32x32 16 colors with restoring background

 

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
On 7/7/2019 at 10:09 AM, 42bs said:

I made a small test drawing the Phobyx logo wobbling with a sinus (like demo0006) once with a chain of 102 SCBs (w/o size and palette reloading) and as 102 separate sprites (flipped, but this is only the drawing order).

(See https://github.com/42Bastian/lynx_hacking/tree/master/chained_scbs).

 

Chained is always quicker and on a Lynx II it can be drawn in a single frame at 60Hz.

But not on Handy.

 

Just wanted to share this.

Out of curious, how do I compile that to a Handy lynx image for testing?

Link to comment
Share on other sites

  • 1 month later...
On 7/10/2019 at 10:40 AM, karri said:

Guys. What a pity you tell me this now. I could have written On Duty with linked sprites but now I am too far in the project for changing the design. I already used the RAM for other things and there is no way to change this any more.

Does it matter for linked vs. separate for RAM layout? As I recall, all SCBs need to be located in Lynx RAM anyway.

Link to comment
Share on other sites

In Nutmeg  I used three sprites structures to handle background, tiles am font.

 

This limits  the performance obviously. During the last week of the competition I could reorganize the code and found memory for a 50 sprites chain, but using it the FPS speed decreased.

 

Don't know why, maybe a mistake by me or maybe the two large starting sprites to draw the scrolling bg.

 

Not having time to debug it I had to revert to the first solution.

 

I should try to do it again to understand what happened

  • Like 1
Link to comment
Share on other sites

16 minutes ago, LordKraken said:

ok I guess by reloading you mean using the "skip" flag on the SCB that does not need to be drawn?

No, I mean, you can tell if size, tilt, skew and palette should be loaded from each SCB. So if all sprites are of the same size, no need to reload it.

But if chaining pays off is really a case to case decision. No general rule.

For example the sprite-record demo: You need to set for each sprite the new x,y values. So what is quicker: Setting it for all sprites in a loop and then draw the chain once? Or draw each sprite separately.

But this is more a less an academic question I guess.

Link to comment
Share on other sites

Ah ok yeah I dont call that "reload" in my head :) 

but in typical tile-based game, like my bombercats for instance, SCBs have fixed position, same palette, so the only thing that gets update sometime is the data. So I'm 100% sure that in this case, linked sprites are way faster :) (well I hope ^^)

Edited by LordKraken
Link to comment
Share on other sites

Many years ago, when we were learning to code on Lynx (well, still in learning process in fact :D), Anata wrote a small Mario like level with scrolling and 1 character you could control, but it was really slow.

I spent some time studying chaining and I rewrote his engine with use of chained sprite instead of drawing sprite by sprite. The new version was really smooth and playable.

But unfortunately, as fas as I know, he did not pusue his effort, and I'm pretty sure I have lost the source codes.

But after this, I always tried to make use of chained sprites.

  • Sad 1
Link to comment
Share on other sites

Ok guys, I confess. On Duty does not use linked sprites at all. I draw them one by one. Actually when some tile is animated I draw that tile twice.

 

When I now look back I SHOULD have used linked sprites. I lost precious smoothness in the character moves because of lack of processing power. The problem is that On Duty use up all memory - literally. In some levels I even replace the entire content with new stuff from the cart. The downside is that enemies and data will spawn in any parts of the game that was re-loaded. The only level that suffers from it is the underground factory. If I now try to add linked sprites I must cut a third away from all my maps.

 

Link to comment
Share on other sites

1 hour ago, enthusi said:

Actually I think it bombercats you might get away faster by only redrawing 'dirty' tiles one by one ;-)

But if you dont need any more speed, a fixed matrix might be more convenient indeed.

I though about it. And on paper that is optimal... if only the game was not so dynamic...

When you start having big explosions all over the place, marking the sprites to redraw might take more time than redrawing all of them at once.

but I might test it if i can think of a simple solution.

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...