Author Topic: About the case sensitivity of level checkmarks (very specific)  (Read 2656 times)

0 Members and 1 Guest are viewing this topic.

Offline Forestidia86

  • Posts: 619
  • inactive
    • View Profile
About the case sensitivity of level checkmarks (very specific)
« on: December 05, 2017, 07:23:58 AM »
This one should only hit people that change replay files; is therefore a very specific and rare thing I think. So it's probably not important but I was shortly confused.

PointedTo and the verifier don't seem to be case sensitive (at least concerning subfolders) but the checkmarks seem to be.

I think as I dealt with "Five for Fighting" (FfF) I wanted to try out my solution to "Whispering Wind" (WW). To achieve that I copied the replay of WW and changed the $FILENAME to the respective one for FfF but wrote "vicious" with lowercase first letter and used pointedTo.
I saw quite early that my other solution won't work and tried other things finding a solution, which was saved in solved/lemforum/vicious/
The folder "vicious" was created with lowercase first letter and within the replay file the path was lowercase first letter for the rank subfolder as well.
The verifier had no problems but no checkmark was created even when I played the replay.
As I realized what could be the reason and changed "vicious" in the replay file to uppercase first letter the checkmark was created after playing the replay.

To reproduce this:

- copy a replay of a lemforum level to an instance of Lix that has in replays/solved/lemforum/ no subfolder for the rank of it (but the same player name of course)
- change the $FILENAME within the replay file to lowercase first letter for the rank
- use pointedTo to play it, cancel it somewhen and solve the rest of the level
->
- A subfolder of the rank should have been created in solved/lemforum/ with lowercase first letter and the replay file in there should have lowercase first letter for the rank subfolder as well
- There should be no checkmark for that level and playing that replay shouldn't create one.

- Now change the path in the replay to an uppercase first letter for the rank subfolder.
- Play the replay.
->
- Now the checkmark should appear.

I hope my description is accurate and reproduceable.

Offline Simon

  • Administrator
  • Posts: 3046
    • View Profile
    • Lix
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #1 on: December 05, 2017, 08:53:21 AM »
Issue #270

Thanks, excellent report.

Most likely, this arises from Windows's case-insensitivity vs. my implementation of filenames. PointedTo and the verifier merely ask the operating system to open a specific file, and Windows will happily fetch the file by its case-insensitive name. But the checkmarks are doled out by raw string comparison in Lix's Filename class, the operating system is never called.

I should probably make the Filename class case-insensitive on Windows and case-sensitive everywhere else.

-- Simon
« Last Edit: December 05, 2017, 09:25:53 AM by Simon »

Offline Forestidia86

  • Posts: 619
  • inactive
    • View Profile
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #2 on: December 06, 2017, 12:40:50 AM »
Quite interesting that it seems to be OS dependant.
The case sensitivity played at another point a role as well.
As I converted the oriental levels of Clam, then I had to change "Hatch" to "hatch" for example. The old tileset had uppercase first letter whereas the new one had lowercase first letter and the game didn't recognize the old names with uppercase.

Offline Simon

  • Administrator
  • Posts: 3046
    • View Profile
    • Lix
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #3 on: December 06, 2017, 04:31:36 AM »
Hmm, I'd prefer the tile lookup case-sensitive. If I allowed Hatch for hatch only on Windows, other OSes will declare the level broken for missing tiles. This would be worse than flat-out breaking everywhere, for clarity.

If the tile lookup stays case-sensistive, maybe the checkmarks should remain case-sensitive, too... or at least the Filename class is good as-is (it's used everywhere in the program), and the checkmark database should be case-insensitive.

It's more important that the data is interpreted the same everywhere (levels) than that the local progress adheres to OS-specific culture.

-- Simon

Offline Forestidia86

  • Posts: 619
  • inactive
    • View Profile
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #4 on: December 06, 2017, 04:44:46 AM »
Hm, what led to the "problem" was my laziness not to write "vicious" with uppercase first letter.
PointedTo as well as the verifier nevertheless accepted that, which is probably already another interpretation of data than it would be on Linux I guess? And I didn't realize therefore at that point that case-sensitivity plays a role since everything seemed fine.

But I agree that's important that the data is understood the same across the OS, else people on Windows use case-insensitivity (like me), which then in worst case doesn't work for users with case-sensitive OS.
« Last Edit: December 06, 2017, 06:26:08 AM by Forestidia86 »

Offline Simon

  • Administrator
  • Posts: 3046
    • View Profile
    • Lix
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #5 on: January 09, 2018, 05:14:08 AM »
I'd like to keep the case-sensitivity of checkmarks. Replays should behave the same across operating systems.

It's an unfortunate extra that the wrong capitalization retrieves the correct file on Windows. Not sure if I should write extra code to disallow that. If I change anything, disallowing retrieval of (file with different capitalization) would be the right change.

-- Simon

Offline Forestidia86

  • Posts: 619
  • inactive
    • View Profile
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #6 on: January 09, 2018, 06:00:44 AM »
I can fully understand your position.
The only thing I noticed is that the mass verifier now explicitly seems to say that the checkmark is updated, though it isn't.

verifier.txt:
Result,Replay filename,Level filename,Player,Saved,Required,Skills,Phyus
(OK),replays/test/letsblockandblow-Forestidia-2017-12-05-065956 - Kopie.txt,levels/single/lemforum/lovely/letsblockandblow.txt,Forestidia,19,19,2,388
[...]
Statistics from 1 replays:
    1x (OK): replay solves the pointed-to level.
1 checkmarks for player `Forestidia' updated.

Offline Simon

  • Administrator
  • Posts: 3046
    • View Profile
    • Lix
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #7 on: January 09, 2018, 06:03:49 AM »
Okay, this message is a blatant lie then, and that's a bug. Good catch. Then I need extra care on Windows to avoid wrongly-cased matches during lookup of pointed-to level.

-- Simon

Offline Forestidia86

  • Posts: 619
  • inactive
    • View Profile
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #8 on: January 09, 2018, 06:21:37 AM »
One other oddity:
If you have a replay with lower case "lovely" and one with upper case "Lovely" the amount of levels is duplicated, since it lists all levels with lower case and with upper case directory name and says then "of 80" instead "of 40".

Offline Simon

  • Administrator
  • Posts: 3046
    • View Profile
    • Lix
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #9 on: January 09, 2018, 06:38:18 AM »
Nnnnnnnn. How many of these bugs are still hiding here. >_> I'm putting all these into #284, I'll attack them after the pointed-to lookup has become case-sensitive. But it's all low-priority.

-- Simon
« Last Edit: January 09, 2018, 06:47:06 AM by Simon »

Offline Forestidia86

  • Posts: 619
  • inactive
    • View Profile
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #10 on: January 09, 2018, 06:51:55 AM »
Just for reference I've attached a file where one can see how the duplication looks in verifier.txt. I used an instance of Lix where I haven't solved/checked this level, yet; so I got two checkmarks updated for the same level.
It seems as if the verifier sees it as two different levels due to the different directory name but nevertheless accesses the same level for verification. The same for the directory.

Offline namida

  • Administrator
  • Posts: 11400
    • View Profile
    • NeoLemmix Website
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #11 on: January 09, 2018, 10:45:54 PM »
Isn't case-sensitivity a file system matter, rather than an OS one? EG: If you were to run Linux Lix on a FAT32 partition, wouldn't that be case-insensitive?

Offline Simon

  • Administrator
  • Posts: 3046
    • View Profile
    • Lix
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #12 on: January 09, 2018, 10:48:30 PM »
Quote
file system matter, rather than an OS one?

Smart, I haven't thought about this. I'll have to research more, also I'd like to know how other cross-platform cultures handle the filename case issue.

-- Simon

Offline Forestidia86

  • Posts: 619
  • inactive
    • View Profile
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #13 on: January 24, 2018, 01:23:03 AM »
From github:
Quote
Need to check: On Windows, you specify Hatch.H in a level file when the tile is really called hatch.H. Does the game load the tile with the wrongly-cased name?

Yeah it loads as far as I have tested. And yeah it seems to be from 0.9.7 on. But my first trouble with the checkmarks was with an earlier version (I think 0.9.4).

Offline Simon

  • Administrator
  • Posts: 3046
    • View Profile
    • Lix
Re: About the case sensitivity of level checkmarks (very specific)
« Reply #14 on: January 24, 2018, 06:41:54 AM »
Thanks for the timely testing!

-- Simon