News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

[SM] SMILE Graphics questions

Started by shadedmagus, July 29, 2015, 07:56:06 PM

Previous topic - Next topic

shadedmagus

Hi all! It's been some time since I was last on here, but now I have some free time finally and am pretty much happy with the engine and physics changes I've made. Now it's time to move to graphics. I'm making a mockup of the changes I want to make to the room tilesets and layouts, and I hope to have these answers by the time I'm ready to replicate them in the ROM.

My idea generally involves mostly changing just the tilesets, and not really messing with the room layouts very much. But there are some things that I haven't really seen answers for after looking through the engine works threads a bit, both in regards to how Super Metroid handles tiles and palettes in certain scenarios, as well as things SMILE can or cannot do. With that said, here are my questions.

1. Can Super Metroid display a "stack" of layer 1 tiles? What I mean by this is, can you place a tile in a square, and then place another tile in the same square, and the first tile will show through the alpha/transparent pixels in the second tile? I'm not sure how better to describe this, but MZM does this in Crateria with the puffball plants, and I wanted to know if there was a way to make SM do the same thing.

2. Can you use more than one tileset for doors in the main Zebes portion of the game? I'm thinking that Metroid Super Mission did this, but I wanted to make sure it wouldn't cause any problems.

3. Is there a way to make the upgrade/expansion item PLMs use a different palette than CRE 0? Working within that palette for detail is not ideal, but I've already got satisfactory changes for those tiles in place if it isn't possible.

4. I'd like to use a few patches in this project, the Screw Attack block being one of them. Would I be able to use SMILE to set Screw Attack BTS? If not, how would I go about doing this *shudder* manually?

5. The other patch I'd like to use is the graphics and palettes relocation. Can I do this and then modify SMILE so that it recognizes the new locations for each? Also, does this patch expand all graphics areas including CRE?

6. Without checking again to get details, it seems there's some issues with manipulating the Ceres Station's tileset and having it show up properly in the game. Can anyone provide details to what can be done to change that tileset successfully? I know I saw a thread discussing this, but I don't know if a definitive answer was given. I'll look through the threads again and edit this question if it has already been answered.

I had a few other questions I can't think of right now because I'm at work and don't have my project files open. I'll update this post when I think of them. Thanks in advance for any answers!

Ahh, I remembered one!

7. Can you place Layer 1 tiles as air tiles and have them show up behind a door bubble, so that it doesn't look like the background just cuts off? This might be a variation on question 1; if so, I apologize.

Scyzer

#1
Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
1. Can Super Metroid display a "stack" of layer 1 tiles? What I mean by this is, can you place a tile in a square, and then place another tile in the same square, and the first tile will show through the alpha/transparent pixels in the second tile? I'm not sure how better to describe this, but MZM does this in Crateria with the puffball plants, and I wanted to know if there was a way to make SM do the same thing.
Not with tiles on the same layer. You get 2 layers for tiles in SM. You can use sprites though, which can be layered as many times as needed.

Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
2. Can you use more than one tileset for doors in the main Zebes portion of the game? I'm thinking that Metroid Super Mission did this, but I wanted to make sure it wouldn't cause any problems.
You can either move the door tiles into the SCE tileset (making sure they're in the same relative position for all tilesets), or add more CRE tilesets. Adding CRE will require some ASM changes. Regular SMILE cannot read the new CRE (RF can however, as long as you tell it where to look).

Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
3. Is there a way to make the upgrade/expansion item PLMs use a different palette than CRE 0? Working within that palette for detail is not ideal, but I've already got satisfactory changes for those tiles in place if it isn't possible.
If it's a PLM who's graphics are in the tileset, simply change the palette used by the tile. If the graphics are uncompressed in ROM, locate the PLM header and go to it's location in bank $84. 2 pointers are found. You want the second pointer. Follow it in the same bank. You should see [$8764][XXXX] (X is the pointer to the graphics in the ROM). The 8 bytes following that will be between 00 and 03. Each byte represents a corner of the tile: Top left > top right > bottom left > bottom right, then again for the second frame of animation. The value of the byte is the palette to use in that corner.
Ice Beam pickup
PLM Pointer = $EEEF
At $84EEEF = [$EE64][$E189] < You want second pointer.
At $84E189 = [$8764][$8C00]
                   [$00,$03,$00,$00][$00,$03,$00,$00] < Palettes to use for each corner.

Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
4. I'd like to use a few patches in this project, the Screw Attack block being one of them. Would I be able to use SMILE to set Screw Attack BTS? If not, how would I go about doing this *shudder* manually?
As long as you know the BTS values and tiletypes required for any custom blocks, it's easy to set them in SMILE. You don't have to use the preset block types from the Special BTS in SMILE.

Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
5. The other patch I'd like to use is the graphics and palettes relocation. Can I do this and then modify SMILE so that it recognizes the new locations for each? Also, does this patch expand all graphics areas including CRE?
SMILE is coded to read the locations of the tilesets and palettes from the code in the ROM. You can safely move tilesets around and SMILE can read them.

Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
6. Without checking again to get details, it seems there's some issues with manipulating the Ceres Station's tileset and having it show up properly in the game. Can anyone provide details to what can be done to change that tileset successfully? I know I saw a thread discussing this, but I don't know if a definitive answer was given. I'll look through the threads again and edit this question if it has already been answered.
The Ceres area itself is coded to not display any CRE tilesets, so the SCE tilesets are shifted to fill this space. The Ceres tilesets can be used normally in any area that is not Ceres. You can easily use the Ceres tileset normally in any room, but you cannot change the area to/from Ceres after building a room without having to remake it after.

The exception are the Mode 7 tilesets in Ceres, which are room specific and cannot be edited properly within SMILE (you can edit them in SMILE RF).

Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
7. Can you place Layer 1 tiles as air tiles and have them show up behind a door bubble, so that it doesn't look like the background just cuts off? This might be a variation on question 1; if so, I apologize.
The SNES has 4 layers. Layer 1 and 2 are used by tiles. Layer 3 is used by FX. Layer 4 is not used at all. The door bubble uses layer 1, so you need to place your background tiles on layer 2 under the door to make the background not cut off. Layer 2 will show up through the transparent sections of layer 1 (with normal tile priority anyway).
And no, you cannot make SM use the 4th layer. It would be easier to create a new SNES game from scratch.

shadedmagus

Thanks for the response, Scyzer!

Quote from: Scyzer on July 29, 2015, 08:48:34 PM
Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
1. Can Super Metroid display a "stack" of layer 1 tiles? What I mean by this is, can you place a tile in a square, and then place another tile in the same square, and the first tile will show through the alpha/transparent pixels in the second tile? I'm not sure how better to describe this, but MZM does this in Crateria with the puffball plants, and I wanted to know if there was a way to make SM do the same thing.
Not with tiles on the same layer. You get 2 layers for tiles in SM. You can use sprites though, which can be layered as many times as needed.

Oh, OK! So if I can put tiles on Layer 2, does that conflict with any present scrolling backgrounds then? I know the save rooms use only tiles for their backgrounds, but most other rooms use the scrolling backgrounds. If I can put tiles on both layers AND use the scrolling background, that would be perfect!

Quote from: Scyzer on July 29, 2015, 08:48:34 PM
Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
2. Can you use more than one tileset for doors in the main Zebes portion of the game? I'm thinking that Metroid Super Mission did this, but I wanted to make sure it wouldn't cause any problems.
You can either move the door tiles into the SCE tileset (making sure they're in the same relative position for all tilesets), or add more CRE tilesets. Adding CRE will require some ASM changes. Regular SMILE cannot read the new CRE (RF can however, as long as you tell it where to look).

Hmm. If the graphics and palette relocation patch gives me more room to play with for 8x8, your first suggestion might work, though I would hate to lose that space for all tilesets, considering I was only thinking of different doors for the wrecked ship. If that turns out to not be an option, I might ask more about the ASM changes that need to happen.

Quote from: Scyzer on July 29, 2015, 08:48:34 PM
Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
3. Is there a way to make the upgrade/expansion item PLMs use a different palette than CRE 0? Working within that palette for detail is not ideal, but I've already got satisfactory changes for those tiles in place if it isn't possible.
If it's a PLM who's graphics are in the tileset, simply change the palette used by the tile. If the graphics are uncompressed in ROM, locate the PLM header and go to it's location in bank $84. 2 pointers are found. You want the second pointer. Follow it in the same bank. You should see [$8764][XXXX] (X is the pointer to the graphics in the ROM). The 8 bytes following that will be between 00 and 03. Each byte represents a corner of the tile: Top left > top right > bottom left > bottom right, then again for the second frame of animation. The value of the byte is the palette to use in that corner.
Ice Beam pickup
PLM Pointer = $EEEF
At $84EEEF = [$EE64][$E189] < You want second pointer.
At $84E189 = [$8764][$8C00]
                   [$00,$03,$00,$00][$00,$03,$00,$00] < Palettes to use for each corner.

OK. Is it safe to assume that the palette range I can use is $00 - $0F...or would only $00 - $07 be available? Also, which palette set would that refer to? The first four palettes in a given set seem to be mostly the same, so that the doors can be colored properly.

That brings up another question about palettes, as well. The first four colors of the first four palettes in a given set appear to be the same for the doors, but the rest of those palettes differ per palette set. Can the rest of the palettes be modified so that I can use them?

Quote from: Scyzer on July 29, 2015, 08:48:34 PM
Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
4. I'd like to use a few patches in this project, the Screw Attack block being one of them. Would I be able to use SMILE to set Screw Attack BTS? If not, how would I go about doing this *shudder* manually?
As long as you know the BTS values and tiletypes required for any custom blocks, it's easy to set them in SMILE. You don't have to use the preset block types from the Special BTS in SMILE.

Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
5. The other patch I'd like to use is the graphics and palettes relocation. Can I do this and then modify SMILE so that it recognizes the new locations for each? Also, does this patch expand all graphics areas including CRE?
SMILE is coded to read the locations of the tilesets and palettes from the code in the ROM. You can safely move tilesets around and SMILE can read them.

That means these are safe for me to use and pretty easy to implement. Thanks for verifying that!

Quote from: Scyzer on July 29, 2015, 08:48:34 PM
Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
6. Without checking again to get details, it seems there's some issues with manipulating the Ceres Station's tileset and having it show up properly in the game. Can anyone provide details to what can be done to change that tileset successfully? I know I saw a thread discussing this, but I don't know if a definitive answer was given. I'll look through the threads again and edit this question if it has already been answered.
The Ceres area itself is coded to not display any CRE tilesets, so the SCE tilesets are shifted to fill this space. The Ceres tilesets can be used normally in any area that is not Ceres. You can easily use the Ceres tileset normally in any room, but you cannot change the area to/from Ceres after building a room without having to remake it after.

The exception are the Mode 7 tilesets in Ceres, which are room specific and cannot be edited properly within SMILE (you can edit them in SMILE RF).

I've seen mention of SMILE RF a few times now. I have SMILE 2.5 and SMILE JX 2.83, but I haven't seen SMILE RF yet. Can I find it in the forums?

Quote from: Scyzer on July 29, 2015, 08:48:34 PM
Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
7. Can you place Layer 1 tiles as air tiles and have them show up behind a door bubble, so that it doesn't look like the background just cuts off? This might be a variation on question 1; if so, I apologize.
The SNES has 4 layers. Layer 1 and 2 are used by tiles. Layer 3 is used by FX. Layer 4 is not used at all. The door bubble uses layer 1, so you need to place your background tiles on layer 2 under the door to make the background not cut off. Layer 2 will show up through the transparent sections of layer 1 (with normal tile priority anyway).
And no, you cannot make SM use the 4th layer. It would be easier to create a new SNES game from scratch.

Good to know about the layers and what uses them. Also about Layer 4 not being usable. I should be able to do most of what I need with this. Thanks again!

Quietus

Quote from: shadedmagus on July 30, 2015, 01:44:49 AMSo if I can put tiles on Layer 2, does that conflict with any present scrolling backgrounds then? I know the save rooms use only tiles for their backgrounds, but most other rooms use the scrolling backgrounds. If I can put tiles on both layers AND use the scrolling background, that would be perfect!
It's either / or, though either can scroll.

Quote from: shadedmagus on July 30, 2015, 01:44:49 AMThat brings up another question about palettes, as well. The first four colors of the first four palettes in a given set appear to be the same for the doors, but the rest of those palettes differ per palette set. Can the rest of the palettes be modified so that I can use them?
You can change all of the colours, including those, though those ones will affect CRE stuff too, so go steady.

Quote from: shadedmagus on July 30, 2015, 01:44:49 AMI've seen mention of SMILE RF a few times now. I have SMILE 2.5 and SMILE JX 2.83, but I haven't seen SMILE RF yet. Can I find it in the forums?
Yes, it's here. :^_^:

shadedmagus

Quote from: Scyzer on July 29, 2015, 08:48:34 PM
Quote from: shadedmagus on July 29, 2015, 07:56:06 PM
3. Is there a way to make the upgrade/expansion item PLMs use a different palette than CRE 0? Working within that palette for detail is not ideal, but I've already got satisfactory changes for those tiles in place if it isn't possible.
If it's a PLM who's graphics are in the tileset, simply change the palette used by the tile. If the graphics are uncompressed in ROM, locate the PLM header and go to it's location in bank $84. 2 pointers are found. You want the second pointer. Follow it in the same bank. You should see [$8764][XXXX] (X is the pointer to the graphics in the ROM). The 8 bytes following that will be between 00 and 03. Each byte represents a corner of the tile: Top left > top right > bottom left > bottom right, then again for the second frame of animation. The value of the byte is the palette to use in that corner.
Ice Beam pickup
PLM Pointer = $EEEF
At $84EEEF = [$EE64][$E189] < You want second pointer.
At $84E189 = [$8764][$8C00]
                   [$00,$03,$00,$00][$00,$03,$00,$00] < Palettes to use for each corner.

I missed the part I bolded when I responded to this answer the first time, so don't mind my responding question about what values would be available. So you can use the first four palettes (the CRE colors, essentially) in the palette set of the room the PLM is located in, but not the rest, nor - I presume - a different palette set than the one the room is using.

That's still better than those sixteen colors in CRE 0 which are all over the place. I guess I can work with that.  :grin:

shadedmagus

#5
Quote from: Quietus on July 30, 2015, 04:38:20 AM
Quote from: shadedmagus on July 30, 2015, 01:44:49 AMSo if I can put tiles on Layer 2, does that conflict with any present scrolling backgrounds then? I know the save rooms use only tiles for their backgrounds, but most other rooms use the scrolling backgrounds. If I can put tiles on both layers AND use the scrolling background, that would be perfect!
It's either / or, though either can scroll.

So my options for creating a room's background are:
  • Layer 1 air tiles, which can be used along with Layer 2 tiles or scrolling backgrounds, but can't be stacked
  • Layer 2 static tiles, which can be stacked with Layer 1 air tiles, but can't coexist with scrolling backgrounds
  • Scrolling backgrounds, which can't coexist with Layer 2 tiles
  • Sprites (like Reflec?), which can be stacked regardless of the room properties
Does that sound right?

Quote
Quote from: shadedmagus on July 30, 2015, 01:44:49 AMThat brings up another question about palettes, as well. The first four colors of the first four palettes in a given set appear to be the same for the doors, but the rest of those palettes differ per palette set. Can the rest of the palettes be modified so that I can use them?
You can change all of the colours, including those, though those ones will affect CRE stuff too, so go steady.

Good to know, since some of the palette sets have the same color set for six values beyond the door colors. Glad I'll be able to reclaim them for my purposes!

Quote
Quote from: shadedmagus on July 30, 2015, 01:44:49 AMI've seen mention of SMILE RF a few times now. I have SMILE 2.5 and SMILE JX 2.83, but I haven't seen SMILE RF yet. Can I find it in the forums?
Yes, it's here. :^_^:

Wow, this looks pretty cool! I am somewhat familiar with SMILE, so hopefully this won't be too jarring. It reminds me of GIMP and its toolbars. I'll take it for a spin. Thanks for linking it, Quietus!

Quietus

For the layers thing, you're close. :^_^:

Layer one is always layer one, and is made of tiles. Layer two can either be tiles or a set background, which is built elsewhere, and selected via a pointer. Whichever you use, you can have them scroll. What you set as air, solid, etc. is separate again, and is achieved via BTS. For example, you can build a massive wall, using tiles on both layers, but set them to air, and walk straight through it. Layer three is used for effects most commonly things like water or acid, and is usually in front of everything else.

On a slightly related note, you can choose whether you want your tiles (on either later) to appear in front of Samus or behind her in the graphics editor.

shadedmagus

Quote from: Quietus on July 30, 2015, 10:20:13 AM
For the layers thing, you're close. :^_^:

Layer one is always layer one, and is made of tiles. Layer two can either be tiles or a set background, which is built elsewhere, and selected via a pointer. Whichever you use, you can have them scroll. What you set as air, solid, etc. is separate again, and is achieved via BTS. For example, you can build a massive wall, using tiles on both layers, but set them to air, and walk straight through it. Layer three is used for effects most commonly things like water or acid, and is usually in front of everything else.

On a slightly related note, you can choose whether you want your tiles (on either later) to appear in front of Samus or behind her in the graphics editor.

So you can set individual Layer 1 tiles to appear in front of Samus or behind her, in the same room?? Fantastic! I think that solves some of the headache I was preparing to have on how to present background map elements while still having a scrolling background, regardless of being a set background or scrolling Layer 2 tiles.

I know this won't help if I want to have foreground and background tiles in the same spot, but this is an incentive to do something similar, just in different spots.

I think that's all the questions I had for now. It's going to be a while until I'm done with mocking up the rooms and ready to start making changes, so I'll probably need to start a new thread if I run into any problems.

Thanks all!

Quietus

Quote from: shadedmagus on July 30, 2015, 06:13:49 PMSo you can set individual Layer 1 tiles to appear in front of Samus or behind her, in the same room?? Fantastic!
Yes, and to be even more specific, you can have each of the four 8x8 tiles that comprise a 16x16 tile appear in front or behind within a single tile, so halves and quarters are very much possible too. :^_^: