dgcor / DGEngine

An implementation of the Diablo 1 game engine
Other
243 stars 30 forks source link

Quest log text marker pentragrams move when main menu is opened #10

Closed mewmew closed 6 years ago

mewmew commented 8 years ago

Text marker pentagrams move when main menu is opened

ghost commented 8 years ago

I can't reproduce this. I tried with Windows and Linux. I know what might cause this, but can't reproduce it.

Also, make sure to delete all existing saves when testing on a new version, as I sometimes change the JSON configuration files and existing saves become invalid.

This might be caused when a specific combination of clicks is done (once the level loads). Try and reproduce it again, by loading the level and trying the sequence in the gif. I tried that and couldn't reproduce it. One difference from my build is the usage of SFML 2.4.0, although that should have nothing to do with this.

mewmew commented 8 years ago

Try and reproduce it again, by loading the level and trying the sequence in the gif.

On revision 8c320b0a862550a7389815c369c172a0ae434523.

Take 2

(Note, I don't know what happened to the palette of the recorded GIF. On my screen the colors were correct while recording).

ghost commented 8 years ago

This is caused because the big pentagram texture fails to load. I can reproduce this if I force the loading of the big pentagram image to fail.

The loading happens at gamefiles/ui/level/gameMenuCommon.json

On that file you have:

  "action": [
    { "name": "resource.add", "id": "gameMenuCommon" },
    ...
  ],

Which causes a push of resources, so that if you load new resources with the same ID, they don't conflict with previously defined IDs and are overridden by the new ones (useful to override stuff for temporary menu screens which gets destroyed when resource.pop is called). The small pentagrams get shifted to the main menu because they have the same ID as the big ones which failed to load.

Try and do the following:

First, open just the main menu (without opening the quest log) on the level and see if the big pentagrams appear. If they don't, then the problem is that the big pentagram images failed to load.

The big pentagram image is loaded here:

  "texture": [
    {
      "id": "diabsmal",
      "file": "data/diabsmal.cel",
      "palette": "town"
    },
    {
      "id": "PentSpin",
      "file":"data/PentSpin.cel",
      "palette": "town"
    }
  ],

The reason why the image fails to load might be because of the name PentSpin.cel. Check if this image exists and that the name matches this one (case sensitive in Linux).

Another test you can try is to replace the texture image with the one from the main menu (the initial menu after the logo). Just replace the above JSON with this one:

  "texture": [
    {
      "id": "diabsmal",
      "file": "data/diabsmal.cel",
      "palette": "town"
    },
    {
      "id": "PentSpin",
      "file": "ui_art/focus42.pcx",
      "mask": "0x00FF00"
    }
  ],

This should fix the problem. If not, then I really don't know why.

PS: this JSON file is loaded when you open the main menu on the level. If you want to test, you don't have to close the app. Just close the menu, change the JSON and load the menu again to pick up the changes.

mewmew commented 7 years ago

If they don't, then the problem is that the big pentagram images failed to load.

The reason why the image fails to load might be because of the name PentSpin.cel. Check if this image exists and that the name matches this one (case sensitive in Linux).

I can verify that this was the issue.

All gamedata files are lowercased on my system. Changing PentSpin.cel to pentspin.cel resolved this issue. Thanks for the detailed trouble shooting!

   "texture": [
     {
       "id": "diabsmal",
       "file": "data/diabsmal.cel",
       "palette": "town"
     },
     {
       "id": "PentSpin",
-       "file":"data/PentSpin.cel",
+       "file":"data/pentspin.cel",
       "palette": "town"
     }
  ],
ghost commented 7 years ago

Great!

If you want to prevent future issues like this, use the original unmodified DIABDAT.MPQ. I have a version of physfs that reads MPQ files here: https://github.com/dgengin/physfs

uninstall the package on you Linux distro for physfs and do:

cmake CMakeLists.txt
cmake install

this will install the library system wide with support for MPQ files, so you can use the original which has the correct case for the file names.

mewmew commented 6 years ago

Thanks! I just installed the latest version of https://github.com/dgengin/physfs. Will close this issue as the cause has been identified, and the solution seem to work.