Giter Club home page Giter Club logo

Comments (3)

Mortasen avatar Mortasen commented on June 5, 2024

Sorry, didn't notice that Steam version is not supported. But still, if it's not supported only because of this issue, I want to propose a solution that I found: this "Allow game launch?" window does not appear, if you run the game this way:
/home/USER/.local/share/Steam/ubuntu12_32/steam -applaunch 427520 --disable-audio --disable-prototype-history --load-game /tmp/mapshot1126956423/test.zip --mod-directory /tmp/mapshot1126956423/mods
instead of the method that currently is used in the program:
/home/USER/.local/share/Steam/ubuntu12_32/steam steam://run/427520//%27--disable-audio%27%20%27--disable-prototype-history%27%20%27--load-game%27%20%27%2Ftmp%2Fmapshot1126956423%2Ftest.zip%27%20%27--mod-directory%27%20%27%2Ftmp%2Fmapshot1126956423%2Fmods%27
So maybe it's possible to add parameter that uses this workaround for Steam version. Anyway, thanks for this mod, it's really helpful!

from mapshot.

Palats avatar Palats commented on June 5, 2024

Thanks for the suggestions! From what I vaguely remember, one of the issue was that things were behaving differently whether Steam was running or not, leading to a very weird experience - and I did not find a good workaround at the time. I'll dig into your suggestion, to see if we can have something automatic, which does not fail (too much) if steam itself is not running. Thanks!

from mapshot.

Palats avatar Palats commented on June 5, 2024

I've tested a bit further, so a few notes, for the day I am motivated to add proper steam support:

  • Currently, mapshot does not run the steam binary, it runs the factorio binary. However, when pointing to a steam factorio binary, that binary will itself run steam - hence leading to the command lines mentioned in comment above.
  • That means there is no control over how steam is launched if using the steam factorio binary.
  • So, steam factorio support would mean calling steam directly, which is possible.
  • Determining the steam binary to use is tricky - e.g., on my system, this is not .local/share/Steam/ubuntu12_32/steam but .local/share/Steam/ubuntu12_64/steam as far as I can tell, but both are present. And when calling the wrong ones, it starts doing updates and other thing, so, probably not a good idea to pick a random one.
  • Simplest here would be to use the one in the path (or manually specified of course).

Then there is the question of shutdown at the end of the render:

  • When running the steam factorio binary, even exiting factorio will not stop the command - steam will still be running.
  • Same story with steam -applaunch 42752.
  • Shutting down factorio at the end of the render is not that fundamental - mapshot detects the end of the rendering through a file created in the script-output, and the shutdown is just to have a nice integrated experience.
  • Maybe there could be something to do to still shutdown factorio (but not steam) at the end of the render, by looking at the process list. A bit hacky, but the process hierarchy should be enough to consistently identify it.
  • It is possible to shutdown the steam client (steam -shutdown) - but we don't know if it was running before or not, so it might be a bit unexpected. So it is likely that the steam client will stay running afterward. Not ideal.

Bottom line, I think a steam factorio support on Linux would look like this:

  • Depending on the overall experience, we can either gate usage of steam version behind an explicit flag or make it automatic when possible (with still a flag to force it).
  • Auto detection: identify the presence of a steam command and then look for factorio files to know if it is there.
  • Then, when running in steam mode:
    • use steam -applaunch to run factorio, instead of calling the binary directly.
    • Looking up the process hierarchy to know which process to kill at the end of the render.
    • Optionally, shutdown steam.

The process management part would require extra logic for other systems (MacOS, Windows) which I'm not familiar with.

Also, it should be possible to use the steam version today without any special support in mapshot by creating a script containing something along the lines of:

#!/usr/bin/env bash
exec steam -applaunch 42752 "$@"

And then run mapshot with --factorio_binary pointing to this script and probably --factorio_keep_running. (Untested).

from mapshot.

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.