Save file structure

Started by Galileus, November 13, 2013, 06:57:56 AM

Previous topic - Next topic

Darker

#30
Oh, this post is very usefull, thank you. Now I see there is not much clear info about "binary" grids, so here is what I've found out:

As it's obvious thanks to == at the end, they are base64 encoded binary arrays. You may have mentioned that above, I don't know.

After decoding them, you will get byte array of width*height squares, so it's simply 1 byte per square. And the codes seem to be folowing (incomplete list!):

<TerrainMap>


27Concrete
28Rough hewn rock
29Rough stone
30Smooth stone
... ? ...
36Pawed tiles
37That spaceship tiles
38Blue carpet
39Green carpet
40Red carpet
... ? ...
49Gravel
50Dirt
51Dessert



Also, roofs seem to be revealed for now:
<RoofMap>


21Metal roof
22Thin rock roof
23Thick rock roof



There is an important thing to keep in mind though: [0,0] is in bottom left corner!

Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

Darker

<LetterStack>
   
Quote
   <Letters> Located in the <Map> and contains letters similar to following:

         <Letter Class="Letter">  Letter wraper
            <Text></Text>  Letter text. Is there max length?


            <LookTarget> Determines "Jump to location behavior"
               <TargetThing>thingID or null</TargetThing> Thing id. What Ids are allowed?
               <TargetLoc>(80, 0, 74)</TargetLoc>Target coordinates, must not conflict with thing id. Z coordinate is ignored
            </LookTarget>
         </Letter>

      </Letters>
   </LetterStack>

More about <Text> so far:

Unicode characters render normaly, even insane ones, like chess symbols. This means theoretically, a UNICODE formating (underline, crosstext) should be possible.

HTML tags are stripped from the text. Does that mean HTML formating is planned, but not implemented?
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

Coenmcj

Quote from: deadbeat88 on November 13, 2013, 03:21:14 PM

<Kind>Colonist</Kind>  -- This actually links to the persons job or occupation, eg. Noble, settler, Assassin

Moderator on discord.gg/rimworld come join us! We don't bite

ItchyFlea

#33
Quote from: Coenmcj on January 09, 2014, 11:54:36 PM
Quote from: deadbeat88 on November 13, 2013, 03:21:14 PM

<Kind>Colonist</Kind>  -- This actually links to the persons job or occupation, eg. Noble, settler, Assassin

The <Kind> tag gives the pawn a description, ie: Raider, Colonist, Traveller, Psychotic, etc.
The pawn job/occupation is contained within the <Story> tag. (Specifically the <Int32>##</Int32> part)
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

ItchyFlea

The droppods you see when something is coming down from space can also be used as building's in-game.
They have a health of 500. Other than aesthetics, I don't think they have any use.
<Thing Class="Building">
<Def>DropPod</Def>
<ID>DropPod446837</ID>
<Pos>(107, 0, 99)</Pos>
<Team>Colonist</Team>
<Health>500</Health>
</Thing>
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

Darker

That's true. Also, you can add a contained thing to the drop pod:

Quote
      <Thing Class="DropPod">
         <Def>DropPod</Def>
         <ID>DropPod29875</ID>
         <Pos>(181, 0, 100)</Pos>
         <Health>500</Health>
         <TicksToOpen>200</TicksToOpen>  How long is one tick? Assume 1 ms
         <Contents>
          <ContainedThing Class="Building_TurretGun">So far, I haven't found anything that crashes the game.
             <Def>Auto-turret</Def>
             <ID>Auto-turret470207</ID>
               <Pos> Doesn't matter and can be omitted. It will be updated when thing is released. Nope, you can't warp things from drop pods around the map
             <Team>Raider</Team>
             <Health>600</Health>
             <PowerOn>True</PowerOn>
             <DesirePowerOn>True</DesirePowerOn>
          </ContainedThing>
         </Contents>
      </Thing>
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

DoomerDGR8

Hi!

How to determine the colonist's type? I.e. Oaf, Miner, etc...

The mentioned nodes under a Pawn are:
<Team>Colonist</Team>
<Kind>Colonist</Kind>

But for each of my colonist, the values are always Colonist and Colonist. How do I know what the dude is from looking at the save file?

Thanks.

ItchyFlea

Quote from: DoomerDGR8 on January 15, 2014, 01:49:06 AM
Hi!

How to determine the colonist's type? I.e. Oaf, Miner, etc...

The mentioned nodes under a Pawn are:
<Team>Colonist</Team>
<Kind>Colonist</Kind>

But for each of my colonist, the values are always Colonist and Colonist. How do I know what the dude is from looking at the save file?

Thanks.

I mentioned this just a few posts up: http://ludeon.com/forums/index.php?topic=1083.msg14981#msg14981
The save file does not contain the pawn's type. The game generates that based on the pawn's backstory, which is contained in this:
<Story>
<StoryItems>
<Int32>17</Int32>
<Int32>3</Int32>
</StoryItems>
</Story>

I don't think anybody has compiled a list of what element corresponds to what Int32 value, or how the game determines the type based on those values. If you want a bit of a laugh though, set both those numbers to 20.
All my mods are licensed under a Attribution-NonCommercial-ShareAlike 4.0 International
Ask for permission before using in ModPacks

Click here for a list of the mods I've created

DoomerDGR8

#38
Quote from: ItchyFlea on January 15, 2014, 05:20:52 AM
Quote from: DoomerDGR8 on January 15, 2014, 01:49:06 AM
Hi!

How to determine the colonist's type? I.e. Oaf, Miner, etc...

The mentioned nodes under a Pawn are:
<Team>Colonist</Team>
<Kind>Colonist</Kind>

But for each of my colonist, the values are always Colonist and Colonist. How do I know what the dude is from looking at the save file?

Thanks.

I mentioned this just a few posts up: http://ludeon.com/forums/index.php?topic=1083.msg14981#msg14981
The save file does not contain the pawn's type. The game generates that based on the pawn's backstory, which is contained in this:
<Story>
<StoryItems>
<Int32>17</Int32>
<Int32>3</Int32>
</StoryItems>
</Story>

I don't think anybody has compiled a list of what element corresponds to what Int32 value, or how the game determines the type based on those values. If you want a bit of a laugh though, set both those numbers to 20.
Sorry! I went out for a quick lunch. In fact, I have completed the list myself and didn't updated my post. Here are my findings:


   
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
NameBackstoryCodeStatus
Colony settlerAdulthood0
Medieval farm oafAdulthood1
Medieval lordAdulthood2
Urbworld entrepreneurAdulthood3
Deep space minerAdulthood4
Navy scientistAdulthood5
Military commissarAdulthood6
Con ArtistAdulthood7NA
Space pirateAdulthood8NA
Pit BrawlerAdulthood9NA
Illegal shipwrightAdulthood10NA
CourteseanAdulthood11NA
Space MarineAdulthood12NA
AssassinAdulthood13NA
Midworld nerdChildhood14
Medieval slaveChildhood15
Medieval lordlingChildhood16
Urbworld urchinChildhood17
Vatgrown soldierChildhood18
Manufactured in a factoryChildhood19NA*
Traded aroundChildhood20NA*

Here, status of NA mean this perk is not available at character creation. NA* means secret perks.

Sorry for the delay and thanks for the reply.

Tynan

I'm afraid those numbers will change on next release. But hopefully not thereafter.

As for the pawns, there are some distinctions I'll just toss out.

A pawn has several different categories they belong to:

Team - This determines behavior in terms of who they'll attack/ignore/etc. Include special teams like Psychotic.
Race - This determines various physical characteristics and some parts of appearance.
Kind - This is a sub-kind of person under race. For example, there are important differences between a drifter and a pirate which aren't encoded in the race, but which I don't want to save over and over for every pawn. Most of them are technical and not saved, but this category is useful internally. Your colonists always get their kind changed to "colonist" on recruit. For reference, here are the fields of Kind, most of which are used internally only:

//Basics
public string raceName = ""; //Resolved on spawn
public string kindLabel = "UndefinedKindLabel";
public TeamType defaultTeam = TeamType.Neutral;
public ThinkNodeConfig thinkConfig = ThinkNodeConfig.Undefined;
public PawnSetupMethod setupMethod = null;
public bool aiAvoidCover = false;
public float recruitmentLoyaltyThreshold = 50;
public PathingParameters pathParams = PathParameters.smart;
public float baseIncapChancePerDamage = 0.01f;
public BackstoryCategory backstoryCategory;

//Visuals
public string standardBodyGraphicPath = "";

//Wild spawn parameters
public bool wildSpawn_spawnWild = false;
public float wildSpawn_EcoSystemWeight = 1f;
public IntRange wildSpawn_GroupSizeRange = IntRange.one;
public float wildSpawn_SelectionWeight = 1.0f;


This way, you could have two kinds of muffalo with different body graphics and setup methods (the setup creates the pawn and can randomize different health levels etc). Or two kinds of pirates with different health and weapon pools to draw from - like the game does with pirate vs drifter vs mercenary, etc.

Hope that's useful.

Tynan Sylvester - @TynanSylvester - Tynan's Blog

keensta

Quote from: Tynan on January 15, 2014, 03:13:39 PM
I'm afraid those numbers will change on next release. But hopefully not thereafter.

As for the pawns, there are some distinctions I'll just toss out.

A pawn has several different categories they belong to:

Team - This determines behavior in terms of who they'll attack/ignore/etc. Include special teams like Psychotic.
Race - This determines various physical characteristics and some parts of appearance.
Kind - This is a sub-kind of person under race. For example, there are important differences between a drifter and a pirate which aren't encoded in the race, but which I don't want to save over and over for every pawn. Most of them are technical and not saved, but this category is useful internally. Your colonists always get their kind changed to "colonist" on recruit. For reference, here are the fields of Kind, most of which are used internally only:

//Basics
public string raceName = ""; //Resolved on spawn
public string kindLabel = "UndefinedKindLabel";
public TeamType defaultTeam = TeamType.Neutral;
public ThinkNodeConfig thinkConfig = ThinkNodeConfig.Undefined;
public PawnSetupMethod setupMethod = null;
public bool aiAvoidCover = false;
public float recruitmentLoyaltyThreshold = 50;
public PathingParameters pathParams = PathParameters.smart;
public float baseIncapChancePerDamage = 0.01f;
public BackstoryCategory backstoryCategory;

//Visuals
public string standardBodyGraphicPath = "";

//Wild spawn parameters
public bool wildSpawn_spawnWild = false;
public float wildSpawn_EcoSystemWeight = 1f;
public IntRange wildSpawn_GroupSizeRange = IntRange.one;
public float wildSpawn_SelectionWeight = 1.0f;


This way, you could have two kinds of muffalo with different body graphics and setup methods (the setup creates the pawn and can randomize different health levels etc). Or two kinds of pirates with different health and weapon pools to draw from - like the game does with pirate vs drifter vs mercenary, etc.

Hope that's useful.

Ah, I'm currently developing a Save Editor for RimWorld I've just got the code down that allows the player to convert all raiders to colonists. (This is not good when I tested it on 43 raiders :( my computer started to lag slightly) But just so I understand is If you have a prisoner and you recruit them it makes them "Colonist, Colonist" does this mean to make Convert Raider work correctly I should do the same?

Currently it seems when I do this convert raider it turns them into colonists but some of them gang up on 1-4 other colonists and kill them off :(.. 
Check out my RimWorld SaveEditor
It removes slag and rock debris.

I mostly hang around in the Mod section of the forum. Yet I don't have a Mod :o.

Tynan

Colonist, Colonist is the right configuration of Team/Kind.

Also be sure you're wiping out their jobs (replace with a short wait job) or they'll finish what they had started before you changed them.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

keensta

Quote from: Tynan on January 15, 2014, 03:38:17 PM
Colonist, Colonist is the right configuration of Team/Kind.

Also be sure you're wiping out their jobs (replace with a short wait job) or they'll finish what they had started before you changed them.

Ok, Thanks for the information. I'll make sure to implement the change straight away.

Slightly off topic -
Also just to say I do love your involvement with the Community I've never been on a games forum and seen a developer like your self help the way you do.  I'm going to stick around for a long time and I will be sure to buy any future games that your studio produces.
Check out my RimWorld SaveEditor
It removes slag and rock debris.

I mostly hang around in the Mod section of the forum. Yet I don't have a Mod :o.

Tynan

Quote from: keensta on January 15, 2014, 03:52:45 PM
Quote from: Tynan on January 15, 2014, 03:38:17 PM
Colonist, Colonist is the right configuration of Team/Kind.

Also be sure you're wiping out their jobs (replace with a short wait job) or they'll finish what they had started before you changed them.

Ok, Thanks for the information. I'll make sure to implement the change straight away.

Slightly off topic -
Also just to say I do love your involvement with the Community I've never been on a games forum and seen a developer like your self help the way you do.  I'm going to stick around for a long time and I will be sure to buy any future games that your studio produces.

Well, I came up from the modding scene long ago, I couldn't make a game and then ignore the people modding it!
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Darker

Quoteconvert all raiders to colonists
You might also want to give them the "door key" item (look how colonists inventory looks like).
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT