Skip to content

Archived on 2026-10-24. This is a historical implementation note, not current setup instructions or an active task list. Original claims, code examples, file paths, and completion statements have not all been revalidated. Use the current documentation and issue register for maintenance decisions.

Audit correction (2026-10-24): SavePlayerDataWithoutEncryption and LoadPlayerDataWithoutEncryption are absent from the current SaveManager. This guide cannot be used as current operating instructions.

Encryption Bypass Guide - Manual JSON Inspection

Overview

This guide explains how to use the encryption bypass methods in SaveManager to manually inspect and debug PlayerData by saving/loading it as plain JSON without encryption.

Why Use Encryption Bypass?

When you suspect issues with: 1. Encryption/Decryption failures - Data not encrypting or decrypting properly 2. Migration failures - Legacy save data not merging correctly 3. Data structure issues - Want to manually inspect the JSON structure 4. Dictionary null issues - Checking if Unity's JsonUtility is losing dictionary data

Available Methods

1. SavePlayerDataWithoutEncryption()

Saves the current PlayerData as plain JSON to a file.

File Location: {Application.persistentDataPath}/player_data_RAW.json

What it does: - Serializes current PlayerData to JSON with pretty printing - Saves to player_data_RAW.json - Prints the full JSON to Unity Console - Shows file size and location

When to use: - After creating new PlayerData (first launch) - After loading from encrypted save - After migration from legacy saves - Anytime you want to inspect the raw JSON structure

2. LoadPlayerDataWithoutEncryption()

Loads PlayerData from the plain JSON file and validates it.

What it does: - Reads player_data_RAW.json file - Deserializes to PlayerData object - Runs full diagnostic with SaveDataDebugger - Shows validation results - Does NOT apply the data yet (safety check)

When to use: - After manually editing the JSON file - To validate data structure before applying - To check if JSON can be deserialized

3. ApplyRawPlayerData()

Applies the loaded PlayerData to the active game session.

What it does: - Loads player_data_RAW.json - Replaces the active Player object - Notifies all systems via OnSaveReady event - Shows summary of applied data

When to use: - After validating with LoadPlayerDataWithoutEncryption() - To manually fix save data by editing JSON - To test modified data structures

How to Use

Step 1: Run the Game Normally

Let the game start up and create/load PlayerData normally.

Step 2: Save Without Encryption

Open Unity Console and type:

SaveManager.Instance.SavePlayerDataWithoutEncryption()

Expected Output:

╔════════════════════════════════════════════════════════════╗
║      SAVING PLAYERDATA WITHOUT ENCRYPTION (DEBUG MODE)       ║
╚════════════════════════════════════════════════════════════╝
[SaveManager] ✓ Successfully saved RAW JSON to: C:/Users/[User]/AppData/LocalLow/[CompanyName]/[AppName]/player_data_RAW.json
[SaveManager]   File size: 12345 characters
[SaveManager]   File location: Application.persistentDataPath
╔════════════════════════════════════════════════════════════╗
║                  RAW JSON CONTENT                           ║
╚════════════════════════════════════════════════════════════╝
{
  "version": "1.0.0",
  "soulPoint": 100,
  "chaosFragment": 50,
  "unlockedChar": {},
  "unlockedAchievement": {},
  "unlockedSpecialUpgrade": {},
  "shopUpgrade": {},
  "unlockedStage": {},
  "totalDataCounter": {},
  "legacyMigrated": false,
  "isFirstLaunch": false
}
╔════════════════════════════════════════════════════════════╗
║                  END OF RAW JSON                           ║
╚════════════════════════════════════════════════════════════╝

Step 3: Inspect the JSON File

Open the file location shown in the log and open player_data_RAW.json in a text editor.

Common issues to look for: - Empty dictionaries {} instead of data - Null values - Missing fields - Incorrect data types

Step 4: (Optional) Edit the JSON

You can manually edit the JSON file to: - Fix null dictionaries - Add missing data - Test different data structures

Step 5: Validate the JSON

In Unity Console, type:

SaveManager.Instance.LoadPlayerDataWithoutEncryption()

Expected Output:

╔════════════════════════════════════════════════════════════╗
║      LOADING PLAYERDATA WITHOUT ENCRYPTION (DEBUG MODE)      ║
╚════════════════════════════════════════════════════════════╝
[SaveManager] ✓ Successfully loaded RAW JSON from: C:/Users/[User]/AppData/LocalLow/[CompanyName]/[AppName]/player_data_RAW.json
[SaveManager]   File size: 12345 characters
╔════════════════════════════════════════════════════════════╗
║         SAVEDATA DEBUGGER - FULL DIAGNOSTIC               ║
╚════════════════════════════════════════════════════════════╝
[diagnostic output...]
╔════════════════════════════════════════════════════════════╗
║  DATA LOADED SUCCESSFULLY!                                  ║
║                                                              ║
║  To apply this data to current game session, call:           ║
║  SaveManager.Instance.ApplyRawPlayerData()                       ║
╚════════════════════════════════════════════════════════════╝

Step 6: Apply the Data (Optional)

If the data looks correct and you want to use it in the current game session, type:

SaveManager.Instance.ApplyRawPlayerData()

Expected Output:

[SaveManager] Applying RAW PlayerData to active session...
[SaveManager] ✓ Applied RAW PlayerData to active session
[SaveManager]   SoulPoint: 100
[SaveManager]   ChaosFragment: 50
[SaveManager]   Achievements: 0 entries

Common Use Cases

Case 1: Check if Dictionaries are Initialized

Scenario: You suspect dictionaries are null after loading.

Steps: 1. Let game load normally 2. Call SaveManager.Instance.SavePlayerDataWithoutEncryption() 3. Check console output - look for empty {} dictionaries 4. Open the JSON file to see if dictionaries exist

Expected Result:

"unlockedAchievement": {}  // Dictionary exists but empty

If Null (Problem):

// Dictionary field missing entirely from JSON

Case 2: Inspect Migrated Legacy Data

Scenario: Legacy save migration seems to fail.

Steps: 1. Delete existing save files (if any) 2. Run game with legacy saves present 3. Let migration happen 4. Call SaveManager.Instance.SavePlayerDataWithoutEncryption() 5. Check if legacy data is in the JSON

What to Check: - SoulPoint/ChaosFragment from legacy saves - Achievement data from legacy saves - Other dictionary contents

Case 3: Manually Fix Save Data

Scenario: Save data is corrupted or has null dictionaries.

Steps: 1. Save without encryption: SaveManager.Instance.SavePlayerDataWithoutEncryption() 2. Open player_data_RAW.json in text editor 3. Manually add missing data:

{
  "version": "1.0.0",
  "soulPoint": 100,
  "chaosFragment": 50,
  "unlockedChar": {},
  "unlockedAchievement": {},  // Add this if missing
  "unlockedSpecialUpgrade": {},
  "shopUpgrade": {},
  "unlockedStage": {},
  "totalDataCounter": {},
  "legacyMigrated": false,
  "isFirstLaunch": false
}
4. Save the file 5. Load it: SaveManager.Instance.LoadPlayerDataWithoutEncryption() 6. Apply it: SaveManager.Instance.ApplyRawPlayerData()

Case 4: Test JSON Serialization

Scenario: You want to verify Unity's JsonUtility is working correctly.

Steps: 1. Create new PlayerData: CreateNewPlayerData() 2. Save without encryption 3. Check the console output for the full JSON 4. Look for missing fields (especially dictionaries)

Critical Check: If you see:

"unlockedAchievement": {}  // Present
vs
// Field completely missing

The missing field indicates Unity's JsonUtility can't serialize that Dictionary type.

File Location

The JSON file is saved to:

{Application.persistentDataPath}/player_data_RAW.json

Typical locations: - Windows: C:/Users/{Username}/AppData/LocalLow/{CompanyName}/{AppName}/player_data_RAW.json - Mac: ~/Library/Application Support/{CompanyName}/{AppName}/player_data_RAW.json - Linux: ~/.config/unity3d/{CompanyName}/{AppName}/player_data_RAW.json

The exact path will be shown in the Unity Console when you save.

Important Notes

Safety

  • These methods only affect the debug file player_data_RAW.json
  • They do NOT modify your actual encrypted save file
  • You can safely test without risking your main save

OnSaveReady Event

When you call ApplyRawPlayerData(), it will: - Replace the active Player object - Fire the OnSaveReady event - This will trigger AchievementManager.LoadAchievement() and other systems

Unity JsonUtility Limitations

If you notice dictionaries are missing from JSON: - Unity's JsonUtility cannot serialize Dictionary<TKey, TValue> - You may need to use Newtonsoft.Json or create wrapper classes - This is a known limitation of Unity's built-in JSON system

Troubleshooting

Error: "File not found"

Cause: You haven't saved the JSON file yet.

Solution: Call SaveManager.Instance.SavePlayerDataWithoutEncryption() first.

Error: "Cannot save - Player is NULL"

Cause: No PlayerData has been loaded or created yet.

Solution: Make sure the game has finished initialization before calling this method.

Error: "JSON deserialization returned NULL"

Cause: The JSON file is malformed or contains invalid syntax.

Solution: Validate the JSON file using a JSON validator and fix any syntax errors.

No data in JSON after migration

Cause: Legacy save data is null or empty.

Solution: Check the SaveDataDebugger output for DebugLegacyData to see what was in the legacy saves.

Example Workflow

1. Run game
2. Wait for initialization to complete
3. Type in console: SaveManager.Instance.SavePlayerDataWithoutEncryption()
4. Check console for JSON output
5. Open file: C:/Users/[User]/AppData/LocalLow/[CompanyName]/[AppName]/player_data_RAW.json
6. Inspect data structure
7. If needed, edit the JSON file
8. Type in console: SaveManager.Instance.LoadPlayerDataWithoutEncryption()
9. Review diagnostic output
10. If valid: SaveManager.Instance.ApplyRawPlayerData()

Next Steps

After identifying the issue with the raw JSON:

  1. If dictionaries are null in JSON:
  2. The issue is in how PlayerData is initialized
  3. Check PlayerData.InitializeDefaults()

  4. If dictionaries exist but are empty:

  5. Data is being initialized but not populated
  6. Check migration logic or data loading

  7. If JSON serialization fails:

  8. Unity's JsonUtility cannot serialize Dictionary types
  9. Consider using Newtonsoft.Json instead

  10. If encryption is the issue:

  11. Compare encrypted vs unencrypted file sizes
  12. Check if decryption is producing valid JSON