RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Web file server for game manuals (scummvm, dosbox, ...)

    Scheduled Pinned Locked Moved Ideas and Development
    manualsms-dosscriptingscummvmweb server
    6 Posts 2 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ectoE
      ecto
      last edited by ecto

      Re: Ideas for managing game manuals
      The why
      Many older (usually not console or arcade) games rely on the game manual in different special ways. All who played games on MS-DOS know what I'm talking about:

      • There is the dreaded copy protection that asks for words from the manual, or, in a nicer variant, that reading the manual to gives you essential hints (like the Infocom adventures).
      • Games like the Ultima series hat spell books or printed cloth maps of the game world.
      • Or the infamous "Quick Reference Sheet", that helped understanding, e.g. pressing T meant selecting the targeting computer while Alt-T was used to taunt the enemy.

      So I took some time and hacked together a little script, that serves game manuals, maps, walkthroughs etc. via http, when I access the Retropie in the local network.
      As I'm not too much at home in the *nix world (except for a bit of Retropie), please bear with my ugly code snippets. Here is what I've done:

      The how
      As an example I will use ScummVM, because here many games still need some sort of lookup for the copy protection like many Sierra adventures. So what I did was downloading the manuals (duh) from sources like GOG. And for the harder games, I also looked for maps or FAQs.
      All these files for each game I put into a manuals\ folder (something like ~\RetroPie\roms\scummvm\Zack McKracken\mauals\.

      Now comes the webserver part: First you need some one-line webserver. I chose webfs, as it was easily installed. Then you have to tell webfs, which folder to serve. I did that with the runcommand-onstart.sh script and entered the following:

      if [ $2 = "scummvm" ]
      then
          gamename=`basename "$3" .svm`
          tmp_file=$(mktemp)
      	sed -n '1,/\['$gamename'\]/d;/\[/,$d;p' /opt/retropie/configs/scummvm/scummvm.ini > $tmp_file
      	gamepath=$(sed -nr '/path=/ s/.*path=([^"]+).*/\1/p' $tmp_file)/manual
          if [ -d "$gamepath" ]
      	then
      	    webfsd -r "$gamepath"
      	fi 
      fi
      

      What in this script happens is this:

      • $gamename is the name of the rom without the ending
      • a temporary file tmp_fileis created
      • copy the scummvm.ini from the entry starting with [$gamename] (so in my example [zak]) until the next enty into the tmp_file
      • copy the path line of that entry into $gamepath
      • check, whether that path has a manual\ subfolder
      • start webfs with said path

      I can than access the Retopie under 192.168.1.15:8000 and download / view the manuals or whatever after I have started a Scummvm game.

      In the runcommand_onend I put a line killing the webfsd using pkill webfsd.

      And that's all
      I must say, it was a lot of fun tinkering around, but it took me a loong time (especially understanding those sed commands, but I think it was well worth the effort. I made something similar for MS-DOS games, but as I have a custom-made dosbox starting script, it wouldn't work for everyone.

      What can be done now, is making it more easy to navigate. I was thinking of using the Retropie as a WiFi access-point, that displays the content of the manuals folder as soon as it is accessed, but so far I have no idea how to do that. Also, there are some security concerns...
      Then it would be great if the *.pdf files could be viewed online without the need to download them (as some manuals are quite big).

      I hope I have sparked some interest in this whole "manual-serving-thing" and whish you all happy retro-gaming!

      1 Reply Last reply Reply Quote 2
      • F
        Folly
        last edited by

        @ecto

        Very nice idea.
        Don't have that much time now.
        But if I can I will look in to this a bit deeper.

        Just curious, couldn't you use the cut command for cutting on delimiter ?

        ectoE 1 Reply Last reply Reply Quote 0
        • ectoE
          ecto @Folly
          last edited by

          @folly said in Web file server for game manuals (scummvm, dosbox, ...):

          Just curious, couldn't you use the cut command for cutting on delimiter ?

          I don't understand what you mean... ^^;

          But yeah, it taks some time to set up. Especually the downloading and sorting of the manuals into tge right folders.

          When I think about it, you could make it a lot easier when you just put all manuals into one folder and have the webserver just use this one folder... Well water under the bridge :D

          F 1 Reply Last reply Reply Quote 0
          • F
            Folly @ecto
            last edited by Folly

            @ecto said in Web file server for game manuals (scummvm, dosbox, ...):

            @folly said in Web file server for game manuals (scummvm, dosbox, ...):

            Just curious, couldn't you use the cut command for cutting on delimiter ?

            I don't understand what you mean... ^^;

            Perhaps I have to read your post better.
            Well I assumed you extract the filename from the path and then use this to built the weblink including the filename of the game. For that you use "sed". Indeed, if you never used sed it is quite difficult to understand. Sometimes it is easier to use "cut" or "grep" for that mather. But it's not always a replacement.

            But yeah, it taks some time to set up. Especually the downloading and sorting of the manuals into tge right folders.

            When I think about it, you could make it a lot easier when you just put all manuals into one folder and have the webserver just use this one folder... Well water under the bridge :D

            So perhaps some WIP.

            Edit:
            I misread your post the first time.

            So basically it woks like this, am I right ? :

            • you get the path of you game running on your pi
            • setup a small webserver on your pi
            • link the manual path to the webserver on your pi
            • connect another comuter/tablet to your webserver to view the manual
            • view manual on other computer/tablet while playing the game on your pi
            • shut down the webserver when you quit the game on your pi
            ectoE 1 Reply Last reply Reply Quote 0
            • ectoE
              ecto @Folly
              last edited by

              @folly said in Web file server for game manuals (scummvm, dosbox, ...):

              So basically it woks like this, am I right ? :

              you get the path of you game running on your pi
              setup a small webserver on your pi
              link the manual path to the webserver on your pi
              connect another comuter/tablet to your webserver to view the manual
              view manual on other computer/tablet while playing the game on your pi
              shut down the webserver when you quit the game on your pi

              Yes that's right! :D So far, when I select a pdf manual, it will be downloaded to the pad/phone for reading while I play. This way I can chack for copy protections and/or clues while I play a game on the Retropie.

              F 1 Reply Last reply Reply Quote 0
              • F
                Folly @ecto
                last edited by Folly

                @ecto said in Web file server for game manuals (scummvm, dosbox, ...):

                Yes that's right! :D So far, when I select a pdf manual, it will be downloaded to the pad/phone for reading while I play. This way I can chack for copy protections and/or clues while I play a game on the Retropie.

                At first I was thinking that you could read the manual before you were going to play. but this is indeed better.

                Have you read my thread on translation ?
                https://retropie.org.uk/forum/topic/28461/translate-games-on-the-fly
                While thinkering with this I also discovered this :
                https://retropie.org.uk/forum/topic/28345/old-computer-appreciation-thread/420

                Perhaps an idea for you to tinker with.
                In theory you could match the sum of a screenshot, with extra information. and output it back in speech or as an overlay in the game.

                1 Reply Last reply Reply Quote 0
                • 3Draco3 3Draco referenced this topic on
                • First post
                  Last post

                Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.