(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-19-24 12:38 PM
0 users currently in SMW Hacking.
Acmlm's Board - I3 Archive - SMW Hacking - End of level? New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
Smallhacker

Super Koopa
I AM A Group Of Officially Frustrated Younglings, G.O.O.F.Y. MEMBER








Since: 11-17-05
From: Söderhamn, Sweden

Last post: 6301 days
Last view: 6299 days
Skype
Posted on 06-17-06 02:43 PM Link | Quote
Dispite figuring out most of SMW's level format myself, I haven't managed to find how the game detects the end of the level. The levels seems to end with the block's first or last byte being FF or something, but it doesn't work. Any help?


(edited by Smallhacker on 06-17-06 01:44 PM)
spel werdz rite









Since: 11-19-05

Last post: 6300 days
Last view: 6299 days
Posted on 06-17-06 02:52 PM Link | Quote
What do you mean "it doesn't work"?
As in you type in FF, but the levels keep going?
You said you figured out the format, but just to be safe:
Some objects can be four or five bytes long if they are custom blocks. There are bit flags that determine this in the first and second byte, but I don't remember which ones.
If you want, I can post a crappy .txt file here of all my SMW level notes.
Smallhacker

Super Koopa
I AM A Group Of Officially Frustrated Younglings, G.O.O.F.Y. MEMBER








Since: 11-17-05
From: Söderhamn, Sweden

Last post: 6301 days
Last view: 6299 days
Skype
Posted on 06-17-06 03:00 PM Link | Quote
It doesn't work, as in, when I tell my program to stop when the first/second/whatever byte is FF, it still keeps going. Sometimes, it keeps going on for long, sometimes, it stops shortly after the end. The "special" blocks that handles settings, exits and stuff... Are they stored before the level, after the level or in the level?

As for the .txt file, please do. Comparing my own information with somebody else's would be good.


(edited by Smallhacker on 06-17-06 02:01 PM)
spel werdz rite









Since: 11-19-05

Last post: 6300 days
Last view: 6299 days
Posted on 06-17-06 03:14 PM Link | Quote
The notes aren't complete. They're good enough, I just haven't written out all the Extended Objects, so that shouldn't be a problem.

EDIT: sorry, there's something wrong with the attachments!
EDIT2: I'll just post it here, ugh!
Super Mario World Level Format

How Super Mario World configures levels

Byte 1
P - T - F - Y - Y - Y - Y - Y
P="New Page" flag, which basically means that if turned on, this object, and all others passing it, are written to the next page.
0=No
1=Yes
T=Has multiple properties depending on other flags, explained later.
F=Which page to load. Standard objects have two pages to load from, this bit determines which page it will be.
0=Page 1
1=Page 2
Y=Object's Y-coordinate. The higher the value is, the lower the object goes. Past 0x1A, the object starts over on the next page.

Byte 2
S - S - S - S - X - X - X - X
S=Object value, these bit values are the core components of what the object will be. Certain bit values from the first byte can dramatically change the meaning of these bits.
X=Object's X-coordinate. The object travels more to the right the higher the value gets.

Byte 3
V - V - V - V - H - H - H - H
V=Vertical stretch of the object, extends downward.
H=Horizontal stretch of the object, extends to the right.

Standard Objects
If T=0 in byte 1, then the byte format is for standard objects.
There are 0x1F entries for standard objects. Two pages determined by F and 0x0F values determined by S.
For F=0, the S-bit values create the following objects:
0000=Creates extended objects, explained later.
0001=Dark blue water that Mario can swim through.
0010=Invisible coin block that only becomes visible when Mario hits it from below.
0011=Invisible jumping note block that only becomes visible when Mario hits it from below.
0100=Invisible coin that only becomes visible when mario hits a blue POW.
0101=An ordinary coin.
0110=A dirt tile that Mario can walk through.
0111=A water tile that Mario can swim through.
1000=A jumping note block that Mario can jump on.
1001=A turn block, which Mario can hit to start it turning, or break with a spin jump from
above.
1010=A question block with a coin inside.
1011=A type of block that Mario can pick up and throw.
1100=A black pirhana plant.
1101=A grey cement block that Mario can't walk through.
1110=A brown block that will turn into a coin if Mario hits a blue POW.
1111=A vertical pipe that can have various styles.
It's styles are determined by the H-bit in byte-3.
0000-End on top
0001-End on top, exit enabled
0010-Double ended
0011-End on bottom
0100-End on bottom, exit enabled
0101-No end
All the rest are null.
For F=1, the S-bit values create the following objects:
0000=A horizintal pipe that can have various styles.
It's styles are determined by the V-bit in byte-3.
0000-End on left
0001-End on left, exit enabled
0010-End on right
0011-End on right, exit enabled
All the rest are null.
0001=A bullet machine.
The H-bit is null, this is a vertical-only extendable object.
0010=A slope object that can have various styles.
It's styles are determined by the H-bit.
0000-Normal slope left
0001-Steep slope left
0010-Gradual slope left
0011-Normal slope right
0100-Steep slope right
0101-Gradual slope right
0110-Normal slope left, upside down
0111-Normal slope right, upside down
1000-Steep slope left, upside down
1001-Steep slope right, upside down
1010-Normal slope left
1011-Steep slope left
1100-Gradual slope left
1101-Normal slope right
1110-Steep slope right
1111-Gradual slope right
Note past 1001 is just repeats.
0011=A ledge edge object that can have various styles.
It's styles are determined by the H-bit.
0000-Left edge
0001-Right edge
0010-Vine
0011-Solid left and top edge
0100-Solid left edge
0101-Solid right and top edge
0110-Solid right edge
0111-Left edge with solid top
1000-Right edge with solid top
1001-Solid left, very steep top left slope
1010-Solid right, very steep top right slope
1011-Solid left+top, left facing bottom edge
1100-Solid left, left facing bottom edge
1101-Solid right+top, right facing bottom edge
1110-Solid right, right facing bottom edge
1111-Null
0100=A standard type of ledge that Mario can walk on.
0101=A midway/goal point object, used to mark the midway point or the end of the level.
The H-bit flags the goal point object.
0000=Midway point
0001=Goal point.
Anything higher will still make a goal point.
0110=A purple coin. It acts like a regular coin, except when you hit a blue POW the brick it
creates still acts like a coin.
0111=A rope/cloud object that Mario can walk on.
The V-bit flags the clouds.
0000=Rope
0001=Clouds
Anything higher will still make clouds.
1000=Water with an animated surface.
1001=Water with a non animated surface.
1010=Mud/Lava with an animated surface.
1011=A climbing net object with an edge on the top.
1100=A donut bridge that Mario can walk on.
The V-bit is null, this is a horizontal-only extendable object.
1101=A climbing net object with an edge on the bottom.
1110=A climbing net object with a left/right edge. The top and bottom can automatically adjust for corners.
The H-bit flags the right edge.
0000-Left edge
0001-Right edge
Anything higher will still make a right edge net.
1111=A skinny vertical pipe/bone/log object.
The H-bit is null, this is a vertical-only extendable object.

Lunar Magic Use
If T=1 and F=0 in byte 1, then the byte format is for Lunar Magic use. FuSoYa recreated some of the null objects in this index for ExGFX and map16 formating. Some objects are still used, and some will be used for later.
The objects created are determined by the S-bit values in byte 2:
0000=A skinny horizontal pipe/bone/log object.
The V-bit is null, this is a horizontal-only extendable object.
0001=A wide-scale ground ledge object, often used to span an entire level.
This object redifines byte 3 to "H H H H H H H H" it has a 0xFF extension.
0010=Loads page 0 of the direct map16 access.
0011=Loads page 1 of the direct map16 access.
If a map16 page is loaded, then this become a four byte object. The fourth byte determines the tile to load along with the page.
0100=?Ex-BG/FG-GFX?
0101=?ExAnimation?
0110=?Nothing?
0111=?ExSpriteGFX
1000=?Nothing?
1001=Reserved for future use by Lunar Magic.
1010=Reserved for future use by Lunar Magic.
1011=Reserved for future use by Lunar Magic.
1100=Reserved for future use by Lunar Magic.
1101=Reserved for future use by Lunar Magic.
1110=Null
1111=Null

Tileset Specific Objects
If T=1 and F=1 in byte 1, then the byte format is for tileset specific objects.
The objects created are determined by the S-bit values in byte 2:
0000=An ice-blue vertical pipe with the end on top.
The H-bit is null, this is a vertical-only extendable object.
0001=A frozen turn block that cannot turn.
0010=A blue switch block. This will appear as an outline if the Blue Switch Palace switch
hasn't been activated yet.
0011=A forest tree top. Place this at Y=10 to 15 for best results.
The V-bit is null, this is a horizontal-only extendable object.
0100=A solid ledge edge, usually only used in forests
The H-bit flags the right edge.
0000-Left edge
0001-Right edge
Anything higher will still make a right edge.
0101=A type of ledge that's usually only used in forsets.
0110=A large tree trunk object
The H-bit is null, this is a vertical-only extendable object.
0111=A small tree trunk object.
The H-bit flags going behind it.
0000-Stay in front of it
0001-Go behind it
Anything higher will still make you go behind it.
1000=A red switch block. This will appear as an outline if the Red Switch Palace switch
hasn't been activated yet.
1001=A right facing diagnal pipe.
The H-bit is null, this is a vertical-only extendable object.
1010=A left facing diagnal ledge.
1011=A right facing diagnal ledge.
1100=A ledge built out of arches that Mario can walk on.
The V-bit is null, this is a horizontal-only extendable object.
1101=A small top fringe with cloud type ledges.
It's styles are determined by the H-bit.
0000-Top cloud fringe
0001-Top cloud fringe on white
All the rest are null.
1110=A small side fringe used with cloud type ledges.
It's styles are determined by the V-bit.
0000-Left cloud fringe 1
0001-Left cloud fringe 2
0010-Left cloud fringe 1 on white
0011-Left cloud fringe 2 on white
0100-Right cloud fringe 1
0100-Right cloud fringe 2
0101-Right cloud fringe 1 on white
0111-Right cloud fringe 2 in white
It repeats afterwards
1111=A bush object available in various styles
It's styles are determined by the H-bit.
0000-Bush 1
0001-Bush 2
0010-Bush 3
All the rest are null.

Extended Objects
As said earlier, if the standard object of F=0 is 0, then it is an extnded object, meaning that the third byte determines what the object is. It also means that the object is unextendable.
0x00-0x0F=FATAL! DO NOT USE!
0x10=A small door that Mario can only enter if he's small. But if you place the door one tile
above the ground, Mario can only enter it if he's small and riding Yoshi.
0x11=An invisible 1-UP question block that will only become visible when Mario hits it from
below.
0x12=Invisible jumping note block that only becomes visible when Mario hits it from below.
0x13=A top left corner edge tile
0x14=A top right corner edge tile
0x15=A small invisible door that Mario can only eneter when he's small, and will only be visible if he hits a blue POW. And if you place the door one tile
above the ground, Mario can only enter it if he's small and riding Yoshi.
0x16=An invisible question block with a coin inside that will only show up when Mario hits a
blue POW.
0x17=A green star block with a 1-UP inside. Mario must collect 30 coins in the level before hitting this, or it will only give him another coin.
0x18=A moon that will give Mario 3 extra lives.
0x19=Invisible 1-UP point #1.
0x1A=Invisible 1-UP point #2.
0x1B=Invisible 1-UP point #3.
0x1C=Invisible 1-UP point #4.
0x1D=A red berry that Yoshi can eat. If he eats ten, he'll lay an egg with a mushroom inside.
0x1E=A pink berry that Yoshi can eat. If he eats two, he'll lay an egg with a coin game cloud
inside.
0x1F=A green berry that will increase the levels time limit by 20 if Yoshi eats it.
0x20=An always-turning turn block
0x21=
0x22=
0x23=
0x24=
0x25=
0x26=
0x27=
0x28=
0x29=
0x2A=
0x2B=
0x2C=
0x2D=
0x2E=
0x2F=
0x30=
0x31=
0x32=
0x33=
0x34=
0x35=
0x36=
0x37=
0x38=
0x39=
0x3A=
0x3B=
0x3C=
0x3D=
0x3E=
0x3F=
0x40=
0x41=
0x42=
0x43=
0x44=
0x45=
0x46=
0x47=
0x48=
0x49=
0x4A=
0x4B=
0x4C=
0x4D=
0x4E=
0x4F=
0x50=
0x51=
0x52=
0x53=
0x54=
0x55=
0x56=
0x57=
0x58=
0x59=
0x5A=
0x5B=
0x5C=
0x5D=
0x5E=
0x5F=
0x60=
0x61=
0x62=
0x63=
0x64=
0x65=
0x66=
0x67=
0x68=
0x69=
0x6A=
0x6B=
0x6C=
0x6D=
0x6E=
0x6F=
0x70=
0x71=
0x72=
0x73=
0x74=
0x75=
0x76=
0x77=
0x78=
0x79=
0x7A=
0x7B=
0x7C=
0x7D=
0x7E=
0x7F=
0x80=
0x81=
0x82=
0x83=
0x84=
0x85=
0x86=
0x87=
0x88=
0x89=
0x8A=
0x8B=
0x8C=
0x8D=
0x8E=
0x8F=
0x90=
0x91=
0x92=
0x93=
0x94=
0x95=
0x96=
0x97=
0x98=NULL
0x99=NULL
0x9A=NULL
0x9B=NULL
0x9C=NULL (Actually, SnifflySquirrel created an ASM hack which turns this into a Green
Switch Palace block wich is solid before the switch is activated)
0x9D=NULL (Actually, SnifflySquirrel created an ASM hack which turns this into a Yellow
Switch Palace block wich is solid before the switch is activated)
0x9E=NULL (Actually, SnifflySquirrel created an ASM hack which turns this into a Blue
Switch Palace block wich is solid before the switch is activated)
0x9F=NULL (Actually, SnifflySquirrel created an ASM hack which turns this into a Red
Switch Palace block wich is solid before the switch is activated)

Map16 Objects
Lunar Magic inserts custom map16 tiles past 0x200 all the way to 0xFFF. If T=1 and F=0 in byte 1, and if the second byte is "0 1 1 1 X X X X" then it is an expanded map 16 object. Expnded map16 objects require five bytes. The third byte, once again, determines the stretch. The fourth byte determines the page to load (note, page 0 and page 1 can be accessed this way through hex, but Lunar Magic won't do it). But because there are only 0x0F pages, the first four bits of the byte are meaningless. Lunar Magic will save them as 0. They can be altered, but it won't have an effect. The fifth byte determines which tile will be loaded.



(edited by spel werdz rite on 06-17-06 02:17 PM)
SnifflySquirrel

Shyguy








Since: 03-03-06
From: Vermont

Last post: 6400 days
Last view: 6300 days
Posted on 06-17-06 03:37 PM Link | Quote
Wow, I got mentioned in level format notes. *insert blushing smiley here* Actually, I made a slightly cleaner version of the iswitch patch, which makes the Direct Map16 Switch Blocks toggle state once you hit the relevant switch. If I ever get un-lazy enough to make a patch, I'll probably upload it to SMW Central.

On-topic:
Actually, Extended Objects 0 and 1 do have a use. Extended Object 1 is a "page skip" object, which causes object rendering to continue on the screen indicated by its "Y position". Extended Object 0 is a screen exit object. These are four bytes long (the fourth stores the low byte of the destination index), so it's possible this is the problem.
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - SMW Hacking - End of level? |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.011 seconds; used 394.59 kB (max 539.66 kB)