Tag Info

New answers tagged

4

Yes, there's a reason to do this. The user might want to play the map again, and if so having all (or at least most of) the map already resident in memory means it doesn't needed to be loaded from disk again, thus reducing load times in that (often typical) case. Purging something from memory is not free, either, as there may be references to loaded that ...


9

I understand that having the same "size" each attachment can be aligned better, but practically speaking is it better to waste channels (or reserve them for future use) and having all the RTs of the same size or I should use just what needed? Having a 32bit aligned Render Targets is better, even if it means "wasting" some memory. This will be much ...


0

You can store the direction with 2 bits: 1 for axis and 1 for pos/neg. As such, storage-wise it will be more efficient regardless of the number of bends -- about ~2.5 KB for 10,000 tiles. Store it as a bitmask as well (1.25 KB for 10K tiles) and then you have fast collision checks ("is snake on tile"). The slowest operation would be "Access nth body part" ...


0

In the worst case it looks to me like you're going to use more memory this way. Picture a snake that goes something like this: ‾|_|‾|_|‾ as much as possible. There are a few spots at the edge of the screen where it must go straight for a few squares but those aren't enough to overcome the higher memory storage per location unless the world is small. While ...



Top 50 recent answers are included