Ludeon Forums

Ludeon Forums

  • August 05, 2021, 07:48:48 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4

Author Topic: Save file structure  (Read 21240 times)

Darker

  • Colonist
  • ***
  • Posts: 378
  • I'm Jack's twisted mind
    • View Profile
    • Rim world editor
Re: Save file structure
« Reply #30 on: January 05, 2014, 06:38:48 PM »

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!

« Last Edit: January 05, 2014, 07:23:12 PM by Darker »
Logged
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

Darker

  • Colonist
  • ***
  • Posts: 378
  • I'm Jack's twisted mind
    • View Profile
    • Rim world editor
Re: Save file structure
« Reply #31 on: January 06, 2014, 03:45:15 PM »

<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?
Logged
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

Coenmcj

  • Super Tester
  • Planetologist
  • ***
  • Posts: 2327
  • Corn
    • View Profile
Re: Save file structure
« Reply #32 on: January 09, 2014, 11:54:36 PM »


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

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

ItchyFlea

  • Who's a good kitty?
  • Administrator
  • Planetologist
  • *****
  • Posts: 1918
  • Psychotic Squirrel
    • View Profile
Re: Save file structure
« Reply #33 on: January 10, 2014, 02:38:52 AM »


<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)
« Last Edit: January 10, 2014, 02:41:13 AM by ItchyFlea »
Logged
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

  • Who's a good kitty?
  • Administrator
  • Planetologist
  • *****
  • Posts: 1918
  • Psychotic Squirrel
    • View Profile
Re: Save file structure
« Reply #34 on: January 10, 2014, 04:11:05 PM »

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.
Code: [Select]
<Thing Class="Building">
<Def>DropPod</Def>
<ID>DropPod446837</ID>
<Pos>(107, 0, 99)</Pos>
<Team>Colonist</Team>
<Health>500</Health>
</Thing>
Logged
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

  • Colonist
  • ***
  • Posts: 378
  • I'm Jack's twisted mind
    • View Profile
    • Rim world editor
Re: Save file structure
« Reply #35 on: January 11, 2014, 08:31:50 AM »

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>
Logged
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT

DoomerDGR8

  • Drifter
  • **
  • Posts: 25
  • Rimworld Horse-cart trader
    • View Profile
    • nostroTech Solutions
Re: Save file structure
« Reply #36 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:
Code: [Select]
<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

  • Who's a good kitty?
  • Administrator
  • Planetologist
  • *****
  • Posts: 1918
  • Psychotic Squirrel
    • View Profile
Re: Save file structure
« Reply #37 on: January 15, 2014, 05:20:52 AM »

Hi!

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

The mentioned nodes under a Pawn are:
Code: [Select]
<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:
Code: [Select]
<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.
Logged
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

  • Drifter
  • **
  • Posts: 25
  • Rimworld Horse-cart trader
    • View Profile
    • nostroTech Solutions
Re: Save file structure
« Reply #38 on: January 15, 2014, 05:53:49 AM »

Hi!

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

The mentioned nodes under a Pawn are:
Code: [Select]
<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:
Code: [Select]
<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.
« Last Edit: January 15, 2014, 06:01:13 AM by DoomerDGR8 »
Logged

Tynan

  • Developer
  • Administrator
  • Transcendent
  • *****
  • Posts: 12474
    • View Profile
    • Tynan's Blog
Re: Save file structure
« Reply #39 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:

Code: [Select]
//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.

Logged
Tynan Sylvester - @TynanSylvester - Tynan's Blog

keensta

  • Colonist
  • ***
  • Posts: 110
  • That guy
    • View Profile
Re: Save file structure
« Reply #40 on: January 15, 2014, 03:32:59 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:

Code: [Select]
//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 :(.. 
Logged
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

  • Developer
  • Administrator
  • Transcendent
  • *****
  • Posts: 12474
    • View Profile
    • Tynan's Blog
Re: Save file structure
« Reply #41 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.
Logged
Tynan Sylvester - @TynanSylvester - Tynan's Blog

keensta

  • Colonist
  • ***
  • Posts: 110
  • That guy
    • View Profile
Re: Save file structure
« Reply #42 on: January 15, 2014, 03:52:45 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.
Logged
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

  • Developer
  • Administrator
  • Transcendent
  • *****
  • Posts: 12474
    • View Profile
    • Tynan's Blog
Re: Save file structure
« Reply #43 on: January 15, 2014, 05:51:48 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!
Logged
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Darker

  • Colonist
  • ***
  • Posts: 378
  • I'm Jack's twisted mind
    • View Profile
    • Rim world editor
Re: Save file structure
« Reply #44 on: January 16, 2014, 05:41:47 AM »

Quote
convert all raiders to colonists
You might also want to give them the "door key" item (look how colonists inventory looks like).
Logged
Please... Throw human readable errors on savefile parsing failure!!!
Rim world editor Editor on GIT
Pages: 1 2 [3] 4