News:

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

Main Menu

[SM] [TILES] Tilemap editing question

Started by Damski, March 07, 2012, 02:41:20 PM

Previous topic - Next topic

Damski

I made a new topic because I did not want to post triple time in that enemy frame topic. I have some question for Tilemaps editing.. and here are JAM tilemaps tutorial.


--------------------------
8. You can also edit the tilemap. To do it, read this doc  http://metroidconstruction.com/docs/RaccoonSamTitleScreenArray.txt . Format is the same. Tile number is offset from Enemy Tiles pointer. Again, look for it in SMILE. For the Waver, it is AE8600 (8600 in bank AE or 170600). Just open TLP at this offset and you'll see the tiles. View format should be SNES. To get the correct palette, extract it from SMILE and Load in TLP.

This is enough to edit tilemaps for normal enemies that having Normal GFX (Not Special GFX like Space Pirates, their tilemap is complex).

9. Repeat steps 4-8. There are maybe a few Instruction pointers in Initiation AI.

A. Find Running AI pointer (or pointers). Again in DNA.

--------------------------------


Here is my question

1. Can i make more tileset for beams sprites?

2. Why i need find instruction pointer for tilemaps edit?

3. What i do with running ai pointer? Does it work the same way as Instruction pointer?

4. what is the difference between this and Sadiztyk Fish Rundown for Enemy Tilemaps? Is this easier tutorial?

JAM

Quote from: Damski on March 07, 2012, 02:41:20 PM
1. Can i make more tileset for beams sprites?
Wait just a few days to get a an official release of beam guide. However, you're limited to use 8 different tiles for every type of beam. I mean, 8 different tiles including it's charged form while beam can consists of any amount of tiles (like long Wave + Plasma beam)


Quote from: Damski on March 07, 2012, 02:41:20 PM
2. Why i need find instruction pointer for tilemaps edit?
If you know exact address of certain tilemap, you don't need to. But to collect all tilemap pointers you'll have to search in instruction array. See my reply to your 4th quection.

Quote from: Damski on March 07, 2012, 02:41:20 PM
3. What i do with running ai pointer? Does it work the same way as Instruction pointer?
Nope, it works the same way as Initiation AI. Running AI is a code executed every frame when enemy is alive. Sometimes instruction pointer is changed in this code.

Quote from: Damski on March 07, 2012, 02:41:20 PM
4. what is the difference between this and Sadiztyk Fish Rundown for Enemy Tilemaps? Is this easier tutorial?
This one helps to find all tilemaps when looking at enemy code. If you're skilled enough, you can find all of them quickly. But you will not be able to know which tilemap is used for certain action until modifying it.

As for Sadiztyk Fish's tutorial, you'll have to make enemy ALL possible moves to get pointers to all tilemaps (like for Zoomer, make it crawl, take a pointer, make it crawl, take a pointer etc. Then let it climb the left wall and make every crawl move, same for ceiling and right wall). But you'll know for sure which tilemap is used for certain action.

Damski

#2
Quote from: JAM on March 09, 2012, 12:32:10 AM


Im very sorry to bother you again.. but i have 3 and final question about this.

1. This is maybe very stupid question.

- If i want add new tilemaps.. Do i put values into pointers of enemy to see effect?

- What is XX/YY.. It is 00 00?

- If i want find some values in banks.. why i must put 11 number front of value?



Quote from: JAM on March 09, 2012, 12:32:10 AM


Wait just a few days to get a an official release of beam guide. However, you're limited to use 8 different tiles for every type of beam. I mean, 8 different tiles including it's charged form while beam can consists of any amount of tiles (like long Wave + Plasma beam)

Sounds very good!


JAM

#3
Quote from: Damski on March 09, 2012, 05:45:53 AM
Im very sorry to bother you again.. but i have 3 and final question about this.
It's OK =)

Quote from: Damski on March 09, 2012, 05:45:53 AM
- If i want add new tilemaps.. Do i put values into pointers of enemy to see effect?
Replace existing values. But make backups as usual. If you see 01 00 88 99, try to find free space in the same bank and then (if free space starts at FF00), change 88 99 to 00 FF and write tilemap at FF00 of current bank. Remember, it's just an example.

Quote from: Damski on March 09, 2012, 05:45:53 AM
- What is XX/YY.. It is 00 00?
Ahem. Where did you see XX/YY? Add a quote please.

Quote from: Damski on March 09, 2012, 05:45:53 AM
- If i want find some values in banks.. why i must put 11 number front of value?
It's just an example. Bank $A3 is located from 118000 to 11FFFF. Bank $A2 -- from 110000 to 117FFF. So, A3:FEDC = 11FEDC and A2:8123 = 110123. Read more here


Crashtour99

Quote from: Damski on March 09, 2012, 05:45:53 AM
- What is XX/YY.. It is 00 00?

If you mean for the actual tilemaps themselves then:
Each tilemap is 5 bytes, and every 8x8 or 16x16 is technically considered a sprite all it's own.
So for a tilemap (this one is for botwoon)
$B3/E499   
02 00                 ;2 tilemaps
F8 81 F8 26 01    ;tilemap 1
F8 81 E8 24 01    ;tilemap 2

So, as you can see the xx/yy for tilemap 1 are F8/F8.  These are vertical/horizontal pixel adjustments for where the sprite is placed relative to the center of the enemy.  So a positive value (00-7F) would move the sprite down/right while a negative value (7F-FF) would move the sprite up/left.
So for tilemap 1, an xx/yy of F8/F8 means: locate the top left corner of the sprite 8 pixels up and left from the center of the enemy.

Damski

Quote from: Crashtour99 on March 09, 2012, 12:53:40 PM

- What is XX/YY.. It is 00 00

If you mean for the actual tilemaps themselves then:
Each tilemap is 5 bytes, and every 8x8 or 16x16 is technically considered a sprite all it's own.
So for a tilemap (this one is for botwoon)
$B3/E499   
02 00                 ;2 tilemaps
F8 81 F8 26 01    ;tilemap 1
F8 81 E8 24 01    ;tilemap 2

So, as you can see the xx/yy for tilemap 1 are F8/F8.  These are vertical/horizontal pixel adjustments for where the sprite is placed relative to the center of the enemy.  So a positive value (00-7F) would move the sprite down/right while a negative value (7F-FF) would move the sprite up/left.
So for tilemap 1, an xx/yy of F8/F8 means: locate the top left corner of the sprite 8 pixels up and left from the center of the enemy.

So if i want move one tilemap up i put  7F 81 7F 26 01 value?





Quote from: JAM on March 09, 2012, 08:55:13 AM
more here[/url]

Thank you JAM!

Crashtour99

Not quite.

It's easiest to start out with your xx/yy as 00/00 so that it's on the center of your enemy. 

From there, if you want to move the tile down or right, you simply add the number of pixels you want to move it to your xx/yy.  So to move it down by 8 pixels, it would be 00/08.  Down by 16 pixels and right by 8 would be 08/10.

To move it up or left, you need to subtract, starting from 00/00.  So to move it up by 8, you would have 00/F8.  To move it up by 16 and left by 8, you would have F8/F0. 

And of course you can use positive and negative numbers together for your pixel adjustments.  So if you need to move it up by 16 pixels and right by 16 pixels, you'd have 10/F0.

It takes a bit of getting used to, but once you've got it you'll breeze through.

Damski

#7
Quote from: Crashtour99 on March 10, 2012, 05:48:48 PM
Not quite.
]It's easiest to start out with your xx/yy as 00/00 so that it's on the center of your enemy. 

From there, if you want to move the tile down or right, you simply add the number of pixels you want to move it to your xx/yy.  So to move it down by 8 pixels, it would be 00/08.  Down by 16 pixels and right by 8 would be 08/10.

To move it up or left, you need to subtract, starting from 00/00.  So to move it up by 8, you would have 00/F8.  To move it up by 16 and left by 8, you would have F8/F0. 

It takes a bit of getting used to, but once you've got it you'll breeze through.

So those value are for moving enemy tilemaps?..Which values ​​are those that make more tilemaps for enemy? Or does every enemy have a different value?

If i want edit tilemaps do i go search them from enemy Runnin Ai poiner or Initiation AI?

Crashtour99

Quote from: Damski on March 13, 2012, 03:12:26 AM
So those value are for moving enemy tilemaps?..Which values ​​are those that make more tilemaps for enemy? Or does every enemy have a different value?

If i want edit tilemaps do i go search them from enemy Runnin Ai poiner or Initiation AI?

The tilemaps themselves are pointed to from the Graphic AI (that big table between the enemy palette and the Initiation AI, that is made of frame delays followed by pointers).  How to get the Graphic AI was already discussed in your other topic here:
http://forum.metroidconstruction.com/index.php/topic,1964.0.html
so just reread that carefully.

As an example, I'll just post Zeb's full Graphic AI:
[spoiler]
Zeb Graphic AI structure table:
$B3/87AB 02 00 B7 89 ;tilemap
$B3/87AF 02 00 BE 89 ;tilemap
$B3/87B3 02 00 C5 89 ;tilemap
$B3/87B7 02 00 CC 89 ;tilemap
$B3/87BB 02 00 D3 89 ;tilemap
$B3/87BF 02 00 CC 89 ;tilemap
$B3/87C3 02 00 C5 89 ;tilemap
$B3/87C7 02 00 BE 89 ;tilemap
$B3/87CB ED 80 AB 87 ;return to 87AB

$B3/87CF 01 00 B7 89 ;tilemap
$B3/87D3 01 00 BE 89 ;tilemap
$B3/87D7 01 00 CC 89 ;tilemap
$B3/87DB 01 00 D3 89 ;tilemap
$B3/87DF 01 00 CC 89 ;tilemap
$B3/87E3 01 00 BE 89 ;tilemap
$B3/87E7 ED 80 CF 87 ;return to 87CF

$B3/87EB 02 00 DA 89 ;tilemap
$B3/87EF 02 00 E1 89 ;tilemap
$B3/87F3 02 00 E8 89 ;tilemap
$B3/87F7 02 00 EF 89 ;tilemap
$B3/87FB 02 00 F6 89 ;tilemap
$B3/88FF 02 00 EF 89 ;tilemap
$B3/8803 02 00 E8 89 ;tilemap
$B3/8807 02 00 E1 89 ;tilemap
$B3/880B ED 80 EB 87 ;return to 87EB

$B3/880F 01 00 DA 89 ;tilemap
$B3/8813 01 00 E1 89 ;tilemap
$B3/8817 01 00 EF 89 ;tilemap
$B3/881B 01 00 F6 89 ;tilemap
$B3/881F 01 00 EF 89 ;tilemap
$B3/8823 01 00 E1 89 ;tilemap
$B3/8827 ED 80 0F 88 ;return to 880F
[/spoiler]

So, if we take a look at the very start of Zeb's Graphic AI, we see:
$B3/87AB   02 00 B7 89
This means that for that frame of animation, it will display for 0002 frames the tilemap at 89B7 (remember that each pair of bytes is reversed, and 2 byte pointers will always be in the same bank, so 89B7 means $B3/89B7).

Now we take a look at whatever is at $B3/89B7 and we see:
$B3/89B7   01 00 F8 81 F8 00 21
For ease of understanding let's cut this into smaller pieces.
01 00 - means display 0001 tilemaps (8x8 or 16x16 pixel image)
F8     - shift displayed tile left by 8 pixels
81     - use 16x16 pixel tile
F8     - shift displayed tile up by 8 pixels
00     - tile to use (a value of 00 means use the very first tile at the graphics location given in the enemy header (graphics location can be easily found in SMILE's Enemy Editor in the DNA section))
21     - palette, layer, priority, and other stuff.

Now, if we wanted to have the enemy display more graphics (multiple tiles) for this frame of animation we would have to repoint.  So first we would have to find a bit of freespace in that enemy's bank.  For Zeb's bank (bank $B3) freespace starts at $B3/ED77.  Just so we have all our info together:
$B3/87AB   02 00 B7 89  (0002 frames for tilemap 89B7)
$B3/89B7   01 00 F8 81 F8 00 21  (0001 tilemaps, followed by the actual tilemap (5 bytes))
So to repoint we change the data at $B3/87AB to something like this:
$B3/87AB   02 00 77 ED  (0002 frames for repointed tilemap at ED77)
Then at $B3/ED77 we would write our new tilemaps.
$B3/ED77   
01 00       - change 0001 to however many tiles you want to display
F8 81 F8 00 21  - you can now change the xx/yy adjustments, change the tile displayed, change it from 16x16 to 8x8 if you like, etc.   If you want to display more tiles, just add another 5 byte string (just remember to change the 0001 to however many 5-byte-strings you have).

Damski

#9
Quote from: Crashtour99 on March 13, 2012, 06:04:03 PM
Quote from: Damski on March 13, 2012, 03:12:26 AM
So those value are for moving enemy tilemaps?..Which values ​​are those that make more tilemaps for enemy? Or does every enemy have a different value?

If i want edit tilemaps do i go search them from enemy Runnin Ai poiner or Initiation AI?

Now we take a look at whatever is at $B3/89B7 and we see:
$B3/89B7   01 00 F8 81 F8 00 21


I understood this tutorial but i have little bit problem with offset..

I placed in offset value 1189B7 but i didn't find any of this value' 01 00 F8 81 F8 00 21


How do i know where Banks start and end?

Crashtour99

Each bank is always $8000 bytes ($8000-$FFFF), and start from bank $80. 

Personally I use a little program called Lunar Address to convert from SNES addressing ($B3/89B7) to PC addressing (1989B7).  I just find it easier to use it, rather than try and convert an address by hand or in my head so I can find it in a hex editor (and I'm too lazy to try and remember the conversion process or memorize it).

You can find Lunar Address on the main site, under the Tools section.

Damski

#11
Quote from: Crashtour99 on March 14, 2012, 03:00:52 AM
Each bank is always $8000 bytes ($8000-$FFFF), and start from bank $80. 

Personally I use a little program called Lunar Address to convert from SNES addressing ($B3/89B7) to PC addressing (1989B7).  I just find it easier to use it, rather than try and convert an address by hand or in my head so I can find it in a hex editor (and I'm too lazy to try and remember the conversion process or memorize it).

You can find Lunar Address on the main site, under the Tools section.

THANK you :)