noxworld-dev / opennox

OpenNox main repository.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ubuntu file names and game data path

kemsky opened this issue · comments

I've tried to run it on my ubuntu 22.04. Game starts but in console I see that many files are not found:

...
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/flagwar/flagwar.map: no such file or directory
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/endgame/endgame.map: no such file or directory
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/capflag/capflag.map: no such file or directory
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/freezout/freezout.map: no such file or directory
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/kingdoms/kingdoms.map: no such file or directory
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/flagball/flagball.map: no such file or directory
2023/08/27 03:21:11 [game]: check map file: open /home/xxx/Downloads/NOX/maps/bankshot/bankshot.map: no such file or directory
....

Files are actually in place, but their case differs e.g. game expects flagball.map but actual file can be FlagBall.map.

Another problem is that game overwrites path to game data in config. Initial config has the following line:

game:
  data: '/home/dookie/Downloads/Nox/'

after first run path is replaced with . but it is not correct and next time it wont start.

As a temporary solution, just change the case of map files and folders to lowercase.

The client actually attempts to search for upper case match. But what is happening here, I think is that the client lists all maps, lower-cases them and then tries to find the exact match. We should fix it.

But yeah, Evengard is right, the best way to deal with problems like these is to lower-case folder/file names on your end. We should probably make it automatic at some point 🤔

Another solution is to wrap the folder listing routines and make them return only lowercased filenames to the engine...

I've added only one example to this issue, but there are cases when game expects non lower case names. So converting everything to lower will not help. The issue with config can be reproduced if you put it to the nox dir.