ok so i was looking through the save file of Prison Architect which is a Indie game and it looked like this:
Version alpha-11
NumCellsX 100
NumCellsY 80
OriginW 100
OriginH 80
TimeIndex 37268.6
ObjectId.next 650667
EnabledElectricity true
EnabledWater true
EnabledFood true
EnabledMisconduct true
EnabledDecay true
ObjectsCentreAligned true
FoodQuantity 3
FoodVariation 3
BioVersions 3
Intake.next 37919.0
Intake.numPrisoners 15
Intake.reqNormal false
BEGIN Cells
BEGIN "0 0" Mat PavingStone Con 0.000000 END
BEGIN "0 1" Con 0.000000 END
BEGIN "0 2" Con 0.000000 END
BEGIN "0 3" Mat PavingStone Con 0.000000 END
BEGIN "0 4" Mat PavingStone Con 0.000000 END
BEGIN "0 5" Mat PavingStone Con 0.000000 END
BEGIN "0 6" Mat PavingStone Con 0.000000 END
...
BEGIN "[i 522]"
Id.i 522
Id.u 629870
Type Prisoner
SubType 3
Pos.x 42.9990
Pos.y 44.4637
Vel.x 0.206368
Vel.y -0.319687
Dest.x 63.8152
Dest.y 47.6036
AttackTimer 1.26525
Shackled true
Cell.i 69
Cell.u 91131
RequiredCellType Solitary
Category MinSec
BoilingPoint 100.000
Gang.id 1
BEGIN Bio
Forname Dan
Surname Gordon
Age 39.0000
BodyType 3
BodyScale 0.781719
HeadType Head3
Traits Fraud
Traits Theft
Traits Narcotics
Traits Petty
Sentence 16
Served 6.53939
Parole 12
SkinColour 0xcb946cff
BEGIN Convictions
Size 4
BEGIN "[i 0]" Crime Blackmail Sentence 13 Plea true Guilty true END
BEGIN "[i 1]" Crime Bribery Sentence 3 Plea true Guilty true END
BEGIN "[i 2]" Crime Bribery Sentence 6 Plea true Guilty true Served true END
BEGIN "[i 3]" Crime Robbery Sentence 8 Plea true Guilty true Served true END
END
theres more but its 27000+ lines long so i wont post it but i was wondering how the game knows to read the values and skip the text? this game is written in C++ i might add, so obviousley they know more about coding than me, i know you could probably write code to ignore the strings but idk can anyone tell me what you think?
I just bought that game. Interesting.
EDIT: I only bought it because it was supported for linux in steam
Most of those are in the format of NAME VALUE, so something with that would just split the file by newline, then split the line by space putting the first value as description of the value, and the second as the actual value and converting it from string to double. Maybe an std::map. Not sure.
For those that are split and have a length greater than 2, would obviously not fit this criteria, so those could be put into another map or something. Or could be caught by the keyword BEGIN. Again not sure.
my best guess would be something like this, where save_file is the string from the file:
If you are referring to the code snippet: i didnt bother making code to accommodate the BEGIN lines. It was just an example code. If you are referring to the OP, that doesn't make sense. You cannot skip characters and read in the numbers, as they mean nothing. They have to be associated with something to clarify what it is for. The fact that the characters exist probably means they are using it to associate it with the numbers.
You probably will never know either, as there are only two developers to the game i hear. The characters have meaning, but the only ones that know would be the developers.