Author Topic: Advice for keeping up with data?  (Read 6020 times)

0 Members and 1 Guest are viewing this topic.

Offline johnbchron

  • LV2 Member (Next: 40)
  • **
  • Posts: 33
  • Rating: +1/-0
  • RiskALungForDiving
    • View Profile
Advice for keeping up with data?
« 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?
Just a dude who is really bored in school... and a huge nerd.
Click here to give me an internet!
 <a href="http://www.freebiebitcoin.com">Earn free bitcoin</a>

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Advice for keeping up with data?
« Reply #1 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.

Offline johnbchron

  • LV2 Member (Next: 40)
  • **
  • Posts: 33
  • Rating: +1/-0
  • RiskALungForDiving
    • View Profile
Re: Advice for keeping up with data?
« Reply #2 on: March 21, 2018, 01:57:56 pm »
In the final program, does this trick save memory? (is it an optimization?)
Just a dude who is really bored in school... and a huge nerd.
Click here to give me an internet!
 <a href="http://www.freebiebitcoin.com">Earn free bitcoin</a>

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Advice for keeping up with data?
« Reply #3 on: March 21, 2018, 03:50:52 pm »
It does not save you memory as the actual data is the same size.
/e

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Advice for keeping up with data?
« Reply #4 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.

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: Advice for keeping up with data?
« Reply #5 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.
I'm still around... kind of.

Offline johnbchron

  • LV2 Member (Next: 40)
  • **
  • Posts: 33
  • Rating: +1/-0
  • RiskALungForDiving
    • View Profile
Re: Advice for keeping up with data?
« Reply #6 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.
Just a dude who is really bored in school... and a huge nerd.
Click here to give me an internet!
 <a href="http://www.freebiebitcoin.com">Earn free bitcoin</a>

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Advice for keeping up with data?
« Reply #7 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 °.