Giter Club home page Giter Club logo

Comments (23)

Bertram25 avatar Bertram25 commented on May 22, 2024

I'm using Debian Sid if it can help.

from flare-game.

dorkster avatar dorkster commented on May 22, 2024

Does the same thing happen when you run ./flare --game_data=(path to clone root folder)?

from flare-game.

pennomi avatar pennomi commented on May 22, 2024

I usually have to run a sudo make install after compiling.

from flare-game.

Bertram25 avatar Bertram25 commented on May 22, 2024

Hi!

Does the same thing happen when you run ./flare --game_data=(path to clone root folder)?

Yes, that's helping, thanks! :)

I usually have to run a sudo make install after compiling.

Working, too! Thanks also.

If I may, both approaches are not optimal for git users/developers, right? Plus the readme doesn't tell about a required installation step to run the app.
May I ask for either using the current folder as the game_data one after testing for the existence of the installed data a default behaviour, or update the README so that people can figure out command-line options?

Thanks again for the help and best regards, :)

from flare-game.

dorkster avatar dorkster commented on May 22, 2024

The game is supposed to work if the binary is locally in the clone root folder (which it does on my system). The --game_data command line option is a new feature, so I suspect there may be a bug with it.

Internally we have a user-defined game data path variable that is set by the --game_data option. By default, this variable is empty, and is intended to be ignored when it is empty. However, it might be possible that your system is accepting an empty path a valid, thus trying to use that.

from flare-game.

dorkster avatar dorkster commented on May 22, 2024

@Bertram25 I would appreciate if you could try this. In src/UtilsFileSystem.cpp add this line after line 40:

    if (path == "") return false;

Then compile and try running ./flare. Since you did a sudo make install, you'll need to remove the /usr/local/share/games/flare/ directory beforehand to ensure you're using the mods/ folder in the clone root.

from flare-game.

Bertram25 avatar Bertram25 commented on May 22, 2024

Hi @dorkster :)

I've removed the installed data, and tried it as the first line of the dirExists() function.

this didn't change anything unfortunately. Can you roughly point me to the place the game checks for the data folder, so I could make tries myself?

from flare-game.

dorkster avatar dorkster commented on May 22, 2024

@Bertram25 I believe it is all done in setPaths() in Settings.cpp.

from flare-game.

Bertram25 avatar Bertram25 commented on May 22, 2024

Hi :)

I've seen and locally fixed the problem:

I had to add this on line 267 in Settings.cpp, as the developper/local folder should be checked before the installation dirs because they are defined when using CMake.

// check for the local/developer folder:
if (dirExists("./mods")) {
    PATH_DATA = "./";
    return;
}

This should ease development, as it doesn't seem to break installed games from using the installed data, and permit to not install flare to be able to playtest it.

What do you think about it?

from flare-game.

dorkster avatar dorkster commented on May 22, 2024

@Bertram25 I'm pretty sure it's intended for installed directories to take priority over the local directory. The code you posted would always return true, so installed directories would never be used.

I'm thinking that you might have an empty or incomplete "flare" directory somewhere under the /usr/ tree. Run in /usr/:

find . -type d -name flare

and check the contents of any resulting directories.

from flare-game.

dorkster avatar dorkster commented on May 22, 2024

Let me just correct myself here:

The code you posted would always return true, so installed directories would never be used.

It will always return true only for local copies of Flare. However, I think it's intentional that even the local binary uses installed game data. I could be wrong though.

from flare-game.

clintbellanger avatar clintbellanger commented on May 22, 2024

I guess it's debatable. The XDG spec doesn't cover "local" copies of data, but I added that as a "last resort" for Flare (and the default for Windows releases).

If there's enough advantage to check for a local mods folder first, I'm open to that idea. As long as there aren't really any drawbacks.

from flare-game.

Bertram25 avatar Bertram25 commented on May 22, 2024

I think it's intentional that even the local binary uses installed game data. I could be wrong though.

IMHO, it is on the contrary weird to not look for local data first, especially when one has the official package installed, for instance. (I don't have it but it could happen.)

If there's enough advantage to check for a local mods folder first, I'm open to that idea. As long as there aren't really any drawbacks.

I know several projects doing it, including the one I've got here, and I had no actual drawbacks so far following this method. Plus, the README does tell you don't need to install in order to run it, so there is something inconsistent here that needs to be sorted out.

I'm not willing to force you guys to do one thing or another but maybe a little bit of clarification in the README at least? :)

from flare-game.

pennomi avatar pennomi commented on May 22, 2024

For what it's worth, I actually have the same problem. I'd be okay with local copies of data overriding installed ones.

from flare-game.

dorkster avatar dorkster commented on May 22, 2024

IMHO, it is on the contrary weird to not look for local data first, especially when one has the official package installed, for instance. (I don't have it but it could happen.)

I agree. I was just worried that we might be interfering with something I wasn't aware of, but it looks like that isn't the case. Personally, I have no problem with local binary -> local data and installed binary -> installed data.

from flare-game.

clintbellanger avatar clintbellanger commented on May 22, 2024

Also consider a player who wants to experiment with local changes but doesn't have admin privileges on their machine. If flare-data is already installed, there's no real way for them to test local data. Using local data first would solve this scenario.

from flare-game.

pennomi avatar pennomi commented on May 22, 2024

Seems like it's an obvious win to check local data first. Also, from what I understand, it's also NOT violating XDG specifications.

from flare-game.

Bertram25 avatar Bertram25 commented on May 22, 2024

Glad to see everyone seems ok with it. Mind if I provide a merge request for flare-engine?

Is it enough to check the existence of the mods/ folder, or should I check for something else as well to make sure we have local data?

from flare-game.

stefanbeller avatar stefanbeller commented on May 22, 2024

Mind if I provide a merge request for flare-engine?

A pull request is always very welcome :)
I guess checking for a mod folder is ok.

Another question of me would be if we could take the mods from different locations, so for example the fantasycore mod is installed, and a non admin user could still add his own personal mod to change only some small tweaks locally in his home directory.

from flare-game.

Bertram25 avatar Bertram25 commented on May 22, 2024

Hi Stephan,

A pull request is always very welcome :)
I guess checking for a mod folder is ok.

Ok, I'll do it.

Another question of me would be if we could take the mods from different locations, so for example the fantasycore mod is installed, and a non admin user could still add his own personal mod to change only some small tweaks locally in his home directory.

Up to you guys, I guess it's a different option needed for that use case. Could this change my patch content? So, shall I wait for a decision about it?

from flare-game.

Bertram25 avatar Bertram25 commented on May 22, 2024

@stefanbeller I'll do a merge request as discussed for now asap.

from flare-game.

Bertram25 avatar Bertram25 commented on May 22, 2024

Made : https://github.com/clintbellanger/flare-engine/pull/404

Waiting for approval.

from flare-game.

Bertram25 avatar Bertram25 commented on May 22, 2024

Has been merged with:
clintbellanger/flare-engine@38b51f8

from flare-game.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.