
I noticed that every time I save and then load a mod, a few models slightly move from their original positions.
This compounds across multiple saves and loads (typically while working on scripts) so that, after a while the models move noticeably.
Steps to reproduce:
Start from an empty table, set a default grid (2x2), visible lines, snap to lines.
then make a custom model copy it several times and place it at grid intersections.
(verify with the gizmo tools that all models have even x and z coordinates, e.g. 2.0, -2.0 etc.)
Save the game, then repeat several times: load / overwrite without touching anything else.
Every time the game is loaded, some instances of the models will drift slowly, but consistently (e.g some model will move by -0.02 along the x axis and by 0.07 along the z axis at every overwrite/load cycle). This can be verified by looking at the json save file.
Some models, instead, will stay at the original position (empirically, it seems that at least the first instance of the model in the save file does not move).
I couldn’t reproduce with the default game pieces (e.g. chess pieces, pawns, figurines etc.) but this happens consistently with some of the models from the wood tokens workshop here https://steamcommunity.com/sharedfiles/filedetails/?id=295528283
For example, this one: ‘http://pastebin.com/raw.php?i=bPVqRQ8c' moves by quite a bit every time.
I noticed this while working on a complex prototype with several player pieces and some setup scripts. While working on the script I have to save/reload several times in a row, and at some point I noticed that the player pieces that I was sure to have set up exactly on the player boards were off from their intended positions. At first I didn’t care much, rearranged them and kept working on the script, but after several saves the pieces had slowly moved again.
I noticed this only this week, so it is probably a side-effect of the latest changes.
[TTS Version: 13.0.3 , OS: Linux]

I observed a similar unexpected movement of a locked object. (It does layout differently when Z is positive or negative, the object had been slightly negative then the layout flipped because it became slightly positive. That script is now improved to tolerate “near zero” positions, but the fact that it was locked may be relevant to this issue.)


These are separate issues, and the drifting of models is not because of floating point representations.
See the attached file (I edited the file so that values heve round numbers, and then loaded it back):
TS_Save_196.json, lines 466-477:
“Transform”: “posX”: 0.0,
“posY”: 1.23556685,
“posZ”: 0.0,
“rotX”: 0.0,
“rotY”: 180.0,
“rotZ”: 0.0,
“scaleX”: 1.0,
“scaleY”: 1.0,
“scaleZ”: 1.0
},
lines 526-536:
“Transform”: “posX”: -2.0,
“posY”: 1.23556685,
“posZ”: 0.0,
“rotX”: 0.0,
“rotY”: 180.0,
“rotZ”: 0.0,
“scaleX”: 1.0,
“scaleY”: 1.0,
“scaleZ”: 1.0
},
lines 585-595
“Transform”: “posX”: 2.0,
“posY”: 1.23556685,
“posZ”: 0.0,
“rotX”: 0.0,
“rotY”: 180.0,
“rotZ”: 0.0,
“scaleX”: 1.0,
“scaleY”: 1.0,
“scaleZ”: 1.0
},
Actual coordinates of the three models after loading this very file (taken via the gizmo tools):
{0.12, 1.30, 0.07}
{-1.88, 1.30, 0.07}
{2.00, 1.30, 0.00}
One of the objects didn’t move at all, the other two moved by (x=0 .12, y=0.07).
There is no way that two out of three 0.0 become 0.07 due to floating point rounding errors.
Now, if I save and load again without touching anything:
the values on the save file become:
TS_Save_197.json:
"Transform": {
"posX": 0.119146496,
"posY": 1.30245173,
"posZ": 0.07201272,
"rotX": -2.064475E-05,
"rotY": 180.000061,
"rotZ": 1.23967775E-05,
"scaleX": 1.0,
"scaleY": 1.0,
"scaleZ": 1.0
},…
“Transform”: “posX”: -1.88085818,
“posY”: 1.302453,
“posZ”: 0.0720002353,
“rotX”: -8.601349E-06,
“rotY”: 180.000061,
“rotZ”: 4.00492172E-06,
“scaleX”: 1.0,
“scaleY”: 1.0,
“scaleZ”: 1.0
},
…
“Transform”: “posX”: 2.00000215,
“posY”: 1.302453,
“posZ”: 2.7269125E-06,
“rotX”: 1.11552517E-05,
“rotY”: 180.000061,
“rotZ”: -2.453595E-06,
“scaleX”: 1.0,
“scaleY”: 1.0,
“scaleZ”: 1.0
},
These values are reasonably similar to the ones I measured with the gizmo tools, and the rounding errors due to fp representation are less than 0.01%.
But then, when I check the actual positions of the pieces after loading they become:
{0.24, 1.30, 0.14}
{-1.76, 1.30, 0.14}
{2.00, 1.30, 0.00}
So, again, the first two models shifted exactly by (x=+0.12, z=+0.07) while the third model was not affected.
So, clearly, there is something weird happening when loading those models.
So far (with various different setups and model pieces) I noticed that one of the models is loaded correctly, while other drift by a consistent amount.
Hope this helps.