ROM Hack [RELEASE] Fantasy Life Save Viewer/Editor

TheDeKay

I call it research
Member
Joined
Feb 6, 2015
Messages
152
Trophies
0
XP
239
Country
Yaattttaaa !!!
Thank you very much @TheDeKay ^_^
It's working properly.
I am glad it's working for you.

It's more than likely that it still wont come out as the more-user-friendly whole number like the other skills, but it's worth a shot
I could easily make it just show the whole number. Just run it through a rounding function (which is already implemented, but not used in the exp funciton).
However I didn't do that, because it would effectively make changes even if you don't make changes there (increasing/decreasing your exp a tiny bit)
and this way it is a little more precise.

True, when you've done it for a while [...]
I'm also just using a flat hex viewer/editor, so I'm essentially wading through every byte each time (often with duplicates of certain items), so getting the precise one I want can be annoying. Also, the way the game sometimes (even there its not always consistant) stores items based on the order acquired/deposited does make it less intuitive than simply comparing them to the displayed order in-game (in-game it's sorted logically when displayed rather than actually reorganizing the actual data. I confirmed this by changing a weapon into a consumable, loadong the game, then re-saving and checking the new save data. The item didn't move despite being displayed under the new appropriate tab in-game).
Well yeah, I do have some experience. But I haven't done it in a while either and I would still find them fairly easily.
I also do use a Hex Editor to edit, however I did write an Offset Generation Tool (which was basically the prototype of a function needed for an item editor).

The way storing works is actually fairly easy. It starts at the first slot and then goes in order of storing. But if any slot gets emptied, this slot will be refilled next. Saving and then restarting the game will fix the order and basically shift the items to "clear" empry slots (at least from what I've seen).

That should be all thats needed. The items (regardless of type) still keep the same general byte order, anyway. Something that simply points to the values for a particular item slot and effectively translates the little-endian floats for defense/attack values, item quantity and item quality would be enough (Doesnt even need to translate the hex values to what they represent in-game). The only extra precaution needs to be people remembering to make their own backups before editing - and that's not really on you.
My Stuff does auto-backuping anyway (unless turned off). That's a safety function I usually implement.
The Byte structure does change depending on type. Food and similar Items don't have a Quality Byte at all. The "+" is a completely different Item.
And then the Quality Byte also changes position for some types. Same for Dmg/Def Bytes and Effect Bytes. Armors for example have a 2 Byte shift over Weapons.

The conversion wouldn't be a Problem. However this is additional to the normal item stats. If your bow has 12 base damage and you put 1000, expecting to have a 1000 damage Bow you will instead end up with 1012.
And there is no way to actually "fix" that unless I define every single Item.

The Translation of hex values to their respective Item/Effect Names is one of the easiest things. And that was one of the first things I did. (The List Dump includes Hex and Name anyway. So "importing" that dump is not a difficulty. But the types are not included in ram and therefore not easily dumpable. SO unless I go through every item manually to add a type - which I wont - or come up with a 100% way of type detection more than that is not going to happen. So if anyone comes up with a way of detecting the item type (based on the structure in hex) that works at least 95% of the time - let me know.

It currently can perfectly list all Items in Inventory (Names Only) and then load them up in a different window. The User then has to select the Item Type (because there is no automatic byte struct detection).
Afterwards all edits can be made and saved to the item (Includes: Item, Creator, Color, Quality, [M]Dmg/[M]Def, Effect, Quantity -Given the Byte Struct includes these).
Then the edits can be saved and the edited save can be reinjected.
 
Last edited by TheDeKay,
  • Like
Reactions: Zan'

Wyndalgo

New Member
Newbie
Joined
Jul 21, 2016
Messages
2
Trophies
0
Age
31
XP
74
Country
United States
@TheDeKay has not implemented that yet. I've done soem hex editing to tinker with items, but it's very tedious to do (especially finding the right item slot for the item you want to edit) and generally requires a similar item to be made then modified to the desired item (ie: make a divine quality low tier weapon if intending to edit in a divine quality high tier weapon).

in any case some crazy stuff is possible:
View attachment 63804

wow! would you mind explaining how to edit weapon and armor values? cant figure it out on hex
 

iSharingan

Show me your power
Member
Joined
Jun 23, 2016
Messages
804
Trophies
0
XP
1,646
Country
United States
wow! would you mind explaining how to edit weapon and armor values? cant figure it out on hex
the "weapon and armor values" are 4 bytes long and are stored in 'little-endian' or reverse byte order.

for example, the float for 9999 is 461c3c00. in 'little-endian' format, this would be stored as 00c31c46 (note that the 4 pairs are reversed in position only. the content of each pair remains as it was).

to find the right bytes to edit, find the item ID if the item to edit, go back 2 bytes (often will be the first of two 'FF' bytes or an 'FE' byte. this is the actual start of the item's data) then go down two lines (32 bytes). This will put you at the start of the set of 4 bytes denoting magic attack (weapons) or magic defense (shields/armor). Move back 4 more bytes to be at the start of the regular attack/defense stat modifier.
 

RJCline

Well-Known Member
Member
Joined
Feb 22, 2015
Messages
132
Trophies
0
Location
New York
XP
172
Country
United States
the "weapon and armor values" are 4 bytes long and are stored in 'little-endian' or reverse byte order.

for example, the float for 9999 is 461c3c00. in 'little-endian' format, this would be stored as 00c31c46 (note that the 4 pairs are reversed in position only. the content of each pair remains as it was).

to find the right bytes to edit, find the item ID if the item to edit, go back 2 bytes (often will be the first of two 'FF' bytes or an 'FE' byte. this is the actual start of the item's data) then go down two lines (32 bytes). This will put you at the start of the set of 4 bytes denoting magic attack (weapons) or magic defense (shields/armor). Move back 4 more bytes to be at the start of the regular attack/defense stat modifier.

My brain exploded reading that comment...on that note I feel like you just told me how cure cancer along with the formula needed to make my body be able to fly. Going back to watch anime now, where everything seems normal xD
 

iSharingan

Show me your power
Member
Joined
Jun 23, 2016
Messages
804
Trophies
0
XP
1,646
Country
United States
I could easily make it just show the whole number. Just run it through a rounding function (which is already implemented, but not used in the exp funciton).
However I didn't do that, because it would effectively make changes even if you don't make changes there (increasing/decreasing your exp a tiny bit)
and this way it is a little more precise.
In other games, I've encountered bit-packing (storing values in bit offsets rather than byte offsets, making storage more compact and wasting almost no memory space. On the flipside, the packing/unpacking algorithms in-game can get complex/touchy so it's not used often. I mainly see it for compressing stored time data, large inventory/storage setups, or other potentially long lists of data that don't need a full byte/set of bytes for all possible values an entry could have). I suspect it might be in play in a limited few places (if at all) as even the armor/weapon/tool power modifier values are not true floats (for example, what should be 999,999 if it was a true float becomes about -31,000 in-game - and results in some trippy camera effects if used on a tool in the crafting minigames :P)

Well yeah, I do have some experience. But I haven't done it in a while either and I would still find them fairly easily.
I also do use a Hex Editor to edit, however I did write an Offset Generation Tool (which was basically the prototype of a function needed for an item editor).
The Translation of hex values to their respective Item/Effect Names is one of the easiest things. And that was one of the first things I did. (The List Dump includes Hex and Name anyway. So "importing" that dump is not a difficulty. But the types are not included in ram and therefore not easily dumpable. SO unless I go through every item manually to add a type - which I wont - or come up with a 100% way of type detection more than that is not going to happen. So if anyone comes up with a way of detecting the item type (based on the structure in hex) that works at least 95% of the time - let me know.

It currently can perfectly list all Items in Inventory (Names Only) and then load them up in a different window. The User then has to select the Item Type (because there is no automatic byte struct detection).
Afterwards all edits can be made and saved to the item (Includes: Item, Creator, Color, Quality, [M]Dmg/[M]Def, Effect, Quantity -Given the Byte Struct includes these).
Then the edits can be saved and the edited save can be reinjected.
If need be I could go through and make a CSV for the item types (shouldn't take too long if I set a side the time. A spreadsheed can make it easy - especially since many of the items are grouped by general type [armor, weapon, tool, food, etc.] anyway. It would just need to be loaded alongside the item name dump (if not appended along side each entry) to help the editor automatically select the right format. Of course it's easier to just let the person manually select the format for each item (and might have some extra utility that will reveal itself if we can tinker a bit). Optionally, a simple warning could be put above the drop-down, but in any case errors on the user's side are not on you (plus you have the automatic backup set up anyway).

In any case, even a prototype offset generation tool would make things a bit simpler that what I've been doing. One of these days I'll knuckle down and tinker until I have the confidence/experience to reliable make such tools myself...

The conversion wouldn't be a Problem. However this is additional to the normal item stats. If your bow has 12 base damage and you put 1000, expecting to have a 1000 damage Bow you will instead end up with 1012.
And there is no way to actually "fix" that unless I define every single Item.
That shouldn't be an issue. Just label the value(s) as "[Physical/Magic/Tool] Stat bonus (crafting)". It's easy to just trial-and-error (or people could actually do their own research on base item stats) if you want a specific value. In general, I dont think people will really care what the value is as it will [most likely] be primarily used to make insanely high stats on an item.
 
Last edited by iSharingan,
  • Like
Reactions: Zan' and TheDeKay

TheDeKay

I call it research
Member
Joined
Feb 6, 2015
Messages
152
Trophies
0
XP
239
Country
In other games, I've encountered bit-packing (storing values in bit offsets rather than byte offsets, making storage more compact and wasting almost no memory space. On the flipside, the packing/unpacking algorithms in-game can get complex/touchy so it's not used often. I mainly see it for compressing stored time data, large inventory/storage setups, or other potentially long lists of data that don't need a full byte/set of bytes for all possible values an entry could have). I suspect it might be in play in a limited few places (if at all) as even the armor/weapon/tool power modifier values are not true floats (for example, what should be 999,999 if it was a true float becomes about -31,000 in-game - and results in some trippy camera effects if used on a tool in the crafting minigames :P)


If need be I could go through and make a CSV for the item types (shouldn't take too long if I set a side the time. A spreadsheed can make it easy - especially since many of the items are grouped by general type [armor, weapon, tool, food, etc.] anyway. It would just need to be loaded alongside the item name dump (if not appended along side each entry) to help the editor automatically select the right format. Of course it's easier to just let the person manually select the format for each item (and might have some extra utility that will reveal itself if we can tinker a bit). Optionally, a simple warning could be put above the drop-down, but in any case errors on the user's side are not on you (plus you have the automatic backup set up anyway).

In any case, even a prototype offset generation tool would make things a bit simpler that what I've been doing. One of these days I'll knuckle down and tinker until I have the confidence/experience to reliable make such tools myself...

That shouldn't be an issue. Just label the value(s) as "[Physical/Magic/Tool] Stat bonus (crafting)". It's easy to just trial-and-error (or people could actually do their own research on base item stats) if you want a specific value. In general, I dont think people will really care what the value is as it will [most likely] be primarily used to make insanely high stats on an item.
I'll write a proper reply once I have more time.
I dont want to go through all items because there are like 2000 of them. In the savegame or the ram they are not actually grouped by category (annoyingly enough).
You could possibly give it ID ranges and say 0-120 is weapons 121-240 is armor 241-360 is consumeables 890-1020 is weapons again. Because they are partially grouped.
However it seems like there are some exceptions. It should also be possible to read certain bytes in combination to actually determine the structure. However I haven't come up with something that works all the time.

I also didnt really dig into the structure of consumeables at all.
And then there seems to be something about slot ID or something similar, because so far I've not been able to create an item from nothing.
(Wouldn't really be a problem if parts of the seemingly slot stuff is worked out and I can just fill it with something that works. For Weapons/Armor/Tools pretty much all Bytes are worked out except that - So it wouldn't be a big deal to generate those and write them over any kind of Item - as long as the other part slot stuff exists)

Thinking about it. Actually probably all Items actually need to be clarified, since if an Item gets changed from Weapon to Armor it should also change from Byte Struct A to Byte Struct B.

I should probably set up a Discord Server or something to share research and possibly work on, with people that are interested to help or in the work. [ https://discord.gg/CCCxTFw ]
 
Last edited by TheDeKay,
  • Like
Reactions: Zan' and iSharingan

iSharingan

Show me your power
Member
Joined
Jun 23, 2016
Messages
804
Trophies
0
XP
1,646
Country
United States
I'll write a proper reply once I have more time.
I dont want to go through all items because there are like 2000 of them. In the savegame or the ram they are not actually grouped by category (annoyingly enough).
You could possibly give it ID ranges and say 0-120 is weapons 121-240 is armor 241-360 is consumeables 890-1020 is weapons again. Because they are partially grouped.
However it seems like there are some exceptions. It should also be possible to read certain bytes in combination to actually determine the structure. However I haven't come up with something that works all the time.
With a CSV (essentially a list of comma separated values, similar to the name/id dumps you made) you wouldn't need to go item by item. It'd literally be the same process as tying a name from a list to an item ID at the same position on another list. Most spreadsheet programs can even export as CSVs and I can set the one we'll need up no problem.
I also didnt really dig into the structure of consumeables at all.
And then there seems to be something about slot ID or something similar, because so far I've not been able to create an item from nothing.
(Wouldn't really be a problem if parts of the seemingly slot stuff is worked out and I can just fill it with something that works. For Weapons/Armor/Tools pretty much all Bytes are worked out except that - So it wouldn't be a big deal to generate those and write them over any kind of Item - as long as the other part slot stuff exists)
well I already helped with the MHGen save editor APM was working on and cracked several such tough nuts. If I can get it into a offset generator/calculator (mainly so I dont lose focus on other time slots' data) I should be able to break the format very quickly in the same fashion.

Thinking about it. Actually probably all Items actually need to be clarified, since if an Item gets changed from Weapon to Armor it should also change from Byte Struct A to Byte Struct B.
TBH no one should ever need to do that. it's easy enough to buy or craft a random low level tool/consumable/weapon/etc. then edit it into the desired item of the same type. With the CSV mentioned above, it should be simple enough to warn users when switching item types - putting the onus on them to figure out what in blue blazes they're trying to do.

I should probably set up a Discord Server or something to share research and possibly work on, with people that are interested to help or in the work. [https://discord.gg/g5bRFsV]
Of course. Only one problem with that link: I missed the edit and it expired.. I'll PM my Discord name/ID number and you can add me in that way (or you could set it to never expire in a check box under the link when generating the instant invite)

Edit: I see, the bracket at the end was making the link invalid.
 
Last edited by iSharingan,
  • Like
Reactions: Zan'

RainThunder

Well-Known Member
Member
Joined
Jun 22, 2012
Messages
212
Trophies
0
Location
Hanoi
XP
351
Country
You could possibly give it ID ranges and say 0-120 is weapons 121-240 is armor 241-360 is consumeables 890-1020 is weapons again. Because they are partially grouped.
However it seems like there are some exceptions.

There is no exception, because there are certain bytes in the item table that determines item category. Here is my breakdown:

0x0 - 0x98: Weapons
0x99 - 0x386: Armors
0x387 - 0x435: Tools
0x436 - 0x5C4: Decorations
0x5C5 - 0x833: Consumables
0x834 - 0x9FE: Materials
0x9FF - 0xA1C: Key Items
0xA1D - 0xAAE: Bounties
 

iSharingan

Show me your power
Member
Joined
Jun 23, 2016
Messages
804
Trophies
0
XP
1,646
Country
United States
rename the file to [lang]_fl_ext0.fsd

in place of [lang] put US, EU, or JPN as applicable to your game version

if not using your first save slot, change the zero to a 1 for the second slot or a 2 for the third slot

also, dont use that editor. It breaks any lives you haven't started yet. Use the one by TheDeKay
 
Last edited by iSharingan,

KamiNoRyu619

Active Member
Newcomer
Joined
Sep 2, 2016
Messages
25
Trophies
0
Age
36
XP
67
Country
United States
how exactly do ya use the savedatefiler to extract the save.?? everything in this is showing broken when i load the savedatafiler for the first time
 

Hatchetball

RepititionRedundancyRepitition
Member
Joined
Sep 26, 2010
Messages
438
Trophies
1
XP
799
Country
United States
I've been out of the ds modding scene for a bit but would like to use this on my 400 hour save file to get some gold coins and have a few concerns and questions.
1. Is there any chance a save can be corrupted?
2. Does my 3ds HAVE to be modded or can I just drag/drop the files, mod them, then drag/drop them back to the SD card with no software or hardware mods?
3. If mods are required, which one specifically will help to do this?
Thank you in advance.
Edit: 4. Is there a proper guide of what to do available, video or anything, visual guides do wonders for me lol
 
Last edited by Hatchetball, , Reason: Edited for question to avoid double post

OwnHeart

Member
Newcomer
Joined
Sep 20, 2016
Messages
13
Trophies
0
Age
35
XP
186
Country
Can't wait to give this a try been playing this game for ages now but I feel it's time to mess about hehe :-p thank mate for your hard work on this :-)
 

Zan'

2F88744FEED717856386400A44BBA4B9CA62E76A32C715D4F
Member
Joined
Oct 8, 2015
Messages
387
Trophies
0
Age
32
XP
271
Country
For now, not yet. Inventory editing is a pretty hard thing to do.
Inventory Editing has been done by multiple people.
I think the problem is not that the editing is hard, but to create a tool that does it for the user without the user having to use his brain.
 

Xyphoseos

Hack or no games
Member
Joined
Jun 29, 2016
Messages
1,834
Trophies
0
Age
23
Location
Rivière
XP
3,265
Country
France
Help me...

Sans titre 1.png
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    BigOnYa @ BigOnYa: Yea is pretty good