CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: Dream of Omnimaga on June 07, 2016, 06:55:31 AM

Title: grosged Sprites lib stress-testing & experiments [hybrid BASIC]
Post by: Dream of Omnimaga on June 07, 2016, 06:55:31 AM
So I have begun stress-testing grosged's ASM lib for BASIC programmers called sprites, so I'll post my tests and experiments in this topic.

Basically, here I try to push hybrid BASIC to its limits like I did with the CE Textlib thread. Here are my first experiments and discoveries:

1) Sprites v3.2 can display up to 44 sprites at once. If you try to display 45 or more, then none will show up.

2) Trying to display 97 sprites that are 8x8 at 4x zoom in one loop with basic collision/getKey interaction gives a frame rate of approximately 2.7 FPS with over 135 KB of RAM left and only 8 sub-programs.

3) Trying to display 97 glitched up 235x235 pixels in size gives a frame rate of approximately 0.51 FPS under the same setup. This is not practical, but this is to show how fast the lib can display massive graphics.

4) An actual tilemapper using 8x8 sprites scaled up 3x on a 12x8 map grid with scrolling will run at 2 FPS under high RAM conditions.

Based on the results I got at #2, this means that scrolling RPG tilemaps that are 12x8 (like Axe games) might be feasible. However, more complex sprite display such as a tilemapper at #4 proves that maybe 12x8 scrolling might get too slow under low RAM/clogged VAT conditions. Nonetheless, it was fun to try and it proves that maps with fewer tiles shown at once might be able to stay at 2 FPS or higher. Otherwise, a faster solution would be to use 7x6 maps or something. And if you don't want scrolling then you can still have instant tilemap display. The NPCs and event tiles would have to be stored inside the map data and the map data would need to use lists. Having the character centered at any time might  A 999 element list allows a 32x31 tilemap.
Title: Re: grosged Sprites lib stress-testing & experiments
Post by: Adriweb on June 07, 2016, 01:40:03 PM
(/me advocates for using the AutoTester to help with the job :P)
Title: Re: grosged Sprites lib stress-testing & experiments [hybrid BASIC]
Post by: unregistered on June 07, 2016, 03:13:33 PM
Quote from: DJ Omnimaga on June 07, 2016, 06:55:31 AM
Sprites v3.2 can display up to 44 sprites at once. If you try to display 45 or more, then none will show up.

This afternoon, I came back to the sources...And finally found & put off this bug :)
I also improved a little more the routines CLSCREEN and SPRITE (now you can re-initialise sprites, just when defining sprite "000").
Plus, I added the option in routine PRINT "to return, then next line" (As DJ Omnimaga suggested) : thanks to the bold slash (you know, the one used for fractions, not divisions)

For example,

"Hello world!/Everything's okay ?":Asm(prgmPRINT
will display

Hello world!
Everything's okay?

At this moment, I'm not at home, I'll update Sprites (and instructions.txt files : french/english)  to v3.3 when back home ;)
Title: Re: grosged Sprites lib stress-testing & experiments
Post by: Dream of Omnimaga on June 07, 2016, 03:29:53 PM
Wouldn't it be better to use another character not used often in a game text such as the multiplication symbol? It's much easier to access in SourceCoder, TokenIDE and the calculator keypad. I am ok with the bold /, though, although I will need to figure out where it's located in TokenIDE.

Nice to see some of those issues fixed, though O.O
Title: Re: grosged Sprites lib stress-testing & experiments [hybrid BASIC]
Post by: unregistered on June 07, 2016, 03:40:46 PM
The bold slash / I 'm talking about is easily accessible on TI-83 Premium CE

(http://www.maths-et-tiques.fr/images/M_images/TI83GD.jpg)

Thanks to the key between [ vars ] and [ ) ] ... How do you proceed on TI84plus CE ?
Title: Re: grosged Sprites lib stress-testing & experiments
Post by: Dream of Omnimaga on June 07, 2016, 03:46:26 PM
There is no way to access it on the TI-84 Plus CE at all. You have to use an ASM program to access it. It's not even in the catalog menu.
Title: Re: grosged Sprites lib stress-testing & experiments
Post by: Dream of Omnimaga on June 07, 2016, 10:19:54 PM
UPDATE:

I have tested with the new Sprites v3.3, which can display up to 85 sprites at once instead of 44. The first screenshot displays 80 tiles in just 1 Asm(prgmSPRITES command:

(https://img.ourl.ca/10x8.gif)

The second screenshot displays 12x8 in 2 Asm(prgmSPRITES commands:

(https://img.ourl.ca/12x8a.gif)

EDIT: That last screenshot was attempted with every sprite zoomed 7x instead of 3x and I still got 2 FPS, so with smaller maps, larger zoom should not be a problem.
Title: Re: grosged Sprites lib stress-testing & experiments [hybrid BASIC]
Post by: Dudeman313 on June 17, 2016, 04:22:39 AM
The tiles look cool, but the (character?)sprite looks a bit weird.
Title: Re: grosged Sprites lib stress-testing & experiments
Post by: Dream of Omnimaga on June 17, 2016, 06:09:05 AM
Yeah, that's actually the 8x8 :walrii: from Wal-Rush! CE with the wrong colors. I just didn't have enough free time to convert one of my character sprites to Sprites v3.x. Thanks, by the way :)