News: 11 March 2016 - Forum Rules, Mobile Version
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia

Author Topic: Help at respriting FFV advance  (Read 707 times)

MaverickZero

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Help at respriting FFV advance
« on: October 01, 2017, 08:40:11 am »
As the title says, i want to resprite FFV for the gba, but whenever i change a characters sprites they mess up the next one.For example i edited Bartz's freelancers sprites but that just screwed lenna's knight graphics.
Another way would be to put bartz's new sprites at the end of the game, but how can i hex edit it that the game takes bartz's new sprites instead of his old whitout screwing up all the other characters. Please Help :'(
« Last Edit: October 10, 2017, 06:30:29 am by MaverickZero »

FAST6191

  • Hero Member
  • *****
  • Posts: 2168
    • View Profile
Re: Help at respriting FFV advance
« Reply #1 on: October 01, 2017, 07:17:00 pm »
What tool are you using? Such a thing should not happen. Are you using a decompression tool to find these graphics? The main way I can see other than tile editor going completely off the rails (rare as they are simple tools when all is said and done) is if you are decompressing graphics but the game wants to decompress an entire sprite sheet for many characters then editing an earlier one could have knockon effects.

To edit to be at the end of the game then you would probably want to change the pointers that lead to the original location. Often it will be of the form 08?????? (or some variation to account for endianness) where ?????? is the location in the ROM but compression could get in the way of that. https://www.romhacking.net/documents/361/ , though try to adapt it for the debug version of http://problemkaputt.de/gba.htm is my usual starter setup for people learning this.
If you already know where it is found in the ROM you can skip some steps and instead focus on decoding the read command and then thinking how you might redirect it.

MaverickZero

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Re: Help at respriting FFV advance
« Reply #2 on: October 02, 2017, 06:10:53 am »
Yes every single graphic is compressed that's why this happens, and please forget what i said about putting something to the end of the rom, i just got something wrong with rom expanding.
So finding,editing,giving right palette, everything is fine but if there is a way to make more space for the new data or so please explain it because the minish cap thing was pretty useful but i couldn't find anything useful at the other website.
I dont know anything about "re pointing" and since it sounds like i will need it please be so kind and explain it so that even i am able to understand it.
Thanks in advance  ;D

FAST6191

  • Hero Member
  • *****
  • Posts: 2168
    • View Profile
Re: Help at respriting FFV advance
« Reply #3 on: October 02, 2017, 03:07:00 pm »
The other link was to a website with an emulator you could use to do the stuff from the first link. Said website also houses the main hardware documents we use for this sort of thing
http://problemkaputt.de/gbatek.htm

Wild guess then. The game uses LZ compression and I guess you have used a tool like nlz gba or unlzgba to find and help edit.
LZ is a so called sliding window compression. It says this section for this length is the same as this section however many hundred bytes before the current location, hence the trickle down/corrupting later data effect. Pointers, while vital for hacking, may not then make the most odds with this one.

Pointers then. Games don't magically know where to look for things, even knowing what line to fetch next and where to start new ones is harder work than some devs care to program in, so you need things to tell you where to go, point the way if you will. They come in many forms on many systems but they are some mathematical relationship to the location of the data in either the ROM or somewhere in RAM. For the GBA though almost everything is visible in normal memory at all times. There are multiple locations it is seen in but a lot of the time it is in the 08000000 through 09FFFFFF region, or 08000000 through 08FFFFFF as most games are below 16 megabytes. This means people tend to look for a lot of 08 values with 3 bytes of something else* in between when looking for pointers. If you can find where the game says fetch this location you can change the pointer that did it to something else where you hopefully sorted your data if you are moving it.

*technically 08080808 is a valid pointer, even aligned to a nice address, so don't assume it has to not have something other than 08 in the middle.

Back to compression. Compression was historically the bane of ROM hacking, the thing what made it really annoying and caused the effort/skills required to shoot up. Fortunately for the GBA the BIOS of the machine housed some decompression algorithms which many devs needing such a thing actually used (or a used a compatible version of), hence you presumably being able to use a generic tool to find it. Were this the NES you would be facing something custom that a dev cooked up decades ago to run on hardware of rather limited capabilities.
I find it slightly odd that different characters (especially for a game with this many jobs) would have compression that goes over multiple sprite sheets, or maybe the compression tool overwrites subsequent ones (if you corrupt things early in the compression sequence, like say having a thing that little bit bigger and spilling over, it is bad news for later things). The multiple sheets compressed thing is not outside the realm of reason though.

Two main choices
1) Decompress everything, edit on uncompressed data, compress and try to reinsert. Possibly have to also repoint if the new data is still larger and there is nothing else you can overwrite.
2) Decompress everything, edit on uncompressed data, insert (possibly somewhere else like the end of the ROM) and get the game to simply read rather than try to decompress.

When I say everything I just mean a single instance of a compressed sheet if it is a single sprite sheet. As the compression seems known there are likely also tools to recompress it (even if you have to use good old gbacrusher) so you probably don't have to do any of the more exotic things we sometimes see; if you have an unknown compression, maybe having ripped the uncompressed version from RAM in an emulator, it can be easier to just insert a thing which says these next ? bytes are not compressed every ? bytes rather than trying to cook up a compression tool.
I occasionally see people sweat making a ROM bigger. Don't. My flash carts support SDHC memory these days and my computer has a hard drive larger still. It only mattered at the time if you were creating thousands of copies and thousands multiplied by a few pennies is still real money, or in some older flash carts of the time.

tvtoon

  • Sr. Member
  • ****
  • Posts: 309
    • View Profile
Re: Help at respriting FFV advance
« Reply #4 on: October 03, 2017, 03:28:11 pm »
Graphic editing in FF4-6 Advance is simple but it is not only compression that matters, many graphics come with a size information and some tidbits, before the actual graphic data. It resembles the "FONT" format inside these games, so be careful with that.

Now for the pointing issue, I can confirm you that there is a limit on how far you can expand the data inside the ROOMs, I never bothered to get that deep in the issue for every single version, but FF6A will creep you around 8.2MB range. You need to check that if you need to pull decompressed graphics, for instance. ;)

MaverickZero

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Re: Help at respriting FFV advance
« Reply #5 on: October 05, 2017, 06:54:44 am »
Now that i can change the character sprites i wanted to take on the weapons.
For example Excalibur, the gba Excalibur uses 4 tiles but the new one uses 8...
Is there any possible way to extend the 4 tiles to 8?
Because its not the only weapon that lacks in space, same thing in megaman zero 3, just want to extend the graphics by a few pixel, and yes i know that just making the sword graphics bigger does let it look only big but i still wanted to know.
« Last Edit: October 12, 2017, 11:53:20 am by MaverickZero »

MaverickZero

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Re: Help at respriting FFV advance
« Reply #6 on: October 20, 2017, 11:28:10 am »
Umm...
Please help me with the problem above...
Aaand, i also wanted to ask if it would be possible to re point music.
Or i could just need every help for music hacking, also for other games.
I found sappy everywhere but it wasn't working, so is there a way to hack music without sappy?
And i also need help in raising max values for example max mp can be 999 but i want it to 9999 how do i do that, well i dont want it really this knowledge is for another game
« Last Edit: October 20, 2017, 11:49:21 am by MaverickZero »

FAST6191

  • Hero Member
  • *****
  • Posts: 2168
    • View Profile
Re: Help at respriting FFV advance
« Reply #7 on: October 22, 2017, 01:21:55 am »
4 to 8 tiles. Yeah you figure out the routine that loads the tiles and change it. Some later systems might have a helper format (DS games often have 2d graphics come as several parts) and you might have a listing here but to find it you are going to have to pull the game apart. You may run into problems though as there is often a fairly harsh limit http://pineight.com/gba/managing-sprite-vram.txt
For the most part though you don't do it. You think the people making such things didn't want to scan in a nice oil painting they did rather than messing around with a computer? Of course they did but you typically work to the limitations of the system/format.

Sappy is just a program, though there are many versions and offshoots (I have not been around the Japanese sites lately but they often had nice ones) and it lent its name to the format as well.
Anyway yes but you will likely have to go manual http://www.romhacking.net/documents/462/ covers most of what anybody would want to know about the sappy audio format.
Also if you are making improvement hacks then be aware many will want to also be able to use the existing sound improvement patches.

Max values? Isn't 9999 functionally infinite for most purposes? Maybe it is not for the other games you have in mind. Still it can be done, how much effort it is varies between games.
The first thing you are likely to run into is representation limits -- if you ever wondered why games often pick limits like 64, 128, 256, 512, 1024.... (or one less than each of those) then that is because it corresponds to certain numbers of bits. Adding more is doable but may involve you radically reworking parts of the maths engine, number display and number handling.
Just for fun you may also have packing to handle -- if 999 is more than suitable you can pack that into whatever number of bits gives you 1024, this leaves the rest of the value free to store things like poison/paralyse/sleep/frog/burn/... status (1024=2^10 and as you are not going to set aside less than 16 bits for something, probably more like 32 for the GBA). Such things are not as common on the GBA where you have a bit more memory to play with and the time and annoyance penalties for using such a setup make it less useful, however it is not absent and on older systems where memory is more precious you see it far more.
So yes find where it stores the value you want (basic cheat making will get you this for a given character), find any checks on the max value for it (use a restores 100 mana type potion when you are less than 100 from the limit and see what it does), find any display routines and sort those (if you thought the sprite size stuff was annoying you have likely seen nothing yet), alter any in game effects to make it sane (if the max is 999 then even a restores full mana potion most likely just adds 1024 and has the game handle any rollover like it would for any other potion -- why mess around coding something fancy when you can just make an even larger potion)
I know you mentioned other things but being Final Fantasy I would have to wonder if this is to handle the swap hp-mana items/weapons/spells/whatever things you get and make it more viable or something.

MaverickZero

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Re: Help at respriting FFV advance
« Reply #8 on: October 22, 2017, 07:48:14 am »
The Game i have been talking about was Summon Night Swordcraft Story 2, in the third Game of the series a weapons durability can be at 999 maximum, but in the second it is set at just 255, and since some special attacks cost 25 weapon durability your weapon will almost break after using ten. And there is no fun in playing after using an have infinite... Cheat, and since there are already items that completely restore it, it is still of no use since you cant use them in battle, so i wanted to turn the max value from 255 into 999. I know it may be complicated but I'm willing to learn.
P.S.
Final fantasy again,the swords, Ragnarok and Apokalypse are using the same sprite which is used by two pointers (so the the two swords) but i would want to give them seperate graphics...
And since the compression programms i am using change automatically both, what can i do to seperate the graphics?
« Last Edit: October 22, 2017, 05:22:58 pm by MaverickZero »

FAST6191

  • Hero Member
  • *****
  • Posts: 2168
    • View Profile
Re: Help at respriting FFV advance
« Reply #9 on: October 22, 2017, 07:06:32 pm »
If the game uses separate pointers but each points at the same location (technically it is a type of compression known as pointer compression) what is the problem, especially on the GBA where you tend not to have file level/calculated pointers or anything and oodles of extra space you can use?. Worst case scenario from what I can see is you have to compress the new image you want to use if it expects a binary compressed format for the reading (and from what has been said it is a standard algo rather than anything custom).

I am familiar with SNSC2. Never particularly found the specials too draining on durability and if they are it is the sort of thing which works to limit your use in a game. Change if you will though, I detailed the method I would use (make a cheat to do infinite durability and thus get the RAM location for it, find everything which manipulates this RAM segment and change it all such that your higher values make sense and any maths also works, also change whatever determines durability in the game to take advantage of this as well as any potions, or whetstones and such in this case, to play to it too. I would not really call it complicated as much as an awful lot of effort, and quite tedious to boot; personally I would lower the durability damage done by the specials as that would be far easier in the long run. If you want something fun to do maybe vary the durability damage done by the special randomly (something between 8 and 25).

MaverickZero

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Re: Help at respriting FFV advance
« Reply #10 on: October 22, 2017, 07:37:56 pm »
Wow thanks XD i really didn't think about that XD.
OK but again with the swords
After changing the picture, it showed me: changed pointers at:
Value 1
Value 2
So how do i find out which pointer leads to what sword, and even if i find it out how do i change each pointer individually?

FAST6191

  • Hero Member
  • *****
  • Posts: 2168
    • View Profile
Re: Help at respriting FFV advance
« Reply #11 on: October 23, 2017, 06:34:41 am »
I don't follow. Are you using some game specific editor for this or a generic tool?

What I imagined was happening from what you said

Game has a long list of weapons in it.

Either you then had an individual table with just pointers to the ROM location of the picture for it or a table with the stats, name.... and also a location for the pointer.

Because devs were lazy or whatever two weapons shared a sprite*. This meant the pointers from the tables just mentioned pointed at the same thing but otherwise knew nothing of each other.

*I assume if they shared a sprite but not a palette then that would be taken care of somewhere else and you could handle that.

A game specific editor might know to change both pointers when you edited the graphics for the sword and it felt the need to move it somewhere else in the ROM.

"After changing the picture, it showed me: changed pointers at:
Value 1
Value 2"
If you had 500 things to check and were burning discs for each of them then that is one thing, here though you have two things which is a perfect candidate for brute force; you surely have 5 minutes in which you can make a couple of versions of the game with only one of the pointers changed (if you know where they are then use a hex editor) and run it in an emulator (note you want to use a save game not a save state in case the save state already loaded the relevant data into RAM).
Going beyond that the order something might appear in a weapons list (including one on gamefaqs as they often pull data from the ROM tables or use cheats and increment one each time before copying data off screen or something) tends to correspond to the order of everything else.

MaverickZero

  • Jr. Member
  • **
  • Posts: 20
    • View Profile
Re: Help at respriting FFV advance
« Reply #12 on: October 23, 2017, 03:17:35 pm »

Ok i have been able now to seperate the swords, give them a new palette and so on...
But back to the excalibur problem, make the sword larger from 4 to 8 tiles.
Is there a not too hard way without screwing the game?
To make it easier, these two swords are using the same format i need so would it be possible or even easier to give excalibur somehow the possibility to be read in 8 tiles like ragnarok?
And sorry for bothering you...
« Last Edit: October 24, 2017, 09:11:53 am by MaverickZero »