Join us on Discord!
You can help CodeWalrus stay online by donating here.

Making a huge tilemap

Started by Omegaxis213, July 29, 2015, 12:47:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Omegaxis213

So if I wanted to make a huge tilemap that was around 90*90 tiles (and the tiles are 8*8 pixels big), I would have to chop it up into multiple pieces because it can't all fit into one list. I know I can create 9 appvar and constantly update the list with the correct map tiles, but how would i figure out if a player is on the edge of a appvar (when the appvar touch each other) and when to use at least two different appvar with only a chunk/line of code that i can use no matter how big the tilemap is?

Snektron

I guess you use Axe? How many different tiles do you have? And maybe you can make it use ram slot A with some ASM magic. Anyway maybe you could try to store it in chunks of say 16*16 or something and have some kind of lookup table to get data of the chunk at coordinates?
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Omegaxis213

Yes I am using Axe, but the problem that I ned help with is that if there are 2 "chunks" right next to each other how would you use the coordinates of the player to access both of the chunks if he is standing in between them because each list resets its number. Let's say if the person is standing in {L1+40} and that is the edge of the map,and you want to retrieve {L2+1} which is the other side of the map. How would i make some code that would check for the player and give the correct data to be displayed between 2 different list?

Hayleia

Why don't you just unarchive (or create an unarchived copy of) your appvar ? This way, you can just read and write from it without limitations.
Or even better if you don't need to write to it, read from it while it's still archived using Y0-Y9.

(And please don't say "list" for L1...L6 :P)

Omegaxis213

Is there a limit to how big the appvar size is?

Hayleia

When reading while it's archived, no (that's the short answer, because of course you can't make an infinite sized appvar, but I meant that this is not the reading method that will restrict the size). That's what I do in Pokemon for example, the whole thing is like 50KB but since the program is the only thing that needs to be unarchived while running, everything's running with no problem :)

When reading/writing while it's unarchived, of course you're limited by your RAM :P
You can't make a 15KB appvar if you're also running a 15KB program for example (or if you have other unarchived programs in RAM). But what you can do is compile your program as an application, this way it's run from archive and saves RAM ;)

Omegaxis213


Snektron

Quote from: Hayleia on July 29, 2015, 05:31:58 PM
When reading/writing while it's unarchived, of course you're limited by your RAM :P
You can't make a 15KB appvar if you're also running a 15KB program for example (or if you have other unarchived programs in RAM). But what you can do is compile your program as an application, this way it's run from archive and saves RAM ;)

Is it also possible to let the appvar be on the app page? though that probably required some nasty hax <_<
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Powered by EzPortal