Jump to content
IGNORED

It's Conner time's level compression


Ecernosoft

Recommended Posts

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.

Link to comment
Share on other sites

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 by Traxx
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...