User blog:Skuldomg88/Documenting the game tables

Introduction
All game data is stored in the Program Directory\Portia_Data\StreamingAssets\CccData\LocalDb.bytes table. By copying it to another directory and renaming the extension to .db it can be treated as a regular SQL table and read with, for example, DB Browser for SQLite. In this blog I will do my best to document what the tables contain. For now it is mainly for myself but maybe other people can get something out of this too.

'''Note that these tables only contain textual game data, NOT actual textures, sounds or anything to that regard. To extract textures or sounds, you will need a program like Unity Bundle Extractor.'''

Tables interesting for modding
Here I will list tables that are immediately relevant for modding major game aspects. Always backup your original game files and modify any tables at your own risk.

Translation_hint
Arguably the most important table when it comes to decoding other tables. Here all the game's text is stored in English, Chinese, German and French. Each text line has their own unique ID. By cross-referencing these with other tables you can find out exactly what is being referenced.

 ID: The text ID. English: English text Chinese: Chinese text VoiceID German: German text French: French text 

Props_total_table
Contains all items in the game, along with interesting fields like Buy/Sell price etc. Also contains the Props_Id which other tables use. In combination with the Translation_hint table, we can figure out what item is being referenced in other tables.

 Props_Id: Unique item ID</li> Props_Name: Text ID of the item name (lookup via Translation_hint</li> ...</li> </ul>

NpcRepository
Contains all NPCs in the game, along with interesting fields like Gift list, Height, Weight, etc.

 Id</li> Name: Text ID of the NPC name (lookup via Translation_hint</li> ...</li> </ul>

Synthesis_table
Contains crafting recipes.

 Synthesis_Id</li> Name: Text ID of the crafted item's name</li> Item_Id: ID of the crafted item (lookup via Props_total_table, Props_Id)</li> Furniture_Id</li> Item_Label</li> Data_one_id: ID of the first ingredient (lookup via Props_total_table, Props_Id)</li> Data_one_number: How many of the first ingredient is needed? (ie. need 1 Wheat to craft 1 Flour)</li> Data_two_id: ID of the second ingredient</li> Data_two_number: How many of the second ingredient is needed?</li> <li>Data_three_id: ID of the third ingredient</li> <li>Data_three_number: How many of the third ingredient is needed?</li> <li>Game_level</li> <li>Product_list</li> <li>Exp: Experience earned for crafting this item (always 10)</li> <li>...</li> </ul>

Minor Tables
I will just go through them in alphabetical order and list all their columns with a description if I have any.

Ability_Tree
<ul> <li>Branch: 0-2. Seems to indicate what skill tree the ability belongs to</li> <li>Class: 0-4</li> <li>Number: 1-5</li> <li>Upper_Limit: 1-5</li> <li>Icon: Filepath to the ability's icon</li> <li>Name: ID of the ability name text</li> <li>Description: ID of the ability description text</li> <li>Para_List: Name of the parameter list, for example HpMax_0.05</li> </ul>

Achievement
<ul> <li>id: ID starting from 1001</li> <li>platformTag: Contains short names for the achievement, for example M_FIRST_DAY or M_ACK</li> <li>sid: Another ID starting from 1</li> <li>type: Categorization, contains entries such as FinishTask or KickTreeTimes. Formulates the achievement requisite together with the following columns.</li> <li>checkType: Condition, together with the previous and next values it formulates the achievement prerequisite. An entry reads for example NumberEquals or NumberGreater.</li> <li>mainPara: Main parameter for the achievement prerequisite.</li> <li>subPara: Sub parameter for the achievement prerequisite. For the achievement for picking up Animal Feces for example, these columns will read: PickItemTimes - Number Greater - 499 - 4000135, meaning the player will have to pick the item with the ID 4000135 up more than 499 times in order to trigger the achievement.</li> <li>name: ID of the achievement's name text</li> <li>description: ID of the achievement's description text</li> <li>iconPath: All entries are 0.</li> <li>isSecret: Is the achievement a hidden achievement or not? (0/1 values)</li> <li>isFunctional: All entries are 0.</li> </ul>

ActionInterrupt
Seems to define what actions can be interrupted by other actions.

<ul> <li>Id</li> <li>Name: Contains the action's name, ie. Idle or Jump</li> <li>Interrupt: ID of the actions that interrupts this action (?)</li> <li>Parallel: ID of the actions that can run parallel to this action (?)</li> </ul>

Others
This section contains tables which I don't believe are important/relevant.

<ul> <li>_InteractItem_old_20180531: This table is empty</li> <li>AccMission_Dialog: Only contains one entry, not sure if this is even used</li> <li>Ability_Tree_New: Same as Ability_Tree but with an additional ID column. Also contains the same exact entries. </ul>

How to mod
Now how do we actually mod something? If you took a look at the table section above, you will already have noticed that some aspects are easily modified while others are more obscure. Let's start with something relatively easy - let's say we want to modify a crafting recipe.

Modding crafting recipes
When I'm actually playing the game and not digging through it's core, I like to plant. What bothers me is that using fertilizer is actually a losing business - if I buy all my fertilizer supplies I lose money because it is so expensive that the plants I sell break me even. And the game's original crafting recipe (2 Animal Bones, 1 Mucus, 2 Animal Feces) is no good for mass producing fertilizer either since Mucus is relatively hard to come by. So let's change the recipe to something more realistic and feasible: 2 Soil and 1 Animal Feces.

First we need to find the Crafting Recipe for Fertilizer, so we look at the Synthesis_table. Here we can find the Name column. This one tells us the text ID of the item's name. That is coded in our Translation_hint table. So now we work our way backwards.

1. Search for Fertilizer in Translation_hint. The first result (Apply Fertilizer) is not interesting for us, since that seems to be text used elsewhere. The second result is our suspect - we find that the text Fertilizer has the ID 270210.



2. Back to the Synthesis_table. Search for the ID we just found in the Name column. Here we find the recipe for Fertilizer. We discover the IDs of the used items. If we wanted to, we could verify that we have the right suspect by looking them up in the Props_total_table and check their Props_Id and Props_Name.



3. Now that we have found our crafting recipe, we need to find out the IDs for our new ingredients. We do that by finding them in the Props_total_table. You know how the drill works by now. We find out that Soil has the ID 4000008 and Animal Feces 4000135.



The hard part is over! Now we just change Data_one_id to 4000008 (Soil), Data_one_number to 2, and Data_two_id to 4000135 (Animal Feces) and Data_two_number to 1. We delete the values for Data_three_id and Data_three_number. Now save the database, rename it back from LocalDb.db to LocalDb.bytes and replace it in the game's folder.



After loading the game back up and excitedly running to our Blender, we find:



Success!