ldtk icon indicating copy to clipboard operation
ldtk copied to clipboard

uID and duplicate variable saving for Project/Individual Files causing issues with source control

Open chosencharacters opened this issue 1 year ago • 1 comments

I'm trying to pull files another member on my project made where main branch has proceeded past the position they were making levels for, and uIDs as a result are causing issues.

The scenario:

  1. Branch A was made off Master when there were 1000 levels
  2. Master continued to add 5 more levels
  3. Branch A made 10 levels
  4. As a result Master has levels 1000 - 1005 already with uIDs and can't pull Branch A

This project file both uses Worlds and Seperate Level Saving

I've tried to edit the .json directly but you have to constantly and manually make sure the levels have unique uIDs that also have to match up with their individual levels. When I finally got the levels in the world grid, I got a pxWid error and just gave up.

To fix this I propose:

  • An option to regenerate uIDs of all levels

  • Make uIDs random numbers between 1 and maximum integer, instead of counting up

  • A "no duplicate fields" option that removes all but the Project grid specific info from each level's individual json, including removing their unique uIDs. This info would be stored in the level itself (or vice versa, uID is not stored in the level file but is stored in the ldtk file.)

chosencharacters avatar Jun 04 '24 17:06 chosencharacters

The resulting is an image of what happens when the uIDs clash. In this case the uID in the project files were all unique, but the uIDs in individual level files weren't and LDTK got confused

image

chosencharacters avatar Jun 04 '24 17:06 chosencharacters