Users browsing this thread: 1 Guest(s)
Expanding NPC Sprite sheets

#1
Posts: 759
Threads: 83
Thanks Received: 115
Thanks Given: 57
Joined: Apr 2015
Reputation: 22
Status
Gradual-Petrifiy
This is a tutorial for expanding the NPC sprite sheets to include all of the actions of a PC sprite sheet. This will enable you to make much more interesting and natural custom events.




***Sorry about the video quality. Youtube apparently does not maintain the quality of the video uploaded. I'm new to uploading vids so if anyone knows a fix let me know so I can make this a little more clear.


It's a pretty straightforward process:

First you need to get yourself a sprite sheet and get it imported into a dummy ROM (alternatively you could import it into your working ROM, but you will have to reimport whatever sprite you replace later). Once you get it fully working with your hacks palettes you need to copy the data to a new location. Using FF3info.txt you can see where the sprite you replaced should start and end, which will give you the bounds for the sprite sheet you imported. I always import over Terra since she is pretty easy to find and I have her offsets memorized. D5/0000 to D5/169F. So grab all that data and paste it somewhere you have $16A0 empty bytes (I copy it to F5/0000). You now have a whole extra sprite sheet in your ROM... but now your game needs to know what it is and when to use it...

The next step is to fix your Overworld and NPC sprite pointers which are in two different tables:

C0/D23C - C0/D385 (Bank pointers)
C0/D0F2 - C0/D23A (Location pointers)

For both tables each entry is two bytes long, so in order to find your offset, find the NPC you want to replace (make sure the spriteID is converted to Hex), double it, and add it to the start of each table. So for Arvis (sprite ID 29, or $1D) you need to change the values at D276 (1Dx2 + D23C) and D12C (1Dx2 + D12C)... Alternatively, you could just count it out two bytes at a time the way I do in the video.

Then you are done! You should now have your expanded sprite sheet called by the game when it loads the NPC. However, there are a few notable differences between NPC sprite sheets and PC sprite sheets when it comes to events. Many NPCs (including Arvis) only have one additional sprite, the event queue command to call the NPC additional sprite is 2D, you will need to replace every instance of this call for your NPC to whatever action that NPC is supposed to be doing there. That being said, you are opening up a world of possibilities for your NPCs.

If I am lucky, I will be posting 2 more videos in the next couple months that build on this one. The first will enable our imported sprites to be able to called in battle and will likely cover expanding portrait data for your new sprite. And the final video (if I am able to get everything worked out) will be a tutorial on enabling your new sprite to be called in shop, save, and party menus, effectively making your sprite 100% playable as a PC.

I hope this helps with those of you who are doing a lot of custom events and makes you excited for the things that are possible when you hack FF6.

Happy Hacking!
  Find
Quote  
[-] The following 4 users say Thank You to B-Run for this post:
  • Gi Nattak (08-13-2013), m06 (06-10-2017), Scorcher (01-29-2014), SSJ Rick (08-14-2013)

#2
Posts: 2,218
Threads: 90
Thanks Received: 257
Thanks Given: 258
Joined: Aug 2009
Reputation: 40
Status
Nattak\'d
Oh wow, very cool stuff Edrin! This is nothing short of amazing really. I can't even begin to fathom how many events I will want/have to go back to and mess with for the NPCs involved, if they have full sheets.

So with this all the NPCs even static ones like the Espers etc. can be given full sheets?
In other words, what range of NPCs does this cover exactly?
Also, would this allow for giving Banon and Leo or others like Gestahl Chocobo riding sprites, if one wanted to do that?

And also, will USME show the full spritesheet for them once changed?


We are born, live, die and then do the same thing over again.
Quote  

#3
Posts: 759
Threads: 83
Thanks Received: 115
Thanks Given: 57
Joined: Apr 2015
Reputation: 22
Status
Gradual-Petrifiy
(08-13-2013, 04:29 PM)Gi Nattak Wrote: So with this all the NPCs even static ones like the Espers etc. can be given full sheets?
In other words, what range of NPCs does this cover exactly?
This covers any normal size sprite sheet, which includes Ramuh, the Fairy, etc... I don't know how the game would respond to trying to expand the sheets for Odin and Tritoch, but I would imagine there are ways to fudge basic animaitons for them.


(08-13-2013, 04:29 PM)Gi Nattak Wrote: Also, would this allow for giving Banon and Leo or others like Gestahl Chocobo riding sprites, if one wanted to do that?
Yes. In fact, you don't even have to update his battle sprite in this instance since the riding sprites are never called inside battle. I was always dissapointed with how non-animated Gestahl was.
  Find
Quote  

#4
Posts: 3,647
Threads: 266
Thanks Received: 692
Thanks Given: 285
Joined: Oct 2011
Reputation: 60
Status
Faith
Amazing tutorial Edrin!
  Find
Quote  

#5
Posts: 2,741
Threads: 87
Thanks Received: 44
Thanks Given: 217
Joined: Jun 2009
Reputation: 25
Status
None
amazing discovery wow

this is getting me seriously hyped to finish up sprite sheets

-edit-

I would also suggest, about the sprite sheets, you can always import the bin files through the relm editor so that you don't need to edit the sprite sheet's palette (if the sprites are made in the correct order of course)


"Sometimes ninjas do wrong to each other, and in dat way the force of tha earf' comes around da moon - and at that presence, da dirt, it overshadows the grass, so you're like, I can't cut dis grass, there's no sun comin' through. So in order to enable each other the two fruits have to look each other in da eye and understand we can only be right, as da ripe is wrong, you know what I mean?"

-HNIC
Quote  

#6
Posts: 45
Threads: 4
Thanks Received: 6
Thanks Given: 1
Joined: Jul 2013
Reputation: 4
Status
None
This is a useful post, and I'm even more interested in the follow-ups you're planning.

I'm interested in the 15th man / additional PC stuff, and want to get involved in that after I'm done with my current project with battle palettes.

Especially looking forward to the OAM lecture, which I don't know that much about yet.

For my contribution, I know for battle sprites, it pre-computes all the 16x16 sprite tiles for the character. Which are themselves made up of "raw" 8x8 tiles from Rom, which tiles are sometimes flipped or rearranged in different combinations to make up the larger tiles. And then that data sits in a big clump in general working memory, which is where I edit it. The transfer to OAM is thus far a black box to me.

I assume for overworld sprites, they aren't pre-computed all at once like that. Otherwise expanding them like this would cause huge problems.
  Find
Quote  

#7
Posts: 759
Threads: 83
Thanks Received: 115
Thanks Given: 57
Joined: Apr 2015
Reputation: 22
Status
Gradual-Petrifiy
Its actually much simpler than that, Eggers. The game knows how to handle the data, I just need to point it in the right place. Overworld/NPC sprites are easy because there's already a huge table. Expanding the battle sprites is a little more tricky since it only accounts for, i think, 24 battle sprites. But all I have to do to fix this is move the code directly after the pointer list and then add more data to the table! The game then looks for the pointers with the sprite ID as an offset and finds the data needed in the code. Essentially, the game can treat it like any other sprite, I don't even have to get into the nitty-gritty details of how the game works.

The OAM might be a little more complicated... we will see.
  Find
Quote  

#8
Posts: 2,741
Threads: 87
Thanks Received: 44
Thanks Given: 217
Joined: Jun 2009
Reputation: 25
Status
None
very interesting, hopefully this can add a lot more characters in the long run


"Sometimes ninjas do wrong to each other, and in dat way the force of tha earf' comes around da moon - and at that presence, da dirt, it overshadows the grass, so you're like, I can't cut dis grass, there's no sun comin' through. So in order to enable each other the two fruits have to look each other in da eye and understand we can only be right, as da ripe is wrong, you know what I mean?"

-HNIC
Quote  

#9
Posts: 759
Threads: 83
Thanks Received: 115
Thanks Given: 57
Joined: Apr 2015
Reputation: 22
Status
Gradual-Petrifiy
Just wanted to let you guys know that I figured out how to expand the OAM data, and it's a doosie. For full OAM expansion (to allow 255 characters), you need $2500(9472) bytes. I will need to fix a few things in C3 to make it work too that I still need to track down, but it shouldn't take that long to get all the correct ones. It will likely take me a few days to get the whole process down.
  Find
Quote  

#10
Posts: 2,218
Threads: 90
Thanks Received: 257
Thanks Given: 258
Joined: Aug 2009
Reputation: 40
Status
Nattak\'d
Awesome man! Could this by any chance also help with the issue of palette #6 characters in the save/shop menu glitchyness, or am I way off?


We are born, live, die and then do the same thing over again.
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite