Page 1 of 1
How do I modify the contents of the achievement.dat file?
Posted: Fri Dec 13, 2024 8:57 pm
by alecika
I want to reset some achievements in Factorio and found the achievement.dat file. However, when I open it, there's the name of each achievement with some random characters and stuff, making it impossible for me to understand how it works. I went to the Wiki and it made me even more confused. How do I even open the file in order to at least understand what I'm looking at?
Re: How do I modify the contents of the achievement.dat file?
Posted: Fri Dec 13, 2024 9:16 pm
by eugenekay
The "random characters" are the Data itself. The
Factorio Wiki gives specific information on which achievements use integer/bool/double types etc, but it is out-of-date for 2.0.
- Screenshot 2024-12-13 161319.png (930.64 KiB) Viewed 289 times
You can use a Hex Editor to see (and modify) the raw Binary data. I use
Notepad++ with the "HEX-Editor" plugin installed. Here, I have highlighted the "0b" value for the "visit-gleba" achievement (which I have Earned in-game). Achievements which are still Locked seem to have the Value "00".
Good Luck!
Re: How do I modify the contents of the achievement.dat file?
Posted: Fri Dec 13, 2024 9:28 pm
by alecika
eugenekay wrote: Fri Dec 13, 2024 9:16 pm
The "random characters" are the Data itself. The
Factorio Wiki gives specific information on which achievements use integer/bool/double types etc, but it is out-of-date for 2.0.
Screenshot 2024-12-13 161319.png
You can use a Hex Editor to see (and modify) the raw Binary data. I use
Notepad++ with the "HEX-Editor" plugin installed. Here, I have highlighted the "0b" value for the "visit-gleba" achievement (which I have Earned in-game). Achievements which are still Locked seem to have the Value "00".
Good Luck!
THANK YOU SO SO MUCH!!! Ok, I might be able to understand now. Only one question, how do I open the code in Notepad++? I tried doing it with the "open with" option but got this
- 12-13-2024, 23-28-39.png (66.15 KiB) Viewed 287 times
EDIT: I also tried doing Plugins -> Converter -> ASCII to HEX but nothing happened ( It only works if I select text without the symbols)
Re: How do I modify the contents of the achievement.dat file?
Posted: Fri Dec 13, 2024 9:31 pm
by eugenekay
You need to install the "HEX Editor" plugin.
Plugins Menu --> Plugins Admin, Search
After it is installed, enable it in the Plugins Menu --> HEX-Editor --> View in HEX
Re: How do I modify the contents of the achievement.dat file?
Posted: Fri Dec 13, 2024 9:36 pm
by alecika
eugenekay wrote: Fri Dec 13, 2024 9:31 pm
You need to install the "HEX Editor" plugin.
Plugins Menu --> Plugins Admin, Search
After it is installed, enable it in the Plugins Menu --> HEX-Editor --> View in HEX
okkk got it, thank you! Now how do I know which achievement I'm working on? What's the start of every achievement? Or is it just guessing? You highlighted the "visit gleba" achievement (with the 0b address). Does every achievement begin with 0b? Like the string begins at 0b and ends.. where? And how do I reset them?
Re: How do I modify the contents of the achievement.dat file?
Posted: Fri Dec 13, 2024 9:44 pm
by eugenekay
The file format appears to be self-created by the Factorio dev team; it is a dump straight from the internal (binary) representation in the game.
"0b" is the entirety of the Value;
"00" is a NULL space
"0e" is the start of the next achivement, which is named "visit-vulcanus" (aka "76 69 73 69 74 2d 76 75...")
I think that changing the Value to "00" will clear the Achievement flag? This format is not exactly user-friendly, heh.
Re: How do I modify the contents of the achievement.dat file?
Posted: Fri Dec 13, 2024 9:49 pm
by alecika
eugenekay wrote: Fri Dec 13, 2024 9:44 pm
The file format appears to be self-created by the Factorio dev team; it is a dump straight from the internal (binary) representation in the game.
"0b" is the entirety of the Value;
"00" is a NULL space
"0e" is the start of the next achivement, which is named "visit-vulcanus" (aka "76 69 73 69 74 2d 76 75...")
I
think that changing the Value to "00" will clear the Achievement flag? This format is not exactly user-friendly, heh.
You are so right about the user-friendly part.
The thing is, now that I'm looking at my file, I don't have the same achievements as you?(the file contains only the unlocked achievements) I looked at your screenshot and you have "visit-gleba" - well I don't. I'll try tinkering with it see what works, but It's such a mess. You suggested changing the value to "00". Changing the value to what? "0e" or "0f" or etc ?
Re: How do I modify the contents of the achievement.dat file?
Posted: Fri Dec 13, 2024 11:21 pm
by alecika
eugenekay wrote: Fri Dec 13, 2024 9:44 pm
The file format appears to be self-created by the Factorio dev team; it is a dump straight from the internal (binary) representation in the game.
"0b" is the entirety of the Value;
"00" is a NULL space
"0e" is the start of the next achivement, which is named "visit-vulcanus" (aka "76 69 73 69 74 2d 76 75...")
I
think that changing the Value to "00" will clear the Achievement flag? This format is not exactly user-friendly, heh.
Hey man I just wanted to let you know that I managed to kind-of work this out. I don't need to open the file in the Hex editor, I just need to know what to delete from that file. Deleting this will reset the circuit veteran achievement:
- 12-14-2024, 01-20-30.png (7.52 KiB) Viewed 210 times
But thank you so much for giving me hope, honestly if no one responded I don't think I would've waste my time figuring it out.
Re: How do I modify the contents of the achievement.dat file?
Posted: Sat Dec 14, 2024 3:09 am
by IsaacOscar
For anyone who likes programming, here is my attempt at writing a Javascript converter to/from JSON.
I gave up as I couldn't work out the format & size of the data that is stored for each of the new achievement types (see
https://wiki.factorio.com/Achievement_file_format for the known ones).
But if anyone can work that out, I can easily finish my converter.
Bassically the 'const achievement_types' in my linked file is incorrect.