# Omnimaga

## Calculator Community => TI Calculators => Axe => Topic started by: johnbchron on March 20, 2018, 08:51:08 pm

Title: Advice for keeping up with data?
Post by: johnbchron on March 20, 2018, 08:51:08 pm
Hey, so does anybody have any advice/strategies for keeping up with large amounts of data in larger games? I am having trouble keeping up with all my sprites and such. Also, when I don't fill a space in the memory for a sprite, I thought those empty bytes were just zeroes, but through recent experimentation they seem to not exist if not assigned. Is that true?
Title: Re: Advice for keeping up with data?
Post by: Streetwalrus on March 21, 2018, 06:14:37 am
If you don't assign anything to the Pic* pointers, then no memory will be used. If you need a large amount of sprites, you can put them all under the same pointer and index them, since they are all 8 bytes. For example:
Code: [Select]
`[the hex for your first sprite here]→Pic0[the hex for your second sprite here][the hex for your third sprite here][and so on]`Now Pic0 is the first sprite, Pic0+8 is the second sprite, Pic0+16 is the third, etc.
This trick is very useful if you need to manage a large number of sprites in an enemy system, as you can just draw any of them with Pt-On(x,y,I*8+Pic0), where I is the enemy's number or whatever else you decide. Also great for tilemapping.
Title: Re: Advice for keeping up with data?
Post by: johnbchron on March 21, 2018, 01:57:56 pm
In the final program, does this trick save memory? (is it an optimization?)
Title: Re: Advice for keeping up with data?
Post by: Eeems on March 21, 2018, 03:50:52 pm
It does not save you memory as the actual data is the same size.
Title: Re: Advice for keeping up with data?
Post by: Streetwalrus on March 21, 2018, 03:52:04 pm
It is an optimization in the way you write code though, as it makes it much easier to manage those sprites with less code.
Title: Re: Advice for keeping up with data?
Post by: E37 on March 21, 2018, 04:27:09 pm
How much data are you using? Even 80 sprites can fit inside L1. If you have massive amounts, you can store the sprites in an appv and copy it to ram when the program runs. I have never run into trouble with the amount of sprites. I usually run out of ram.
Title: Re: Advice for keeping up with data?
Post by: johnbchron on March 23, 2018, 02:08:58 pm
I meant more like, are there any particular strategies you guys use in keeping up with which sprites are which. I previously used the chronological order in which I made them, but this has proved inadequate.
Title: Re: Advice for keeping up with data?
Post by: Streetwalrus on March 23, 2018, 03:44:48 pm
Do what I told you, it's the best way to do it. Also remember that you can have custom named pointers with °.