Re-Enable Achievements...

Post all other topics which do not belong to any other category.
eidolonFIRE_XI
Inserter
Inserter
Posts: 21
Joined: Wed Mar 04, 2015 9:38 pm
Contact:

Re-Enable Achievements...

Post by eidolonFIRE_XI »

So, achievements are disabled in a map if ANY console command is used. I learned this the hard way.

I've got 50ish hours in a map and I use the console command to check the evolution rate. Little did I know this would ruin my whole game since I can no longer get the achievements I was working toward.
There was no warning and it doesn't even make sense for this command! (it's not cheating is it?)

Is there a way to clear this flag in the save-file so I can continue where I left off and get the achievements I've been working so hard for?
Frightning
Filter Inserter
Filter Inserter
Posts: 813
Joined: Fri Apr 29, 2016 5:27 pm
Contact:

Re: Re-Enable Achievements...

Post by Frightning »

Technically it is cheating, you normally don't get to know what the evolution rate is (you can estimate it be looking at the distribution of biter types you're seeing). A warning message the first time you would do something that would disable achievements would be nice; with the option to not do that thing).
Xelephant
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sat Mar 26, 2016 6:58 pm
Contact:

Re: Re-Enable Achievements...

Post by Xelephant »

Which command did you use? Using /evolution doesn't disable achievements for me.
eidolonFIRE_XI
Inserter
Inserter
Posts: 21
Joined: Wed Mar 04, 2015 9:38 pm
Contact:

Re: Re-Enable Achievements...

Post by eidolonFIRE_XI »

From here:

https://wiki.factorio.com/index.php?title=Console

I got:

/c game.player.print(game.evolution_factor)

edit: just testing "/evolution". It worked. I wish I would've know about this command.
User avatar
Pyrii
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Jul 02, 2016 5:21 pm
Contact:

Re: Re-Enable Achievements...

Post by Pyrii »

We had the same problem with the /color command, we didn't know it existed so used the console and botched a world/save. That wiki desperately needs reworking to stop other people falling into this trap for non-console commands.
eidolonFIRE_XI
Inserter
Inserter
Posts: 21
Joined: Wed Mar 04, 2015 9:38 pm
Contact:

Re: Re-Enable Achievements...

Post by eidolonFIRE_XI »

My budy and I are both software engineers so we took a shot at editing the save ourselves... but concluded that factorio is extremely well optimized and moves memory around a lot. There was also a lot in the save file that didn't seem to make sense unless it was compressed. We were hoping it would just be an enum we could just toggle but apparently factorio dev team is way to good to do something silly like that. :D

We ended up just starting the map over. Learning the hard way is never fun. This time we will just not worry about checking the evolution rate.
iame6162013
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Jun 09, 2014 7:44 am
Contact:

Re: Re-Enable Achievements...

Post by iame6162013 »

Has anybody figured out yet how to do this? It's quite annoying, sigh.
User avatar
Phillip_Lynx
Filter Inserter
Filter Inserter
Posts: 541
Joined: Mon Jul 21, 2014 6:00 pm
Contact:

Re: Re-Enable Achievements...

Post by Phillip_Lynx »

Reenabling achivements is easy.

Just start a new vanilla game. The new factory will be way better than the old one :).
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Re-Enable Achievements...

Post by daniel34 »

If you have some experience with savegame manipulation and a decent hex editor it's possible to patch the savegame and re-enable achievements after console commands have been used. It took me about 1.5 hours to find out how to do it and i've been able to fix all of the 5 different savegames I tried it on.

The "console commands have been used" flag is actually only 1 byte (well, technically 1 bit) near the end of the file that is set to 0 if none have been used or 1 if some have been used. Finding that out was the easy part, the hard part was to find out where that value is stored in different savegames.

I'm not sure if I should post direct instructions on how to fix a savegame or give any more hints, since the devs put this limitation in for a good reason and if they had intended that savegames could be fixed by players they would have included that functionality or already mentioned a workaround/fix.
quick links: log file | graphical issues | wiki
Zaflis
Filter Inserter
Filter Inserter
Posts: 512
Joined: Sun Apr 24, 2016 12:51 am
Contact:

Re: Re-Enable Achievements...

Post by Zaflis »

If you used a console command just recently there is still an autosave from before that you can turn back to.
iame6162013
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Jun 09, 2014 7:44 am
Contact:

Re: Re-Enable Achievements...

Post by iame6162013 »

daniel34, thank you for the information that it can be done and that it is as simple as a single bit being set near the end of the file. But I have one question since I have been unable to find where this bit is, does it have a general location that is always the same, I know you said that it's hard to find though. like below nauvis? or below the "2016-06-28_Factorio_0.13.0.lua"s. Or should I look between (what looks to me) like some chunk data above nauvis.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Re-Enable Achievements...

Post by daniel34 »

iame6162013 wrote:daniel34, thank you for the information that it can be done and that it is as simple as a single bit being set near the end of the file. But I have one question since I have been unable to find where this bit is, does it have a general location that is always the same, I know you said that it's hard to find though. like below nauvis? or below the "2016-06-28_Factorio_0.13.0.lua"s. Or should I look between (what looks to me) like some chunk data above nauvis.
You're close. It's after nauvis, but on most maps very close to it. For the first two maps I used nauvis + constant offset to find the correct location of the byte, but on the third map there was a lot of data after nauvis and before the byte, almost 2mb. I then used the earlier maps to find another hexadecimal string (3 bytes) with constant offset to the byte, on all 5 maps I've tested searching for that string and adding the offset leads to the correct byte.
quick links: log file | graphical issues | wiki
iame6162013
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Jun 09, 2014 7:44 am
Contact:

Re: Re-Enable Achievements...

Post by iame6162013 »

daniel34 wrote:You're close. It's after nauvis, but on most maps very close to it. For the first two maps I used nauvis + constant offset to find the correct location of the byte, but on the third map there was a lot of data after nauvis and before the byte, almost 2mb. I then used the earlier maps to find another hexadecimal string (3 bytes) with constant offset to the byte, on all 5 maps I've tested searching for that string and adding the offset leads to the correct byte.
I found the byte in my simple (vanilla) test case and also in my modded game. But sadly I haven't yet found the offset bytes just yet not that I needed them(although my modded save's achievement byte was far below nauvis). A really handy thing I found is that in both cases the achievements byte was followed by a 1 so it would really stand out as a "01 01" in the hexeditor(I don't know if that's true for all saves I only tried two).

Thank you, I didn't want my 100+ hour save to go to waste.
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Re-Enable Achievements...

Post by Qon »

daniel34 wrote:I'm not sure if I should post direct instructions on how to fix a savegame or give any more hints, since the devs put this limitation in for a good reason and if they had intended that savegames could be fixed by players they would have included that functionality or already mentioned a workaround/fix.
Lol no. Mods can execute any commands without disabling achievements. Lua has loadstring so you can even make mods that take a string in an input field and then executes it exactly as if you wrote it in console but without disabling achievements.
/doc-html/LuaPlayer.html#LuaPlayer.unlock_achievement wrote:unlock_achievement(name)

Unlock the achievements of the given player. This has any effect only when this is the local player and the achievement isn't unlocked so far.
Parameters
name :: string: name of the achievement to unlock
And this is how easy achievements are to get with commands/mods (same thing really).


Which means there is 0 penalty for mods, just load your save without mods and get them sent to steam if you want to.

Please make a detailed description or a program that re-enables achievements on a save. Otherwise I guess I'll have to make a mod that unlocks any achievements and gives you a console that doesn't break achievements so that the devs will understand... I really can't stand the inconsistensy in their achievement policy :|
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Dogman_27
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Aug 09, 2016 8:54 am
Contact:

Re-enable achivements?

Post by Dogman_27 »

merged with existing topic, see the discussion above --daniel34

So I and my friend have this pretty decent factory 40 hours in and I noticed that we were not getting any achievements because my friend wanted to change his color with /c and not with /color. So does anyone how to get the achievements on again?

Sorry if the English is crap.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Re-Enable Achievements...

Post by daniel34 »

Qon wrote:
daniel34 wrote:I'm not sure if I should post direct instructions on how to fix a savegame or give any more hints, since the devs put this limitation in for a good reason and if they had intended that savegames could be fixed by players they would have included that functionality or already mentioned a workaround/fix.
Lol no. Mods can execute any commands without disabling achievements. Lua has loadstring so you can even make mods that take a string in an input field and then executes it exactly as if you wrote it in console but without disabling achievements.
The limitation I mentioned is being unable to 'fix' a save to keep getting achievements (modded or not) after console commands already have been used in that save.
Qon wrote:
/doc-html/LuaPlayer.html#LuaPlayer.unlock_achievement wrote:unlock_achievement(name)
Unlock the achievements of the given player. This has any effect only when this is the local player and the achievement isn't unlocked so far.
Parameters
name :: string: name of the achievement to unlock
And this is how easy achievements are to get with commands/mods (same thing really).
[...]
Otherwise I guess I'll have to make a mod that unlocks any achievements and gives you a console that doesn't break achievements so that the devs will understand... I really can't stand the inconsistensy in their achievement policy :|
Achievement progress is stored in two files, achievements.dat (for vanilla) and achievements-modded.dat. Your way to get achievements (in vanilla and Steam) won't work because achievements are only counted when they are unlocked while no mods are loaded. Calling unlock_achievement in a mod will only unlock the achievement for modded games, it won't show up in vanilla games or on Steam even if you remove the mod afterwards.

Most of us are aware of several ways to get/cheat achievements:
  1. Use of third-party tools (for Steam achievements)
  2. Use mods and remove them afterwards (there's even a Bug report, according to the devs it's not worth fixing)
  3. Modifying the freeplay scenario (another Bug not deemed worth fixing)
  4. Modifying the contents of achievements.lua
All the methods listed above do require a little bit of technical understanding but can be done by most players if they are determined to do so.

I believe that the majority of players who want to re-enable achievements want to do so because they accidentally used a console command (color change with /c for example) without realising this would disable achievements for that save. They probably didn't want to cheat (as there are easier options mentioned above) and only want to re-enable achievements to keep getting them legitimately.
quick links: log file | graphical issues | wiki
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Re-Enable Achievements...

Post by daniel34 »

These are the steps to fix a save that has achievements disabled because of console commands, make sure you understand them before attempting them:
  1. Get a Hex editor if you don't have one yet (I recommend HxD, also has portable versions)
  2. Make a backup of the save file (.zip) somewhere else
  3. Extract the save (.zip-File) and delete the .zip file afterwards so only the extracted folder stays
  4. Open the level.dat file in the Hex editor
  5. Search for the hex string 6A D8 40 (in HxD go to Search --> Find, enter the string and select Hex-values as datatype)
  6. Starting from 6A select all hex bytes until the Length counter at the bottom says 81 (Note: this is a hexadecimal number, in decimal the length would be 129)
    factorio-hex.png
    factorio-hex.png (67.74 KiB) Viewed 99205 times
  7. The last byte you selected (circled red in the picture) is the byte for "achievements disabled because of console commands" and is set to 01, select it and overwrite it with 00
  8. Save the file and close the Hex editor
  9. Open Factorio and load the save
  10. Make sure achievements are actually enabled (click on the achievements icon on the top right, disabled achievements are marked red and you can't track them)
  11. Save the game under a new name
Disclaimer: I have tested this on 6 different savegames and successfully enabled achievements again on all of them, but due to the way save data is stored there are probably some edge cases this method won't work on.
Make sure you understand the instructions above before attempting them and always make a backup. I am not responsible for any savegame corruption / data loss that may result from these instructions.
quick links: log file | graphical issues | wiki
Dogman_27
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Aug 09, 2016 8:54 am
Contact:

Re: Re-Enable Achievements...

Post by Dogman_27 »

daniel34 Thank you so much!
User avatar
Cordylus
Fast Inserter
Fast Inserter
Posts: 221
Joined: Wed Jun 25, 2014 11:28 am
Contact:

Re: Re-Enable Achievements...

Post by Cordylus »

According to the strings in the Crowdin translation system there will be warning, before using the command.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Re-Enable Achievements...

Post by daniel34 »

Cordylus wrote:According to the strings in the Crowdin translation system there will be warning, before using the command.
It has already been implemented in 0.13.16:
FactorioBot wrote:
  • Changes
    • When the first LUA command is used, players are warned that it would disable achievements.
When entering a command for the first time this warning is displayed:
Using LUA console commands will disable achievements, please repeat the command to proceed.
quick links: log file | graphical issues | wiki
Post Reply

Return to “General discussion”