øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;u=278;area=showposts;start=1050e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index2c3d.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;area=showposts;u=278e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index2c3d.html.zx×åg^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ0P.~fOKtext/htmlISO-8859-1gzip8:Ö~fÿÿÿÿÿÿÿÿTue, 10 Mar 2020 19:25:34 GMT0ó°° ®0®P®€§²ð®×åg^ÿÿÿÿÿÿÿÿC~f Show Posts - chillyfeez

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - chillyfeez

1051
Final Fantasy IV Research & Development / Re: Whose turn is it?
« on: November 07, 2013, 12:42:36 AM »
IT WORKS!
That was it - 7E390A. Somehow, setting that to 01 instead of the default 00 makes the game not reset the 08 timer status after the command is finished.
As a result, I now have a fully-functional Mime command! I'll clean up the code a bit tomorrow (I think I can cut out a few unneccessary commands) then post it for all to enjoy.
If there's any interest out there, I could make a patch that changes the game-crashing Dummy command into Mime. Would anyone want that? (I'll post the disassembly, too, of course)

1052
Final Fantasy IV Research & Development / Re: Whose turn is it?
« on: November 06, 2013, 05:21:17 PM »
Regen, too... as in, another command that sets an automatic next command? I bet that's part of the puzzle! Thanks for the info!

1053
Final Fantasy IV Research & Development / Re: Whose turn is it?
« on: November 06, 2013, 12:02:21 PM »
Do you happen to know the purpose of INC $390A?
Jump and charge both use that, too, but the RAM map in the Bab-il docs does not identify 7E390A. I have a day off tomorrow so I've resolved to figure it out then.

1054
Final Fantasy IV Research & Development / Re: Whose turn is it?
« on: November 06, 2013, 08:10:18 AM »
I've been referring heavily to your disassemblies for this process. I actually haven't tried changing Charge's 1F to see if it works with other commands. I'm kind of afraid to find out...

1055
Final Fantasy IV Research & Development / Re: Whose turn is it?
« on: November 06, 2013, 12:10:56 AM »
Hmm... seems I'm still missing a key portion of the Jump and Charge routines that causes the 08 timer status to stick after they return. Think I'm gonna have to test Charge command-by-command til I find it. Ah, well. I'll get there eventually. Really hope I can find the time sooner rather than later.

1056
Final Fantasy IV Research & Development / Re: Whose turn is it?
« on: November 04, 2013, 11:08:09 AM »
Made some exciting strides on this one!

Remember that byte 04 I was talking about? Well, if it's set to 08, then when the timer reaches zero, the character will do whatever action is in their "next [or most recent] action" byte.
You can test this out to see. Load your game in Geiger's and get into a battle. View RAM at 7E2A04. You'll see the counters. You'll have to perform an action with a character first. After that, their "charging status" byte will turn to 00 (it's the second byte after the timer). Change it manually to 08. When the timer reaches zero, the character will automatically perform that same action again.
Notice that both Jump and Charge/Boost/(whatever) contain these three commands in succession:
Code: [Select]
20 C8 85  JSR $85C8
A9 08     LDA #$08
9D 06 2A  STA $2A06,x
Well, subroutine 03/85C8 identifies which character to address in the duration table. Then the next two commands put 08, or "automatically perform 'next action,'" in the appropriate byte for that character.

Also, there is a table in ROM at A0189 that contains one-byte-per-command references to the duration set to perform each command. Most of them are 00, which is immediate. 01 is not one second, though. These are pointers. I haven't tested all 256 options (and probably won't) but the following are used:
00: (most commands) immediate
01: (Charge) 5 seconds
02: (Dark Wave, a few others) 2 seconds
04: (Salve, Aim) 1 second
FE: (not used, but I tested it to see if it would crash the game - it doesn't) several hundred seconds

I am nearly positive that with this knowledge, I have enough to make my Mime command! Might take a few days to get it working...

1057
Off topic, but relevant to the most recent post - I found a useful little tool on RHDN called the SNES ASM professional development kit http://www.romhacking.net/utilities/395/
While there is a definite algorithm for figuring ROM offsets based on LoROM and vice versa, using this is the quickest method I've found. Just punch a ROM address into its Goto and it jumps to the place in ROM, but with LoROM offsets. To go the other way, I usually just search for the first five bytes or so in my regular hex editor.
The ASM dev kit is useful too for writing custom code (its intended purpose) though not without its limitations. It has real trouble with 8/16 bit flags, and crashes if you enter aan ASM command that is invalid. Still, very useful thing to have in your hacking toolkit.

1058
Final Fantasy IV Research & Development / Re: Whose turn is it?
« on: November 01, 2013, 05:25:58 PM »
I'm not able to mess with it too much today, but my guess is that the timer isn't set until after the command takes place, so changing the value it starts at probably will require affecting the factors that determine that number instead of something as simple as setting the number within the instructions of a command (if that makes any sense).

1059
Final Fantasy IV Research & Development / Re: Whose turn is it?
« on: November 01, 2013, 11:58:03 AM »
Aha!
Found the hidden ATB gauge.

Turns out the Bab-il docs are wrong, or at least incomplete. They say that the data at 2A04-2A2A is "status duration data for each slot," and that 2A2B-???? is "poison data."
Well, some of this might be true, but here is what I've found out for sure...
Beginning at 2A05, there are 15 (hex)-byte records for each battle participant (beginning with the five party slots, then on to monsters). Byte 02 of this record counts down until it is time for the character/monster to do something. This counts for when he/she/it is ready to take a turn, or if casting, when he/she is ready to cast the spell. Everybody's timer counts down at the same rate, and the beginning number is higher depending on relative speed (or, presumably, casting duration of the spell).

More research and testing is needed before I can say that I can use this info in custom commands to force or delay an individual's turn, but it is definitely possible to do so by hand with Geiger's.

Also, byte 04 has something to do with what the character is doing during that wait. 80 is "waiting for command." 00 is either "defend," or simply "waiting for next turn." It seems having bit 0 set freezes the timer altogether, thus making the character unable to take a turn (which does not freeze the game, but appears to be permanent through the end of the battle.

Interesting stuff...

1060
Final Fantasy IV Research & Development / Re: Whose turn is it?
« on: October 30, 2013, 01:36:34 PM »
What I'm trying to be able to do is force (or delay) a single turn, without affecting the character/monster's speed otherwise. The end result would be a new attempt at making a Mime command (I can't just let this die) by using the Charging status from Yang's Charge ability, which sets a next action and a status that executes that action next turn. If I could force that next turn in the same command...
Well, that's the idea, anyway. The method's all worked out in my head, except I can't force the turn.
Of course the possibilities of what we could do with this wouldn't end there... wasn't there a Charge command in FFV that made all party members attack? We could do something like that, too. Maybe even an X-Magic...

1061
Final Fantasy IV Research & Development / Whose turn is it?
« on: October 30, 2013, 09:55:27 AM »
Does anybody have any insight into how the game determines when a character's turn comes up in battle?
I imagine it makes calculations based on the Relative Speed values, but based on the fact that there will be times in battle when nobody is doing anything, it can't just be a turn queue (like in FFX or FFT).

So I imagine there must be timers counting down to each character's turn... anybody know where in RAM those are? Or have an idea about how to start looking for them?

Or maybe I'm totally off base and turns are determined some other way?

1062
Final Fantasy IV Research & Development / Re: Fun with Summons
« on: October 26, 2013, 01:07:24 PM »
So now we have a summon-able Shadow, but he does not cast the right spell. Total bummer. You might think that the easy fix to this would be to simply change the AV properties of Imp to match those of Demolish. Well this works... sort of... not really. Shadow will appear and cast Demolish, but then he will not disappear. Worse still, if the battle isn't over by the end of your very next attack, the game will be frozen. This is because the instructions to make the summoned monster disappear and make the party reappear are included in the AV routine of the summon spell.

I've devised two different ways to fix this problem - the quick-and-easy way, and the slightly-longer-but-also-with-a-prettier-result way.

When you summon Imp, this is the AV routine the game executes (after the monster appears):
Code: [Select]
(4D Imp)
$02/EB54 9C 2B F4    STZ $F42B  [$7E:F42B]   
$02/EB57 6C 00 00    JMP ($0000)[$02:EE5B]   ;$0000 will be set to a different location based on what value is set for the spell's AV Sequence
$02/EE5B A0 80 E3    LDY #$E380             
$02/EE5E 20 2E EE    JSR $EE2E  [$02:EE2E]   
$02/EE61 22 71 F3 01 JSL $01F371[$01:F371]   ;this is the jump to the actual AV sequence
$02/EE65 4C 89 BE    JMP $BE89  [$02:BE89]   
$02/BE89 20 04 E7    JSR $E704  [$02:E704]   
$02/BE8C AD 5A F3    LDA $F35A  [$7E:F35A]   
$02/BE8F F0 17       BEQ $17    [$BEA8]     
$02/BE91 A9 FF       LDA #$FF               
$02/BE93 8D 20 F3    STA $F320  [$7E:F320]   ;this makes the summoned monster disappear
$02/BE96 20 76 F2    JSR $F276  [$02:F276]   
$02/BE99 20 13 85    JSR $8513  [$02:8513]   
$02/BE9C 20 34 C7    JSR $C734  [$02:C734]   
$02/BE9F 9C 5A F3    STZ $F35A  [$7E:F35A]   
$02/BEA2 9C 20 F3    STZ $F320  [$7E:F320]   ;this makes the party reappear
$02/BEA5 20 52 C7    JSR $C752  [$02:C752]   
$02/BEA8 60          RTS                     

You will NEED to use Geiger's SNES9x Debugger in order to perform either method, and Ff4kster is recommended, too.

OK, the Quick-and-Easy way:
Figure out which summon spell you want to replace (in this example, (4D) Imp, but this will work for all summons). We'll call this the "Source" spell for the sake of consistency in this tutorial. And which summon spell you want to replace it with (in this example, Demolish). We'll call this the "Target" spell.
-Set a breakpoint to when the game executes $2EB54.
-Cast the Source spell
-At the break, click Jump Over until you see a "JSL" instruction
-Record this instruction - it will be four bytes, "22 XX XX XX"
-Keep the breakpoint set
-Cast the Target spell
-Again, at the break, Jump Over until you see a JSL
-Record this instruction
-Replace the JSL in the Source spell with the JSL of the Target spell
The result (in the case of Imp -> Shadow) will look like this (the difference is at $02/EE61):
Code: [Select]
(4D Imp)
$02/EB54 9C 2B F4    STZ $F42B  [$7E:F42B]   
$02/EB57 6C 00 00    JMP ($0000)[$02:EE5B]   ;$0000 will be set to a different location based on what value is set for the spell's AV Sequence
$02/EE5B A0 80 E3    LDY #$E380             
$02/EE5E 20 2E EE    JSR $EE2E  [$02:EE2E]   
$02/EE61 22 B9 F3 01 JSL $01F3B9[$01:F3B9]   ;this is the jump to the actual AV sequence
$02/EE65 4C 89 BE    JMP $BE89  [$02:BE89]   
$02/BE89 20 04 E7    JSR $E704  [$02:E704]   
$02/BE8C AD 5A F3    LDA $F35A  [$7E:F35A]   
$02/BE8F F0 17       BEQ $17    [$BEA8]     
$02/BE91 A9 FF       LDA #$FF               
$02/BE93 8D 20 F3    STA $F320  [$7E:F320]   ;this makes the summoned monster disappear
$02/BE96 20 76 F2    JSR $F276  [$02:F276]   
$02/BE99 20 13 85    JSR $8513  [$02:8513]   
$02/BE9C 20 34 C7    JSR $C734  [$02:C734]   
$02/BE9F 9C 5A F3    STZ $F35A  [$7E:F35A]   
$02/BEA2 9C 20 F3    STZ $F320  [$7E:F320]   ;this makes the party reappear
$02/BEA5 20 52 C7    JSR $C752  [$02:C752]   
$02/BEA8 60          RTS                     
Note that this will only change the animation and the sound effect. you still have to change the sprites of (4D)Imp to match those of Demolish, and if you want to change the sound effect for some reason, you still need to change Demolish's sound effect.

So this works, and is a perfectly fine fix to the problem at hand. What I noticed, though, is that it eliminates the part of the summon where the monster moves forward, blinks and moves backward again. Apparently, those instructions are built into Imp's "actual" AV routine, so I dug a bit deeper and figured out...

The slightly-longer-but-also-with-a-prettier-result way

Here is  a deeper disassembly of Imp's AV routine:
Code: [Select]
Main Routine
$01/F371 20 A1 FD    JSR $FDA1  [$01:FDA1]   Move Forward
$01/F374 20 17 F3    JSR $F317  [$01:F317]   Move a little more forward, "attack" (blink like a monster attacking)
$01/F377 20 CF E9    JSR $E9CF  [$01:E9CF]   (unknown)
$01/F37A 20 67 F3    JSR $F367  [$01:F367]   Spell animation
$01/F37D 20 B1 FD    JSR $FDB1  [$01:FDB1]   Move backward
$01/F380 6B          RTL     

Move Forward
$01/FDA1 A2 08 00    LDX #$0008              Change this value to change how far forward Imp moves (Higher value, farther movement)
$01/FDA4 20 09 EE    JSR $EE09  [$01:EE09]   Essentially, move one pixel forward
$01/FDA7 CE 21 F3    DEC $F321  [$7E:F321]   
$01/FDAA CE 21 F3    DEC $F321  [$7E:F321]   
$01/FDAD CA          DEX                     
$01/FDAE D0 F4       BNE $F4    [$FDA4]
$01/FDB0 60          RTS                   

Move a little more forward, "attack" (blink)
$01/F317 64 4E       STZ $4E    [$00:004E]   
$01/F319 20 09 EE    JSR $EE09  [$01:EE09]   Same "move one pixel forward" subroutine, except here it causes the blinking, too
$01/F31C A5 4E       LDA $4E    [$00:004E]   
$01/F31E 29 04       AND #$04               
$01/F320 4A          LSR A                   
$01/F321 4A          LSR A                   
$01/F322 D0 05       BNE $05    [$F329]     
$01/F324 A9 34       LDA #$34               
$01/F326 4C 2B F3    JMP $F32B  [$01:F32B]   
$01/F329 A9 38       LDA #$38               
$01/F32B 8D 30 F3    STA $F330  [$7E:F330]   
$01/F32E E6 4E       INC $4E    [$00:004E]   
$01/F330 A5 4E       LDA $4E    [$00:004E]   
$01/F332 C9 10       CMP #$10               
$01/F334 D0 E3       BNE $E3    [$F319]     
$01/F336 A9 38       LDA #$38               
$01/F338 8D 30 F3    STA $F330  [$7E:F330]   
$01/F33B 60          RTS             

Spell Animation
$01/F367 A9 20       LDA #$20               
$01/F369 8D C2 F0    STA $F0C2  [$7E:F0C2]   
$01/F36C 22 D6 F9 02 JSL $02F9D6[$02:F9D6]   If you want to keep the summoned monster's movement but change the animation, change the JSL here
$01/F370 60          RTS 

Move Backward
$01/FDB1 A2 08 00    LDX #$0008              Change this value to change how far Imp moves backward
$01/FDB4 20 09 EE    JSR $EE09  [$01:EE09]   Same subroutine again controls backward movement. I took a cursory look, but I can't understand how.
$01/FDB7 EE 21 F3    INC $F321  [$7E:F321]   
$01/FDBA EE 21 F3    INC $F321  [$7E:F321]   
$01/FDBD CA          DEX                     
$01/FDBE D0 F4       BNE $F4    [$FDB4]     
$01/FDC0 60          RTS   

Slightly off-topic here... you can change how far forward and backward Imp/Shadow moves by changing those LDX values, but beware that other summons use the same subroutines. Cockatrice uses both the Move Forward and Move Backward instructions, and Bomb uses the Move Forward. They may be used by others as well. I have not fully tested.

Anyway, the key here is within the Spell Animation subroutine. Again, there is a JSL that jumps to an AV routine. If you want to change the spell animation without bastardizing the rest of the summon animation, this is the JSL that you want to change to that of Demolish.

And there you have it!

I'm pretty sure I have now imparted all knowledge I have about editing summons. Grimoire LD mentioned in another thread recently that other summon animation instructions are affected by changing the spell's AV "effects." I haven't done any research on this yet, though, and I think I'm going to take a break from Summon research at least for a while.

As previously stated, let me know if there's any points here that need clarification. For those of you who have been following along, sorry that what I originally thought would be a "week or so" ended up taking me about 2 1/2 weeks. I guess I really had no idea how long this process would take to explain. This will be the last formal tutorial on this thread, at least for a long while.
 :sleep:

1063
Final Fantasy IV Research & Development / Re: Fun with Summons
« on: October 25, 2013, 09:06:09 AM »
First of all, make sure you're viewing in SNES 3BPP (eight colors), then make the first color in the palette white, and the second color black. That should help quite a bit.
Another Tile Layer tip - some banks of monster sprite data are not aligned with others. For instance (and definitely good to know here), if you are viewing the summon images and you scroll up to where Shadow is, it won't display properly. That's because you'll be off-set by eight bytes. If you hold ctrl and use the left and right arrow keys, you can advance the data by one byte. So do that eight times. If the monster images you need are still not displaying right, do it eight more times. (Note that you won't have to do this if you jump right to the proper address by calculating it using the pointer)
Also, using the arrow keys without ctrl will advance data by one sprite (18 hex bytes), and holding shift and using the arrow keys will scroll through palettes (I don't know how it decides what palettes to use, but it will store your custom palettes).

1064
Final Fantasy IV Research & Development / Re: Fun with Summons
« on: October 23, 2013, 02:05:16 PM »
Alright, here it is...
Turning Imp into Shadow

First thing to do is round up the necessary data. We'll need:
  • Shadow's rectangular size
  • Shadow's Palette
  • The beginning address of Shadow's sprite data

So of course, we'll first reference the table at 7CC00 to find this info. Shadow's entry (From the Bab-il docs) reads:
08 B5 A8 99
So,
Size 08
Pallette B5
Graphical pointer 99A8

Next, we reference the size table and find the ninth size (00 is the first), which is 06 0C. Now, remember that Summon image sizes are defined as a rectangle of 2x2 tiles, not sprites, so we'll need to cut these numbers in half to define summoned Shadow's size: 03 06

Next we'll take the graphical pointer to determine the beginning of Shadow's sprite data.
99A8 * 8 + 8200 = 4CD40 + 8200 = 54F40
(fyi - if you don't like math, you could just open Tile Layer and scroll through monster images until you find Shadow)

So, we have...
Size: 03 06
Palette: B5
Sprite data: 54F40

Notice anything about that sprite data address?
If you said, "it's less than 60200 and therefore impossible to point to," you win!
As I believe I've mentioned before, enemy monster graphical pointers are more versatile than those of summoned monsters, because the enemy monster's pointer is multiplied by 8. In fact, the only monsters that can be summoned without making major data changes are the original summoned monsters, CPU (and its li'l buddies), Zemus, and Zeromus (initial form). All other monsters' image data is earlier than 60200.

The fix? Copy the desired sprite data into an empty space that is higher than 60200 (and less than 70200).
Now, it just so happens that there is a huge block of empty data just after the end of Asura that can be used for this purpose.

(it's the red stuff)

This block is large enough to copy the image data of any monster (including EvilWall!), with the possible exception of final-form Zeromus. So, easiest thing to do is open up two instances of your ROM in Tile Layer, go to the empty block in one, and to Shadow in the other, then just copy and paste.


Next, we need to point to this new image location. In my version, I copied the image data to 6EB20.
So: 6EB20 - 60200 = E920
My pointer will read 20 E9.
So, at 689F0, change the "18 88" to 20 E9.

Next quick little step is to change the palette.
Shadow's palette is B5, so change the "00" at 7004C to B5.

Next, we jump to 9FC59 in our hex editor to define Shadow's size.
the first entry in this table (which belongs to Imp) is:
C8 44 02 02
The first two bytes refer to the summoned monster's beginning x and y position (with 00 00 being the top left corner). We will need to change this, but there's really no way of knowing the right values without a little trial and error, so leave this for now. The latter two bytes, 02 02, are Imp's size. Change these to 03 06, as previously determined. Now we have:
C8 44 03 06
Leave this as-is for now.

Now we get to the... erm... fun part.
It's time to start arranging tiles. Shadow, as we've already determined, is 3x6 tiles. If it was 3x3, we could just go
04 02 00 24 22 20 44 42 40 64 62 60
and call it a day.
But since Shadow is taller than that, we have to be a bit creative. You see, the next row in this pattern would be numbered 8x, and remember, sprites cannot be numbered higher than 7F. So instead, we will have two rows each of 0xs, 2xs, and 4xs.
In the end, our tile arrangement will look like:

Which will be written out left-to-right, top-to-bottom:
Code: [Select]
04 02 00 0A 08 06 24 22-20 2A 28 26 44 42 40 4A
48 46
Seems so simple when you put it that way, right? Wait! Do not just overwrite Imp's tile arrangement with this one. First of all, Imp shares a tile arrangement with Bomb and Chocobo, so changing one will change all. Secondly, this is a longer arrangement, so it will write over other arrangements as well. So what to do? Change Imp's arrangement pointer to point to another empty block of data. We're actually going to use the same empty block we used for Shadow's sprites. We used up a good deal of it for the sprite data, but there's still plenty of it left for what we're doing now. In case you're making a larger summon (like, say, EvilWall) and need more space, there's also a big empty block at 68448 (though in all, it's not quite as big as the one we're using now).
So anyway, I chose to place Shadow's tile arrangement at 6F3B0, so we also have to change Imp's pointer (6F860) to B0 F1 (6F3B0 - 60200 = F1B0).

Once your tile arrangement is set - and because we're dealing with a standard-size monster, the sprite arrangement is easy. Given what our tile arrangement looks like, our sprite arrangement will look like this:


Then, we'll just write that out in order, right-to-left (remember, this is backwards), top-to-bottom:
Code: [Select]
00 01 02 03 04 05 10 11-12 13 14 15 06 07 08 09
0A 0B 16 17 18 19 1A 1B-20 21 22 23 24 25 30 31
32 33 34 35 26 27 28 29-2A 2B 36 37 38 39 3A 3B
40 41 42 43 44 45 50 51-52 53 54 55 46 47 48 49
4A 4B 56 57 58 59 5A 5B
Just as before, we can't just overwrite Imp's data, so we're going to use some more of that big empty block. I chose to place the sprite arrangement at 6F3E0, so we have to change Imp's sprite arrangement pointer (6F460) from 82 F2 to E0 F1 (6F3E0 - 60200 = F1E0).

So that's mostly it. We still need to change the x,y location where Shadow appears, but the only way I know of doing that is by toying around with it until it looks right. That location in ROM, 9FC59, translates to 13FA59 in LoROM. It's probably easiest to tinker in-game. The values I chose were A8 24.

Of course, now you have this badass Shadow Dragon to summon... who then executes a goblin punch.
Next post, I'll discuss how to change Imp's goblin punch into Shadow's Demolish attack.
Again, let me know if any of this needs clarification. Otherwise, til next time!



1065
Final Fantasy IV Research & Development / Re: Fun with Summons
« on: October 17, 2013, 11:30:26 PM »
Alright, here we go...
How to change Imp into Shadow

The first thing to know is that there really are very few similarities between how enemy monster sprites are arranged and how summoned monster sprites are arranged.
Enemy monsters are given a defined rectangle, then the sprites are filled in either in order or out of order, and with or without empty spaces, as specified.
There's an extra step for summoned monsters. Summoned monsters are assigned a rectangular space, then are assigned an arrangement of 2-sprite x 2-sprite tiles (in or out of order, and some of which can themselves be empty spaces as specified), then those tiles are filled in with sprites and/or empty spaces in order or out of order as specified.
So Imp's image is first defined as an arrangement of tiles within a given rectangle - specifically, a "2x2" rectangle (that's 2-tiles x 2-tiles, not sprites), which looks like this:


Then, within those tiles, a sprite arrangement is specified:


A few points worth mentioning here.
Notice that these arrangements all seem to work in reverse order. This is related to the fact that a summon's image is inverted over the y-axis (because it's on your side, not the enemy's). When visualizing your summon image, it may help to imagine what it would look like if you were attacked from behind - or if you were fighting against it.

In the game's original programming, all Summon image tiles are numbered with ones and tens places as multiples of 2. The enumeration of the tile tells the game where to display the sprites in a sprite arrangement. Sprite 00 will always appear in the top right corner (unless back-attacked) of tile 00. If there is no tile 00, sprite 00 will not appear. Tile XY will always contain sprites XY, XY+1, X+1Y, and X+1Y+1.

There is no restriction, by the way, that says "the top row of tiles must only be numbered 0x, the second row must be numbered 2x, etc."
Hypothetically, Imp's tiles could be arranged like this:


The resulting summon would appear like so:

This is important to know when creating larger summon images, because sprites in a summon image can only be numbered 00-7F. Anything 80 or higher will represent an empty space in the place of itself minus 80.
The application is - when you're trying to summon a monster that's taller than 8 sprites (as Shadow is), you'll need to do something like putting tiles numbered 0x in the second row as well as the first.

One more topic to cover in the information download before we get into how to use all of this: Empty spaces. As previously stated, both tiles and sprites can be designated as empty spaces. To make an empty sprite, add 80 to the value of the sprite you want to make empty. It's very important to note, though, that doing this will not just skip over that sprite. What it will do is essentially skip a space and push all sprites forward by one.
So,

Would appear as:


This has to do with how the game loads sprites to display. The sprite arrangement data tells the game, "put the first sprite here, the second sprite there, the third there..." and all of those places are defined spaces within the tiles.
The grid above tells the game, "Put the first sprite in the first spot, the second sprite in the second spot, an empty space in the third spot, the third sprite in the fourth spot..."
In order to get this:

(with an empty space that does not push the rest of the sprites forward), you'd have to specify in your sprite arrangement that the third sprite be placed in an unused location (I used 40), then stick an 82 at the end, after all sixteen sprites were assigned.

Now, just as a sprite arrangement can contain empty sprites, a tile arrangement can contain empty tiles, as well. This is a bit easier to visualize than empty sprites. An empty tile does not push the rest of the tiles forward - It simply puts an empty space where a tile would normally be. This is used quite a bit for summoned monsters that don't fill a rectangular area as a space saver (and for animated summons, as a way to conserve valuable tiles and sprites for multiple images). To place an empty tile, simply use FF.
A tile arrangement that looks like this:

Will yield a summon that looks like this:


It should also be mentioned that placing FE in a tile arrangement has it's own distinct effect. An FE tile tells the game to stop displaying all subsequent tiles.
So

will appear like this:

I'm not sure why this exists, or how I stumbled upon it, to be honest. It's never used in the original programming. I guess if you wanted to make a custom animated summon that starts as a TinyToad and turns into a ToadLady, or something like that, this would save you some tiles and sprites. Nice to know, I guess... We won't be doing anything that complicated here, but feel free to experiment.

The last thing I should probably explain here is how all of this arranging actually works in ROM. Obviously, you aren't drawing little spreadsheet files in your hex editor. The images in this tutorial are displayed as such because that is how I need to arrange them visually in order to easily write them out in my hex editor. If you can do this all without these steps, well, have fun saving the humans from the Matrix, Neo.
When planning a rectangular monster's image for summoning, the first step I take is to plot out where I need sprites in a Notepad file. So for Imp:
Code: [Select]
XXXX
XXXX
XXXX
XXXX
Then, I figure out how those sprites will fit into a tile arrangement. Easy enough in this case:

Now to write this out, we simply write these bytes out as they appear, left to right and top to bottom:
Code: [Select]
02 00 22 20As with Special size tile arrangements (finally, a similarity!), you don't need to specify when to start a new row, or when to stop, because you're working in an already-defined rectangular space. Since the summon image is defined as 2x2 tiles, the game will go to the second row after the second tile, and will stop displaying tiles after the fourth.

Once you've figured out how your tiles will be arranged, this will pretty much dictate how your sprites will be arranged - as long as you're working with a standard rectangular monster (a non-Special size) and not animating. I haven't (yet?) learned how to control summon animations, so that's a big yes-and-yes in this tutorial.
The tile arrangement above will always result in this sprite arrangement:

This, however, will be written right to left and top to bottom, so:
Code: [Select]
00 01 02 03 10 11 12 13-20 21 22 23 30 31 32 33
FF
I'm not sure if the FF at the end is needed, by the way, but it's always used, so I've never tried not to.

That's all for today. Practical application will be next (actually making Shadow). That will be a new post. If anybody who's following this needs any clarification on anything that's been written so far, please let me know. I know this seems rather complicated, but it's actually easier than I think I'm making it sound.

Knowing how long this will take, there's no sense in me withholding data locations, so:

9FC59: table of summons' x-position, y-position, width, height (4 Bytes per summon)

6F860: Pointers for tile arrangement data (reverse order and add to 60200), one per summon image (so Shiva has two, etc)

6F89A: Tile arrangement data

6F460: Pointers for sprite arrangement data (reverse, add to 60200), one per summon (so Shiva only has one)

6f482: Sprite arrangement data

689F0: Pointers to summoned monster sprites (to find where to find them in Tile Layer, that is - again, reverse, add to 60200)