* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Making a huge tilemap  (Read 987 times)

0 Members and 1 Guest are viewing this topic.

Offline Omegaxis213

  • New User
  • Join Date: Mar 2015
  • Location:
  • Posts: 6
  • Post Rating Ratio: +0/-0
Making a huge tilemap
« on: July 29, 2015, 12:47:04 pm »
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?



Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3165
  • Post Rating Ratio: +32/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • quantuminfinity
  • Gender: Male
Re: Making a huge tilemap
« Reply #1 on: July 29, 2015, 03:38:23 pm »
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...


Offline Omegaxis213

  • New User
  • Join Date: Mar 2015
  • Location:
  • Posts: 6
  • Post Rating Ratio: +0/-0
Re: Making a huge tilemap
« Reply #2 on: July 29, 2015, 05:00:26 pm »
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?

Offline Hayleia

  • Full User
  • Join Date: Nov 2014
  • Location:
  • Posts: 324
  • Post Rating Ratio: +12/-0
Re: Making a huge tilemap
« Reply #3 on: July 29, 2015, 05:24:56 pm »
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)

Offline Omegaxis213

  • New User
  • Join Date: Mar 2015
  • Location:
  • Posts: 6
  • Post Rating Ratio: +0/-0
Re: Making a huge tilemap
« Reply #4 on: July 29, 2015, 05:29:05 pm »
Is there a limit to how big the appvar size is?

Offline Hayleia

  • Full User
  • Join Date: Nov 2014
  • Location:
  • Posts: 324
  • Post Rating Ratio: +12/-0
Re: Making a huge tilemap
« Reply #5 on: July 29, 2015, 05:31:58 pm »
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 ;)

Offline Omegaxis213

  • New User
  • Join Date: Mar 2015
  • Location:
  • Posts: 6
  • Post Rating Ratio: +0/-0
Re: Making a huge tilemap
« Reply #6 on: July 29, 2015, 05:35:31 pm »
Ok thanks.

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3165
  • Post Rating Ratio: +32/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • quantuminfinity
  • Gender: Male
Re: Making a huge tilemap
« Reply #7 on: July 29, 2015, 06:39:45 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...


 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games