How do I modify the contents of the achievement.dat file?

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
User avatar
alecika
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Jan 09, 2023 8:32 pm
Contact:

How do I modify the contents of the achievement.dat file?

Post 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?
eugenekay
Fast Inserter
Fast Inserter
Posts: 165
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: How do I modify the contents of the achievement.dat file?

Post 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
Screenshot 2024-12-13 161319.png (930.64 KiB) Viewed 286 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!
User avatar
alecika
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Jan 09, 2023 8:32 pm
Contact:

Re: How do I modify the contents of the achievement.dat file?

Post 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
12-13-2024, 23-28-39.png (66.15 KiB) Viewed 284 times
EDIT: I also tried doing Plugins -> Converter -> ASCII to HEX but nothing happened ( It only works if I select text without the symbols)
Last edited by alecika on Fri Dec 13, 2024 9:33 pm, edited 1 time in total.
eugenekay
Fast Inserter
Fast Inserter
Posts: 165
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: How do I modify the contents of the achievement.dat file?

Post 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
User avatar
alecika
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Jan 09, 2023 8:32 pm
Contact:

Re: How do I modify the contents of the achievement.dat file?

Post 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?
eugenekay
Fast Inserter
Fast Inserter
Posts: 165
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: How do I modify the contents of the achievement.dat file?

Post 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.
User avatar
alecika
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Jan 09, 2023 8:32 pm
Contact:

Re: How do I modify the contents of the achievement.dat file?

Post 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 ?
User avatar
alecika
Burner Inserter
Burner Inserter
Posts: 9
Joined: Mon Jan 09, 2023 8:32 pm
Contact:

Re: How do I modify the contents of the achievement.dat file?

Post 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
12-14-2024, 01-20-30.png (7.52 KiB) Viewed 207 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.
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: How do I modify the contents of the achievement.dat file?

Post 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.
Attachments
factorio.achievements.mjs.txt
(12.31 KiB) Downloaded 10 times
Post Reply

Return to “Technical Help”