ihhub / fheroes2

fheroes2 is a recreation of Heroes of Might and Magic II game engine.
https://ihhub.github.io/fheroes2/
GNU General Public License v2.0
2.69k stars 375 forks source link

Cannot start fheroes2 from original game directory #4139

Closed a1exsh closed 3 years ago

a1exsh commented 3 years ago

Preliminary checks

Platform

Linux

Describe the bug

@oleg-derevenetz the change #4125 broke my setup :(

I have the original game installed at ~/.wine/drive_c/GOG_Games/HoMM_2_Gold. The source code is checked out at ~/src/fheroes2 and I frequently build the binary to test my local changes.

Now when I run the program like I used to, I'm getting the error and it refuses to run:

~/.wine/drive_c/GOG_Games/HoMM_2_Gold$ ~/src/fheroes2/fheroes2
08:34:28: [DBG_ENGINE]  main:  Free Heroes of Might and Magic II, version: 0.9.6
08:34:28: [DBG_ENGINE]  Init:  data files not found

This worked perfectly fine before the change and I didn't have to copy MAPS/DATA/etc. anywhere.

I also frequently use the original game maps editor to create a test map so that I can compare original game behavior to fheroes2. This worked really well as I didn't have to copy the saved map around: it could be opened in both versions from the same place on disk.

If I didn't install fheroes2, what's its "installation directory" anyway?

Save file

No save file needed.

Additional info

No response

oleg-derevenetz commented 3 years ago

Hi @a1exsh

If I didn't install fheroes2, what's its "installation directory" anyway?

"Installation directory" is the directory where fheroes2 binary resides. Please build your setup with proper CONFIGURE_FHEROES2_DATA.

ihhub commented 3 years ago

Hi @a1exsh as mentioned by @oleg-derevenetz , such trick logically should be used with configuration setup. I don't thing that here's a bug.

oleg-derevenetz commented 3 years ago

@ihhub @a1exsh The rationale here is as follows: here is a list of common (and recommended) use cases:

In all these use cases attempt to read data files from the current directory is either useless or harmful (because the same files will be scanned twice, which is pointless waste of resources), and more often harmful than useless. For non-standard use cases there is CONFIGURE_FHEROES2_DATA define.

a1exsh commented 3 years ago

Ah, I see. That works, thank you! One can also run it with FHEROES2_DATA=. ~/src/fheroes2/fheroes2, no need to recompile.