Skip to content

Introduction

(currently up to date with 0.13.3)

"Save file editing" is the modification of ClanGen's save files. This can range from something as simple as changing the appearance of a cat to inserting a future event.

Warning

Save file editing, while easily accessible and widely used by ClanGen's community, is not officially supported by the ClanGen team. Do not report bugs or strange behavior experienced on edited saves. Reproduce on an unedited save first.

  • clan_cats.json

    Instructions on how to edit & utilize the file clan_cats.json. Includes cat template, and deleting and adding cats.

  • clan.json

    Instructions on how to edit & utilize the file clan.json. Includes temperament calculation.

  • conditions.json

    Instructions on how to edit conditions within the saves. Includes condition templates and pregnancy.json.

  • relations.json

    Instructions on how to edit relations within the saves.

  • history.json

    Instructions on how to edit & utilize the history files for cats.

  • Future Events

    Instructions on how to utilize future events in the save files.

READ ME

Necessary Tips:

  • Keep ClanGen CLOSED while editing save files. The game is unable to properly update files that are currently in use.
  • Make a backup of the save if you're choosing to make large edits that might be irreversible.
  • Download a text editor, such as notepad++, Visual Studio code, etc. Do not use Word or Google Docs
  • Saves are in no way connected to each other.

When editing ClanGen's saves, you're going to run into JSON files the most. JSON is a lightweight, text-based data format that is readable by humans and easily generated by machines.

JSON is CASE SENSITIVE. It is vital to keep in mind that JSON is still a code file, thus expect miniscule errors (such as missing commas & brackets) to be flagged and prevent you from running the save.

Malformed

The malformed error does NOT mean your save is corrupted beyond repair, or that the game deleted your save file. It simply means something is incorrect in the clan_cats.json's formatting (aka invalid), and you'll have to use a JSON validator, such as jsonlint.com, to appropriately format the file.

If you'd like to learn more about JSON, its formatting, and how to appropriately edit them, I recommend reading through JSONlint's documentation.


Finding Save Files

To find your save files normally, the game provides an in-game shortcut from the settings screen. This is the function behind the Open Data Directory button.

If you're unable to open the game, or the button simply doesn't work for you, below are the saves PATH directory.

Windows: AppData/Local/ClanGen/ClanGen/Saves
MacOS: library/application support/ClanGen
Linux/ChromeOS: ~.local/share/ClanGen/saves

IF you're using a source version of ClanGen, your saves will be available directly from the game folder, rather than being stored elsewhere.

Finding Game Files

The game folder is in a different location for specific operating systems:

  • Windows: The game folder is what you extracted to access the .exe, or launcher.
  • MacOS: Right click the ClanGen file in "applications" and click "open contents". The game folder is "resources".
  • Linux: The game folder is what you extracted while installing manually.

(non-os specific) Source: The game folder is what you extracted to access the run files.


Save Folder Breakdown

In the saves folder, you're going to have four major components:

  • currentclan.txt: Tracks which clan the game is currently continuing with.
  • settings.json: The menu settings file, aka settings that affect every clan.
  • Clan save folder: The main save folder for a clan.
  • clan.json: A clan's clan.json, which complies information like clan name, other_clans information, "clan_cats" list, etc.

Clan Save Folder

Within the Clan Save folder is many other folders and saves that are generated as the save processes. Please do not delete files (unless instructed to). Even if they appear empty, the code looks for specific files to generate the clan.

  • conditions: Holds every cat's individual conditions JSON. This will only generate if cats have conditions applied to them.
  • disasters: Keeps a record of Clan's disasters. You should have two files in this folder: primary.json and secondary.json (unimplemented feature)
  • history: Holds every cat's individual history JSON. Each cat will have a history file connected to them.
  • relationships: Holds every cat's individual relationship history JSON. Dead cats do not have relationships.
  • faded: Holds minimum information about cats who have faded in individual JSONs. This folder will only generate if faded information is toggled on.
  • clan_cats: Where the data of all cats are stored, including outsiders and the dead.
  • clan_settings: The toggable clan settings that only affects this specific clan.
  • events: The events that generate on the event screen. Completely wipes the file with every moonskip.
  • freshkill_pile: Holds the amount of freshkill the clan has via expiration time. (not available for classic)
  • future_events: Holds "future" events triggered from specific events and patrols.
  • herb_supply: Holds the storage and the moon's collection of herbs by herb name. (does not hold storage for classic)
  • nutrition_info: Holds the nutritional needs and status of each cat. (not available for classic)
  • pregnancy: Hold the pregnancy data for each pregnant cat, such as litter number and secondary parent.

Common Player-Created Bugs

Warning

Just because a bug is not listed here, does not mean it should be reported. Remember, replicate on unedited saves before reporting.

Does your game simply crash instead of giving you an error report? Please follow the instructions provided by reporting a bug.

Malformed

The "malformed" error stems from a JSON file being invalid in its formatting. If you experience this error, do not fret! Input the JSON file into a json validator, such as jsonlint.com, to find the specific lines that are causing the file to be malformed.

Edit in the json validator until it outputs as valid, then convert all the changes to your local JSON game file. Try to run the game.

Other errors that might be due to a malformed file:

  • potential_history after editing the history files
  • "Leaf-bare" after editing the clan.json file
  • unmute_button after editing events.json, future_events.json, or pregnancy.json

Loading clan.json

The error "error when loading clan.json" without a traceback is the default error popup when there's something incorrect with (primarily) clan.json or any file outside clan_cats.json. Retrace your steps and double check your edits.

Keyword:

"Keyword" errors specifically tackle info misspells or unrecognizable imported information, such as attempting to add a modded save to the base game.

These errors are relatively straightforward. The "keyword" it mentions is the culprit, and typically you're able to just search it in the clan_cats file (or whichever file it errors for) and edit it from there.

For 0.13 beyond: the error keyword: 'pattern' is due to trying to use a 0.13 save with an outdated version of ClanGen. Since the save files were changed massively in 0.13, 0.13 saves can no longer be used across versions.

clan_bg

This is a weird error with save file editing. It means the game could not load the clan, essentially. Whatever file that was edited (normally clan_cats.json and clan.json) is incorrect in some way. Double check all your edited files to make sure their information is correct.

For example, make sure all mentions of IDs have quotes, make sure you're using recognized ranks, etc etc.

AttributeErrors

Here's a list of attribute errors for ClanGen and what they possibly mean.

'NoneType' object has no attribute 'premul_alpha'

  • Check your cats sprite information. If they have a number in quotes rather than something similar to "newborn0", then you'll have to change them to reflect the new sprite data options for 0.13.

'NoneType' object has no attribute 'name'

  • Somewhere in the file, there is an unrecognized ID being used in another cats' information. This is commonly seen when a player deletes a cat but doesn't delete the mentions of the cats ID.
  • The TraceBack message normally mentions which is being affected. Inheritance? Parents. not_working? Mentors & apprentices. Profile screen generate_column? ID was not added to clan.json.

'NoneType' object has no attribute 'status'

  • The player deleted a cat and did not also delete their ID from nutrition_info.json.
  • This error could also possibly be due to a status being edited incorrectly.