0 Members and 3 Guests are viewing this topic.
You can still read it from the archive, while uncompressing it to ram, no ?
Or even read the tiles to draw or check for events from the compressed archived map on the fly.
And I'm sure you can use another method to handle trainers, one where you don't have to assign a specific tile to each trainer.
Woah, I don't think I'll manage that
counter = 0for x=0 to screen_width/tile_width for y=0 to screen_height/tile_height tile_number = offset_x+x+(offset_y+y)*map_width while tile_number-compressed_map(counter) > 0 ; substract the current length of same tiles to our tile ID until zero or less counter+2 ; to get the next length of tiles end counter+1 ; to get the tile number draw_tile(x, y, counter) endend
There surely is, but I didn't find any way to do it without modifying the map
If you're planning to do it in asm, space won't be an issue I think.Quote from: Hayleia on March 15, 2013, 08:46:40 amWoah, I don't think I'll manage that You just need to know 3 things : the uncompressed map width and x/y offsets. Then you can do something like this (can be a lot optimised, though) :Code: [Select]counter = 0for x=0 to screen_width/tile_width for y=0 to screen_height/tile_height tile_number = offset_x+x+(offset_y+y)*map_width while tile_number-compressed_map(counter) > 0 ; substract the current length of same tiles to our tile ID until zero or less counter+2 ; to get the next length of tiles end counter+1 ; to get the tile number draw_tile(x, y, counter) endendHowever with chickendude's tip you'll have to check the sign flag first, and if it's on, only increase the counter to 1, unless that's the tile we want (if so, reset it).
Quote from: Hayleia on March 15, 2013, 08:46:40 amThere surely is, but I didn't find any way to do it without modifying the mapWhy won't you want to modify it ? That's the only way to optimise it
I think you can still use the same system (each trainer = a tile) if you divide the map into smaller ones, this way you can reuse some tiles for different trainers, and to check who it is just compare with the map ID (you'll have of course to save it with the list of beaten trainer, but it would just take one more byte and will allow you to use less than 127 different tiles).
Yeah, I figured out that it would look like something like that, and it took me an entire week to code the tilemapper in ASM, hence why I said that I could not manage to code another piece of code with two "for loops" one in another Or there might be a way to get it with only one "for loop" by putting x and y in one number (like a=y*256+x or something).Or maybe you were not thinking about me making this in ASM but in Axe ? That would work
But how do you start a new game ? You have to restore the map, and "the only way" to do that is to have a copy of an untouched map somewhere, so I thought that instead of having 2 different maps, one untouched, the other one being the map for the current game, I'd only deal with one map that never moves.
That could work to optimize the map, but for all the methods, there is to choose between compressing the map and adding code to uncompress it, or saving code with an uncompressed map, and for this method, I feel like keeping track of all maps and get to know which one the player must go to would add more code than it saves space
Quote from: Hayleia on March 15, 2013, 11:23:45 amYeah, I figured out that it would look like something like that, and it took me an entire week to code the tilemapper in ASM, hence why I said that I could not manage to code another piece of code with two "for loops" one in another Or there might be a way to get it with only one "for loop" by putting x and y in one number (like a=y*256+x or something).Or maybe you were not thinking about me making this in ASM but in Axe ? That would work You can do it in both asm and axe, and if you need help to do it in asm, you can create a topic and post your current code.
I don't know how you handle trainers right now, but for my part I think I'm just going make a list of them (within the players datas), and modify it when they are beaten. When the player will past by the trainer's tile (the same for all), I'll just check from the coordinates who it is.
Quote from: Hayleia on March 15, 2013, 11:23:45 amThat could work to optimize the map, but for all the methods, there is to choose between compressing the map and adding code to uncompress it, or saving code with an uncompressed map, and for this method, I feel like keeping track of all maps and get to know which one the player must go to would add more code than it saves space Yeah in axe maybe, but in asm I'm sure you'll gain space even with some more code to handle different compressed maps. 10ko only for maps is kind of huge, and as far as I remember Pokémon Topaze maps weren't that vast, no ?
But how will you check with coordinates ? because I guess that you won't have a "If X=... and Y=..." for every trainer, will you ?Or maybe having with another data list with the form "x1,y1,x2,y2,...,xn,yn", and for every trainer, finding the k so that X=xk and Y=yk would be possible, but once again, wouldn't adding a data list be in opposition with the aim of saving space ?
Quote from: Hayleia on March 15, 2013, 01:25:06 pmBut how will you check with coordinates ? because I guess that you won't have a "If X=... and Y=..." for every trainer, will you ?Or maybe having with another data list with the form "x1,y1,x2,y2,...,xn,yn", and for every trainer, finding the k so that X=xk and Y=yk would be possible, but once again, wouldn't adding a data list be in opposition with the aim of saving space ?How are you handling that right now ? When the player has beaten a trainer, you have to save it somewhere, right ? Not by modifying the map itself I guess.That said, using a single tile for all trainer may not be the most optimised thing to do whereas using differents one per trainers and per maps might be better (and takes less than 127 different ones)...I'll try to encode your map just to see how many bytes you can gain.
Good luck anyway Yesterday I finished to look at the 18 Mastermind programs that we got. The best score is 97, the worst score is 35, the average score is 77.5, and the median score (do we say like that ?) is 82. But anyway, this doesn't include Neo's scores (he hasn't finished yet) and also some will lose several points because they were late.