In other languages:

Achievement file format: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
Line 66: Line 66:


{| class="wikitable"
{| class="wikitable"
! Achievement<br>Type !! Data<br>Type(s) !! Description
! Achievement<br>Type !! Data<br>Fields(s) !! Field(s) Description
|-
|-
| build-entity-achievement
| build-entity-achievement
|
|
*  
* byte[4]
|
|
*  
* Unknown format, 4 bytes long.
|-
|-
| combat-robot-count
| combat-robot-count
|
|
*  
* byte[4]
|
|
*  
* Unknown format, 4 bytes long.
|-
|-
| construct-with-robots-achievement
| construct-with-robots-achievement
|
|
*  
* byte[8]
|
|
*  
* Unknown format, 8 bytes long.
|-
|-
| deconstruct-with-robots-achievement
| deconstruct-with-robots-achievement
|
|
*  
* byte[4]
|
|
*  
* Unknown format, 4 bytes long.
|-
|-
| deliver-by-robots-achievement
| deliver-by-robots-achievement
|
|
*  
* byte[8]
|
|
*  
* Unknown format, 8 bytes long.
|-
|-
| dont-use-entity-in-energy-production-achievement
| dont-use-entity-in-energy-production-achievement
|
|
*  
* byte[8]
|
|
*  
* Unknown format, 8 bytes long.
|-
|-
| group-attack-achievement
| group-attack-achievement
|
|
*  
* byte[4]
|
|
*  
* Unknown format, 4 bytes long.
|-
|-
| kill-achievement
| kill-achievement
|
|
*  
* byte[8]
|
|
*  
* Unknown format, 8 bytes long.
|-
|-
| player-damaged-achievement
| player-damaged-achievement
Line 126: Line 126:
| produce-achievement
| produce-achievement
|
|
*  
* byte[8]
|
|
*  
* Unknown format, 8 bytes long.
|-
|-
| product-per-hour-achievement
| product-per-hour-achievement
|
|
*  
* byte[8]
|
|
*  
* Unknown format, 8 bytes long.
|-
|-
| research-achievement
| research-achievement
|
|
*  
* byte[4]
|
|
*  
* Unknown format, 4 bytes long.
|-
|-
| train-path-achievement
| train-path-achievement
|
|
*  
* byte[8]
|
|
*  
* Unknown format, 8 bytes long.
|}
|}

Revision as of 02:27, 12 August 2017

This is a technical description of the achievement file format, used by Factorio to store player's achievement progress in the files "achievements.dat" and "achievements-modded.dat".

Yes - this information can be used to "cheat" Factorio by simply writing to the achievement file(s) in such a way as if you had met all the achievement requirements, open up Factorio, and then suddenly have all achievements unlocked. If you've played Factorio at all you should know that this point is moot. The goal of this document is to share how to _read_ the achievement file(s) - so that third party applications can do do things with that information. Enjoy.

See the page on data types for an explanation of the different types of data used in this document.

File Format

The overall file format is as follows. Note that in this file, array length is stored as a short, not an int!

Type Description
short[4] The version string of Factorio that generated this file.
array<bytes> Achievement header info. Variable length. See the section for more information.
array<bytes> Achievement content info. Variable length. See the section for more information.
short Unknown. Always seems to equal zero. Perhaps padding?
short[*] Currently tracked achievements, given as a series of shorts up until the end of the file, with each representing the index number of an achievement. The order of achievements in this series matches the order of which the player has them tracked in game.

This format has been valid since at least version 0.14.x.

Achievement Header Info

The header contains information about what type of data fields each achievement has.

Type Description
string Achievement type. This determines what kind of data fields this achievement contains in the content array.
string Achievement string id - the one used internally by Factorio.
short Achievement index number. This number is used to map achievements between this header info array, the content info array, and the tracked achievements list in this file. These index numbers are non-normative, so they won't always match up with the same achievement.
Note: the mapping of index numbers to achievement ids are continuous, but start at index 1 (there is no index 0).

Achievement Content Info

This contains the actual data of each achievement. It's important to note that not every achievement listed in the header has a matching content section here.

Type Description
short Achievement index number. This matches up with the index number in the Achievement header info.
byte[*] The achievement's progress information. The structure and length of this is determined by the achievement's type. See the table below for a list of achievement types.

Achievement Types

If new achievement types are added in the future, the achievement files will be unparse-able. Please add any new types you find here, thanks!

Achievement
Type
Data
Fields(s)
Field(s) Description
build-entity-achievement
  • byte[4]
  • Unknown format, 4 bytes long.
combat-robot-count
  • byte[4]
  • Unknown format, 4 bytes long.
construct-with-robots-achievement
  • byte[8]
  • Unknown format, 8 bytes long.
deconstruct-with-robots-achievement
  • byte[4]
  • Unknown format, 4 bytes long.
deliver-by-robots-achievement
  • byte[8]
  • Unknown format, 8 bytes long.
dont-use-entity-in-energy-production-achievement
  • byte[8]
  • Unknown format, 8 bytes long.
group-attack-achievement
  • byte[4]
  • Unknown format, 4 bytes long.
kill-achievement
  • byte[8]
  • Unknown format, 8 bytes long.
player-damaged-achievement
  • The Maximum amount of damage a player has taken in a single hit.
  • True if the player survived that hit, False if they died.
produce-achievement
  • byte[8]
  • Unknown format, 8 bytes long.
product-per-hour-achievement
  • byte[8]
  • Unknown format, 8 bytes long.
research-achievement
  • byte[4]
  • Unknown format, 4 bytes long.
train-path-achievement
  • byte[8]
  • Unknown format, 8 bytes long.