Ecernosoft Posted August 2, 2022 Share Posted August 2, 2022 Hello! On this post I will explain the ridiculously simple, and effective way I compress ICT levels in the ROM. Enemies will be explained in the second section, as it's easier to understand. Each byte of the level data is split up into 2 parts, let's call them A and B. $xx AB B is the type of block (The ID divided by 2) plus the ground type. A is the # of times to repeat that block down the column. If A is less than 12, then another byte is fetched to fill in the rest of the space, and if that doesn't, another is fetched, untill all 12 columns are filled. First the column is stored in a 12 byte buffer (16 bytes for overflow reasons) and then copied to the screen. If A = 0 then B = the number of times to skip drawing and just load what's in the buffer N times. (n is B) If the entire column hasn't been filled, then it will just leave the rest of the buffer unchanged and copy that to the screen. If it has, then again, it leaves the buffer unchanged and copies it to the screen. Keep in mind that Level 1's level data is only ~150 bytes. Enemies use 2 bytes per enemy / object. The first byte is how many columns to wait to fetch the next enemy. The second byte is split up. $xx CD C is the enemy's YPOS and D is the Enemy ID + the Enemybase. (Enemybase isn't implemented yet) It's very effective, and fast. Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted August 3, 2022 Author Share Posted August 3, 2022 It's why the minus worlds are as hard as they are since they don't use valid level data, therefore you get springs that shoot you in the sky, crashing the game. Quote Link to comment Share on other sites More sharing options...
Traxx Posted August 10, 2022 Share Posted August 10, 2022 (edited) If your using 8x16 tiles you could use even less space,high nibble of a byte is repeat tile flag and low nibble is the amount,if you have unique tiles then high nibble for flag none repeat and low nibble for how many tiles. Just reread your comment,I was referring to map data,sorry Edited August 10, 2022 by Traxx Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted August 12, 2022 Author Share Posted August 12, 2022 I do use 8*16 tiles. (or 4*16 when it comes to 160B) Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted August 12, 2022 Author Share Posted August 12, 2022 On 8/3/2022 at 12:56 PM, Ecernosoft said: It's why the minus worlds are as hard as they are since they don't use valid level data, therefore you get springs that shoot you in the sky, crashing the game. In newer versions, springs don't work in the $00-$0F YPOS area. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.