Portal Knights

Portal Knights

View Stats:
 This topic has been pinned, so it's probably important
Zormac Feb 25, 2018 @ 5:17am
2
[PSA] For those having trouble with file names and folder paths
Are you having trouble with the names of the files in your folder? Don't know which ones to backup? Want to transfer your single game save to the dedicated server? Your problems are over!

After several tests, I have figured out (most of) the syntax used for file names. Here are my findings:

Table of Contents
  1. Folder locations
  2. File overview
  3. Session files
  4. Character files
  5. World and island files
  6. .backup files
  7. Dedicated server


1. Folder locations

There are 3 folders that you need to know:

Cloud Save Folder
This is where the files that get synced with Steam cloud are located. The default path for Windows is:
C:\Program Files (x86)\Steam\userdata\"your_ID"\374040\remote\
You might have installed Steam in a different folder or disk, such as D:\Games\Steam (for example). You can use your system's search tool to locate it. Alternatively, you can right-click any game in your library and select "Properties", "Local Files" and then "Browse Local Files...". After that, you can navigate up to Steam's root folder.

NOTE: Be careful altering files in this folder, as changes will sync with Steam cloud save, and might sometimes be undone or become permanent against your will. Always keep a backup of these files before attempting to make any change. If you are going to experiment with your files, use the local save folder instead.

Local Save Folder
Files in this folder do not get synced with Steam cloud. The default path for Windows is:
C:\Users\"your_user"\Saved Games\portal_knights\
To force Portal Knights to use this folder, right-click Portal Knights in your Steam library and select "Properties", "Updates" and deselect the box "Enable Steam Cloud synchronization for Portal Knights". To start using your Steam cloud folder again, simply select that box again.

NOTE: Changes to this folder never synchronize with Steam cloud. Use this folder to experiment with your files. You should keep a backup of these files before attempting to make any change.

Dedicated Server Save Folder
Files in this folder are used by your dedicated server. The default path for Windows is:
"dedicated_server_path"\savedata\
Change "dedicated_server_path" to the folder where you extracted the "dedicated_server.zip" files.

NOTE: Changes to this folder never synchronize with Steam cloud. Keep a backup of your server files before attempting to make any change.


2. File overview

In every folder, the files follow the same formula - a string of 16 characters and no file extension. Sample file name:
040000000200050b
The string has blocks of numbers in hexadecimal which show relevant information about the data saved in that file. In this sample, the 04 shows this is an island file, the 02 indicates the world is saved on slot 3 and the blocks 05 0b represent island 5-12. Read more on that below.


3. Session files

The game creates a file for the current game session. This file is generated each time you start the game and it is not important to backup. The file is named:
0000000000000000
The dedicated server also creates a session file, named:
0500000000000000
The reason they chose to give the server file the "05" header is because the dedicated server application was released several months after they had picked 00-04 for other file types.

NOTE: Only the file beginning with 05 is required by the dedicated server to run, but it will be automatically generated every time.


4. Character files

There are only two character files, regardless of how many characters you have:
0100000000000000 0200000000000000
The first one, with the 01 header, contains all the information for all your characters. This file is updated every time you start playing with a character or make changes to their inventory, equipment or stats, or over time during the autosave. Renaming, moving or deleting this file WILL REMOVE ALL YOUR CHARACTERS from the character selection screen. Be careful when handling this file and keep a backup before making any change.

The file with the 02 header is a backup. If anything happens to the 01 file, you will be prompted in the character selection screen to restore your most recent backup from this file. Renaming, moving or deleting this file will make it impossible to restore characters lost due to problems with the other file. It is generally a good idea to keep a backup of this file.

NOTE: These files are not required by the dedicated server and should not be copied to the .\savedata\ folder.


5. World and island files

There are two sets of files containing information of your world. The first one starts with 03 and contains world data such as world size and name. There is a single one for each world saved, and this is the file that shows each world after the character selection screen. Sample world files:
0300000000000000 0300000000000001 0300000000000002
The slot where the world is saved is shown by the last digit, starting at 0 for slot 1, then 1 for slot 2, and 2 for slot 3. Renaming this file will not change the slot where the world is saved. The file name simply reflects the data contained in the file, so altering the file name does not alter any world data. Renaming, moving or deleting this file WILL REMOVE YOUR WORLD from the world selection screen. Keep a backup of these files.
These files are generated when you start a new world and updated as you play.

NOTE: A single one of these files is required by the dedicated server to load your world, but it will only read the file ending in 0. Only the first world can be transferred to the dedicated server folder. Do not rename the files to force them to end in 0, as it will not work.

The second set of files is a large group starting with 04. Each of these files contain information for a single island of each world. Sample island files:
0400000000000100 0400000000000101 040000000100020e 0400000002000516
It is important to learn to understand these file names. In the middle of the string, there is a number (0, 1, or 2) which indicates which world the island belongs to - 1, 2 or 3. The last four digits show which island it is, in hexadecimal[en.wikipedia.org].

In these examples, the first two file names show islands in world 1 (there are only zeroes in the middle). The first one is 1-01 and the second one is 1-02. Note that while the first part of the island number starts at 1, the second part of the island number and the world number both start at 0. This is why 0100 is 1-01 and 0101 is 1-02.
Using the same thought process, we can see that the third example is island 2-15 (0e = 14 in decimal) from world 2, and the last one is island 5-23 (16 = 22 in decimal) from world 3.

Renaming these files will not change the world the islands belong to. The file names simply reflect the data contained in them, so altering the file names does not alter any island data. Renaming, moving or deleting these files WILL DESTROY CHANGES to the respective island. Keep a backup of these files.
These files are generated when you travel to a new island, and are updated as you make changes to the environment.

NOTE: All the island files associated with world 1 (files with a 0 as the 10th digit) are required by the dedicated to load your world. Files with 1 or 2 in the middle will be ignored and should not be copied. Do not rename the files, as it will not work.

(Hexadecimal: You can use an online converter[www.binaryhexconverter.com] or any scientific/programmer calculator on your computer or phone, but it is relatively simple to calculate it mentally. The numbers go from 0 to 9 and then continue from a to f, where a=10, b=11, etc. Once you reach f, you add one to the next number and continue, as you would with decimals. After f (15) comes 10 (16). That 1 represents 16 and the next number keeps adding. 1a = 16+10 = 26, 3b = 48+11 = 59, and so on).


6. .backup files

Every time your game or server updates any of the files, it renames the previous one adding the ".backup" extension. While these files are not required by either the game or the server, it is generally a good idea to keep them. You can safely remove any .backup file that is not needed anymore.


7. Dedicated server

The server will always generate files that it cannot find. In order to load your world, you need to copy the files from either your .\remote\ or .\portal_knights\ folders (see "1. Folder locations" above), whichever has the most recent version. The required files are:
0300000000000000 0400000000000100 0400000000000101 0400000000...etc
The first one is the world file and all the others are island files (see "5. World and island files" above). Only copy the world file ending in 0, and the island files with 0 as the 10th digit (all zeroes after the 4 and before the last 3 digits). For example, do NOT copy 0300000000000001 (world file ending in 1) and do NOT copy 040000000200020e (island file with 2 in the middle). The dedicated server cannot access those files.

NOTE: Never attempt to rename world and island files. The information is inside the file and not in its name. You cannot trick the game or the server into reading the file by changing its name, and you might corrupt the file.



I hope this could help you understand the way the game handles files. If you find any bit of information to be inaccurate or outdated, please let me know so I can fix the guide!
Last edited by Zormac; Feb 25, 2018 @ 6:10am
< >
Showing 1-15 of 32 comments
Zormac Feb 25, 2018 @ 1:37pm 
Perhaps someone could pin this if they find it useful? :)
Plukkie070 Feb 25, 2018 @ 5:06pm 
Thanks for the effort to explain all this, not that i get it right away.
The file numbering is just confusing to me, well not that i do anything with it currently, but i know back in the day it was easier to know which file / folder belonged to what island.

But like i said, Thank you for explaining all this.
TOMOKI Feb 25, 2018 @ 5:28pm 
Is there a way to regenerate dedicated server's islands?
Zormac Feb 25, 2018 @ 6:35pm 
Originally posted by Oshki:
Thanks for the effort to explain all this, not that i get it right away.
The file numbering is just confusing to me, well not that i do anything with it currently, but i know back in the day it was easier to know which file / folder belonged to what island.

But like i said, Thank you for explaining all this.
It took me a while to make sense of it. Basically it's 01 for characters, which you don't need for dedicated servers, then 03 for worlds and 04 for islands. I just thought the numbers in the end were random, until I noticed that loading map 1-01 updated the file ending in 100, then 1-02 updated 101, 1-03 updated 102... That's when it hit me that they were in order, matching the island numbers. I also noticed that the island files either had only zeroes in the middle, or a 1 or 2, and that they matched the world position.


Originally posted by TOMOKI:
Is there a way to regenerate dedicated server's islands?
As far as I know, there isn't a tool for that. But you could just move the respective files out of the folder and the server will generate new ones. You might want to avoid moving the vacant islands and the Home map, though.
Alternatively, you could put all the files in the local save folder and disable Steam cloud save (see the guide above), then launch the game and use the regenerate option from the world menu, then move the files back to the server folder. I think this method is safer.
Last edited by Zormac; Feb 25, 2018 @ 6:37pm
Hi guys,
wow awesome work Zormac, so I can drop that from my forum ToDo list ^^.
Thank you for your investigations, all the informations are correct.
Thread has been pinned :)
Zormac Feb 26, 2018 @ 8:58am 
Originally posted by Keengames_Developer:
Hi guys,
wow awesome work Zormac, so I can drop that from my forum ToDo list ^^.
Thank you for your investigations, all the informations are correct.
Thread has been pinned :)
Thank you for the feedback!
Hopefully the dedicated server limitations will be temporary, right? Like a config file variable to select the world to load/save and some admin tools to regenerate islands and change the home? Maybe a webadmin for that?
Originally posted by Zormac:
Originally posted by Keengames_Developer:
Hi guys,
wow awesome work Zormac, so I can drop that from my forum ToDo list ^^.
Thank you for your investigations, all the informations are correct.
Thread has been pinned :)
Thank you for the feedback!
Hopefully the dedicated server limitations will be temporary, right? Like a config file variable to select the world to load/save and some admin tools to regenerate islands and change the home? Maybe a webadmin for that?

We will definitely work on improvements for the dedicated server feature. Currently it is more a beta feature but we don't wanted to hold it back any longer :)
Artorias Apr 23, 2018 @ 4:14pm 
Just saw your post. My guide can supplement this information as well. I've listed the hex ids for most islands. https://steamcommunity.com/sharedfiles/filedetails/?id=1367092777
Last edited by Artorias; Apr 23, 2018 @ 4:32pm
theƦoach Jun 8, 2018 @ 1:20pm 
I'm trying use a universe from a friend, and i cant :(
Zormac Jun 8, 2018 @ 3:23pm 
Originally posted by theRoach:
I'm trying use a universe from a friend, and i cant :(
What's going on? Add me and I might be able to help you.
VOID_TRAVELER Jul 10, 2018 @ 12:19am 
This guys a real champion of the realm lol. Someone give an item a reference to his heroic deeds!
карма Feb 6, 2019 @ 1:18am 
hey guys im gay )))
Artorias Feb 6, 2019 @ 7:44pm 
good for you?
MaxiToad Feb 9, 2019 @ 7:01am 
It's cool
Zordah Jul 4, 2019 @ 10:56pm 
Originally posted by Zormac:
7. Dedicated server

The server will always generate files that it cannot find. In order to load your world, you need to copy the files from either your .\remote\ or .\portal_knights\ folders (see "1. Folder locations" above), whichever has the most recent version. The required files are:
0300000000000000 0400000000000100 0400000000000101 0400000000...etc
The first one is the world file and all the others are island files (see "5. World and island files" above). Only copy the world file ending in 0, and the island files with 0 as the 10th digit (all zeroes after the 4 and before the last 3 digits). For example, do NOT copy 0300000000000001 (world file ending in 1) and do NOT copy 040000000200020e (island file with 2 in the middle). The dedicated server cannot access those files.

Is this still the case? I want to set up a dedicated server but the world I am playing is the second one that I made and so is numbered 0300000000000001

Is there any workaround that will allow me to set up a dedicated server with THAT world?
< >
Showing 1-15 of 32 comments
Per page: 1530 50