Skip to content

Instantly share code, notes, and snippets.

@alifeee
Last active January 30, 2024 23:23
Show Gist options
  • Save alifeee/fb16acc9b4cc8b6d52e4f3226cc10197 to your computer and use it in GitHub Desktop.
Save alifeee/fb16acc9b4cc8b6d52e4f3226cc10197 to your computer and use it in GitHub Desktop.
Factorio map hosting

Factorio Map

Incremental explorable maps of a Factorio game played with 16 people and proximity chat using https://github.com/alifeee/Factorio-Proximity-Voice-Chat/

To create maps

Using https://github.com/L0laapk3/FactorioMaps as instructed.

With:

  1. saves from Steam version of Factorio in C:\Users\alifeee\AppData\Roaming\Factorio\saves
  2. saves moved from here to standalone Factorio install in D:\Factorio\Factorio_1.1.100\saves
  3. FactorioMaps mod installed in D:\Factorio\Factorio_1.1.100\mods\L0laapk3_FactorioMaps_4.4.0

Assuming the saves are named "multplayer 1", "multplayer 2", etc...

Run the following to generate the map frontend

find . -regex '.*mult.*' | awk '{printf "\"%s\" ", substr($0, 3, length-6)} END {print ""}'
  # copy output
# paste from above
py auto.py --dayonly multplayer "multplayer start" "multplayer 1" "multplayer 2" ...

The maps will be output to D:\Factorio\Factorio_1.1.100\script-output\FactorioMaps\multplayer start. These files are the ones which should be hosted on the web.

Zip up that folder with (following instructions from SCP gist) and send it to my server

tar -czf "multplayer.tar.gz" "multplayer"
scp .\multplayer.tar.gz root@server.alifeee.co.uk:/var/www

Then unzip it on the server and rename the folder

tar -xzf "multplayer.tar.gz"
mv "/var/www/multplayer" /var/www/factorio_map

nginx config

The nginx config to serve these files is (inside existing server block)

nano /etc/nginx/nginx.conf
nginx -t
/etc/init.d/nginx restart
                location /factorio {
                        alias /var/www/factorio_map/;
                        try_files $uri $uri/ =404;
                }

Then the map can be viewed on https://server.alifeee.co.uk/factorio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment