NetHack / NetHack

Official NetHack Git Repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

change tileset

Roetschreck opened this issue · comments

Hi - i can´t change tileset to new 3.7.0-format (e.g. new nevanda-tileset 32x32: https://gist.github.com/horlogeislux/d7b8da09b7cfaa27f9732611ab573f6d) on windows-version of the game. I saved .bmp with paint from windows (1280 x 1856 pixel, 24bit) and changed to correct width/height-settings in .nethackrc. Still got Error-message: "Cannot load tiles from the file.". Is this an error in source-code or my fault?

Is the actual bmp tileset that you're trying to use already available somewhere, so that someone can attempt to reproduce your issue without having to recreate the file from scratch?

Edit: Is the 285879971-7bf63e43-1a84-4ff2-bac7-60f71ed07821.png (last image in the link above) the image you are asking about (after saving as bmp)?

i add the file as .png (.bmp is not available)

I tried to reproduce, but I get a different issue, not the one you are describing.

Did you try putting the full path to the bmp file in your %USERPROFILE%\nethack\.nethackrc?
Can you paste the three OPTION lines related to your tile file from your %USERPROFILE%\nethack\.nethackrc, specifically the tile_file, tile_width, tile_height options?

In your link, there is a mention of "The default 3.7 tileset (as of November 2023)".
As a test, I rolled the code back to November 1, 2023
git checkout fa0f375
and built NetHack, and placed your tile set at the same location as you specified:
C:\Users\roets\Pictures\Müll\nethack_3.7.0\nevanda_3.7_32x32.bmp
to rule out any parsing issues. Your tileset worked for me with that November code.

I then went back to the current code for NetHack 3.7 work-in-progress.
git checkout NetHack-3.7
and rebuilt. I'm still able to load your tile set fine , but the tiles on the display are off.

Since you seem to be stating that the problem you are reporting seems to be with loading the tiles, not the display being garbled, I need to ask whether you are 100% certain that the file is named exactly as you are specifying in your .nethackrc, without any typos?
For example, does this command work fine outside NetHack?

dir "C:\Users\roets\Pictures\Müll\nethack_3.7.0\nevanda_3.7_32x32.bmp"

As for the garbled display that I'm seeing, you need to be aware that your tileset, as is, won't work with the current code. There has been changes to the tiles since then, particularly the addition of the chain lightning spellbook.

diff --git a/win/share/monsters.txt b/win/share/monsters.txt
index 7825cd811..0d3341f82 100644
--- a/win/share/monsters.txt
+++ b/win/share/monsters.txt
@@ -923,39 +923,39 @@ Z = (195, 195, 195)
 # tile 46 (warg,male)
 {
   ................
-  ...P..P....PP...
-  ...P.PP......P..
-  ..PPPP.......P.A
-  ..N.NPP......P.A
-  .P..PPPPP....P.A
-  PPPPDPPPPPPPPPAA
-  DPPNDPPPPPPPPPAA
-  ..DDDPPPPPPPPPAA
-  PNDNP.PPPPPPPPAA
-  .PPPPAPPPPAPP.A.
-  ...PAAPPAAAAPPAA
-  ...PAAP.AAAAP.A.
-  .PPPAAPAAAAAPAA.
-  ....PPPAA.PPPA..
+  ...P..0....P0...
+  ...0.0P......0..
+  ..0P0P.......P.A
+  ..N.N0P......0.A
+  .P..0P0P0....P.A
+  P0P0D0P0P0P0P0AA
+  DP0NDP0P0P0P0PAA
+  ..DDD0P0P0P0P0AA
+  0NDN0.0P0P0P0PAA
+  .0P0PAP0P0A0P.A.
+  ...PAA0PAAAA0PAA
+  ...0AAP.AAAAP.A.
+  .P0PAA0AAAAA0AA.
+  ....P0PAA.P0PA..
   ................
 }
 # tile 47 (warg,female)
 {
   ................
-  ...P..P.....P...
-  ...P.PP......P..
-  ..PPPP.......P.A
-  ..N.NPP......P.A
-  .P..PPPPP....P.A
-  PPPPDPPPPPPPPPAA
-  DPPNDPPPPPPPPPAA
-  ..DDDPPPPPPPPPAA
-  PNDNP.PPPPPPPPAA
-  .PPPPAPPPPAPP.A.
-  ...PAAPPAAAAPPAA
-  ...PAAP.AAAAP.A.
-  .PPPAAPAAAAAPAA.
-  ....PPPAA.PPPA..
+  ...P..0.....P...
+  ...0.0P......0..
+  ..0P0P.......P.A
+  ..N.N0P......0.A
+  .P..0P0P0....P.A
+  P0P0D0P0P0P0P0AA
+  DP0NDP0P0P0P0PAA
+  ..DDD0P0P0P0P0AA
+  0NDN0.0P0P0P0PAA
+  .0P0PAP0P0A0P.A.
+  ...PAA0PAAAA0PAA
+  ...0AAP.AAAAP.A.
+  .P0PAA0AAAAA0AA.
+  ....P0PAA.P0PA..
   ................
 }
 # tile 48 (winter wolf,male)
@@ -11613,18 +11613,18 @@ Z = (195, 195, 195)
   ................
   ......OPP.O.....
   ......PPPP......
-  .....CPPDP......
-  ....CCCPPP......
-  ....CCPPPP......
-  ....C..PPA......
-  .....DDAADD.AAA.
-  ....DDDDDDDDAAA.
-  ....DADDDDADAAA.
-  ....DADDDDADAAA.
-  ....DADDDDADAAA.
-  ......DAADAAAA..
-  ......DAADAA.A..
-  .....DDA.DDA....
+  .....KPPDP......
+  ....KJJPPP......
+  ....KJPPPP......
+  ....K..PPA......
+  .....GGAAGG.AAA.
+  ....FDFDFDFDAAA.
+  ..G.GADGDFAGAGA.
+  ....GAFGFGAGAAA.
+  ..G.DADFDGAFAAA.
+  ......GAADAAAG..
+  .F.G..GAAFAA.A..
+  .....DFA.GGA..F.
   ................
 }
 # tile 605 (vrock,female)
@@ -11632,18 +11632,18 @@ Z = (195, 195, 195)
   ................
   ......OPP.O.....
   ......PPPP......
-  .....CPPDP......
-  ....CCCPPP......
-  ....CCPPPP......
-  ....C..PPA......
-  .....DDAADD.AAA.
-  ....DDDDDDDDAAA.
-  ....DADDDDADAAA.
-  ....DADDDDADAAA.
-  ....DADDDDADAAA.
-  ......DAADAAAA..
-  ......DAADAA.A..
-  .....DDA.DDA....
+  .....LPPGP......
+  ....LCCPPP......
+  ....LCPPPP......
+  ....L..PPA......
+  .....GGAAGG.AAA.
+  ....FDFDFDFDAAA.
+  ..G.GADGDFAGAGA.
+  ....GAFGFGAGAAA.
+  ..G.DADFDGAFAAA.
+  ......GAADAAAG..
+  .F.G..GAAFAA.A..
+  .....DFA.GGA..F.
   ................
 }
 # tile 606 (hezrou,male)
diff --git a/win/share/objects.txt b/win/share/objects.txt
index e8ab2335b..7ce7c8d80 100644
--- a/win/share/objects.txt
+++ b/win/share/objects.txt
@@ -7745,6 +7745,25 @@ Z = (195, 195, 195)
   .......JJJAA....
   ................
 }
+# tile 405 (checkered / chain lightning)
+{
+  ................
+  ................
+  ................
+  ....AAAA........
+  ....AAAAAA......
+  ...AAADDDANNP...
+  ...AADDAADNNN...
+  ..PNAADDNNNNOA..
+  ..NNDNADDNNNOAA.
+  .PNNNDDDAAAONA..
+  .NNNNNNAAAAAAA..
+  .NOONNAAAAAOA...
+  ..PNOOOAAAOA....
+  ....PAAOOOA.....
+  .......AAA......
+  ................
+}
 # tile 405 (plain / blank paper)
 {
   ................
diff --git a/win/share/other.txt b/win/share/other.txt
index 0aa076e03..d716ba311 100644
--- a/win/share/other.txt
+++ b/win/share/other.txt
@@ -429,14 +429,14 @@ Z = (195, 195, 195)
   .A.A.A.A.A.A.A.A
   A.A.A.A.A.A.A.A.
 }
-# tile 21 (engraved part of a room)
+# tile 21 (engraving in a room)
 {
   ................
   ................
-  ...E...E........
-  ....E...E.......
-  .........E..E...
-  ..........E.....
+  ...H...H........
+  ....H...H.......
+  .........H..H...
+  ..........H.....
   ................
   .......PP.......
   .......PP.......
@@ -486,17 +486,17 @@ Z = (195, 195, 195)
   ................
   ................
 }
-# tile 24 (engraved part of a corridor)
+# tile 24 (engraving in a corridor)
 {
   ................
-  ...E...E........
-  ....E...E.......
-  .........E..E...
-  ..........E.....
+  ...H...H........
+  ....H...H.......
+  .........H..H...
+  ..........H.....
   ................
   .......PP.......
-  ......PPPP......
-  ......PPPP......
+  ......P.PP......
+  ......PP.P......
   .......PP.......
   ................
   ................

Got it - it was the path. The Game and the tileset was located in a forder inside my Userprofil. I copied the Game to c:\nethack and placed the tileset in the same directory and it works! I will now check the tileset and will correct it. Thanx for you advice!

I tried it out. It looks like you may still be off by one tile. For instance, if I start the game in wizard mode to test:
nethackw -uwizard -D
and wish for a fountain in the game, I'm getting the tile to the right of the fountain tile.

Edit: see next comment

The NetHack 3.7 tile file, as of February 16, 2024, has a total of 2300 tiles, 57 full rows of 40 tiles across, and the final row (row 58) has 20 tiles in it.

If I'm counting correctly, yours has 57 full rows of 40 tiles across, but your final row has 23 tiles in it, for a total tile count of 2303, which isn't correct.

yes you´re right .... i must correct that - sigh (but i will wait until official release of 3.7.0). thanx ;)

nevanda_3 7_32x32
... now with the missing spellbook, sigh