LixD icon indicating copy to clipboard operation
LixD copied to clipboard

Tile groups: Give better names, support copypaste

Open SimonN opened this issue 5 years ago • 2 comments

Lix 0.9.35

Tile groups get names 0, 1, 2, ... based on their appearance in a level file. When you copypaste by hand the tile group "0" into a different level by hand, chances are that there is already a "0" in the target level. You must rename one of the "0".

Give names that stand higher chances to be globally unique, e.g., based on system time or included tiles.

SimonN avatar Feb 10 '21 17:02 SimonN

~This will go in Lix 0.9.40.~ See next post for reasoning.

I don't know yet whether I want to add the level title, the tile names, the level saving date, ..., to the names of the tile groups.

Most likely, I'll keep the running count somewhere in the name, to guarantee unique group names at least per level.

SimonN avatar Nov 15 '21 23:11 SimonN

This isn't yet in Lix 0.9.40.

The main reason is that I don't want unnecessary diffs when you re-save a level. If we use

  • a random string, or
  • the datetime of the most recent level editing (regardless of second or millisecond resolution),

...we would run into the issue that all groups get new names during saving. Even if you merely move a single unrelated tile, the new group names would generate big multi-line diffs throughout the level text file.

For now, I've merely documented in doc/formats/level.txt how to move groups manually: Their names, in all 0.9.x, are free-form text strings, not numbers. You can manually change the group names in one level from 0, 1, ..., to a0, a1, ..., and then copy these manually renamed groups into a second level without fear of clashes.

SimonN avatar Jan 12 '22 22:01 SimonN