How to publish "Startup" Mod settings

Anything that prevents you play the game properly. Do you have issues with paying for the game, downloading it or properly running it on your computer? Let us know here.
Post Reply
Stimpatch
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Sep 11, 2019 8:23 am
Contact:

How to publish "Startup" Mod settings

Post by Stimpatch » Wed Sep 11, 2019 9:12 am

Hey there, ne win the Server hosting thing, and i have a question:

Recently i got access to a factorio headless server and started to play around with it, so some friends and myself can play together. Here is the situation:
Last Week i installed Deadlocks industrial Revolution (great mod btw) and restartet the server with a new map. We played for some time, no errors, all good. 2 days later i find out deadlock lets you select your own laser turret color. COOL, gotta do that. This setting is done in the "Startup" tab, so it needs a restart on my client. After the change this setting (to my knowlege) went into the config.dat (not sure abot the name, NOT the json file) next to my mods in my mods folder. So i pushed that file onto the server and restartet the server. Boom, works. NICE.
But. Next time a friend connected to the server, he was rejected with some error about mod mismatch. Later i got to him, made him do the same settings in his client about the laser color, all working again.

So my quastion is: Whats the correct way to update setting in the "Startup" tab for your headless server, so it does not break thins for other clients?

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 3496
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: How to publish "Startup" Mod settings

Post by eradicator » Wed Sep 11, 2019 9:54 am

Stimpatch wrote:
Wed Sep 11, 2019 9:12 am
But. Next time a friend connected to the server, he was rejected with some error about mod mismatch. Later i got to him, made him do the same settings in his client about the laser color, all working again.
That sounds like a bug in Industrial Revolution, you should report it. Normally the sever should just ask your friend if he wants to synchronize the settings with the server.

Technical explanation: When a mod uses a user-setting based conditional require() it's checksum changes and the game thinks that it's a "different" mod. Mods should therefore always require() all files and handle the conditions somewhere else.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 1270
Joined: Fri Nov 06, 2015 7:41 pm
Contact:

Re: How to publish "Startup" Mod settings

Post by Deadlock989 » Wed Sep 11, 2019 10:56 am

Ugh. This does sound like a silly mistake in IR. It makes sense that this would cause an issue.

Can you do me a favour and report it on the mod portal page? That's my best substitute for a bug tracker at the moment (yes, I'm aware of other options, no need to advise me). Never mind, done it for you.

I can think of one very immediate and easy fix: remove the option completely. Preserving the option so that it works in multiplayer will need more thought and work, I could do it with tints instead, but that would mean re-doing the beam graphics. Alternatively, load the game up with all 12 coloured beam definitions, increasing VRAM and memory use, and assign them dynamically at runtime instead of during the data stage, maybe, if that's possible.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 3496
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: How to publish "Startup" Mod settings

Post by eradicator » Wed Sep 11, 2019 11:10 am

Deadlock989 wrote:
Wed Sep 11, 2019 10:56 am
Alternatively, load the game up with all 12 coloured beam definitions, increasing VRAM and memory use, and assign them dynamically at runtime instead of during the data stage, maybe, if that's possible.
I don't have the first clue how IR is structured, but it sounds like you want somethnig like this:

Code: Select all

--file_with_all_the_beams
return {
	beam1 = {},
	beam2 = {},
	}

Code: Select all

local beams = require('file_with_all_the_beams')
turrent_prototype.beam = beams[settings.startup[option_name]]
I.e. there's no need to load all the beams, you just need to load the *files* that contain the beams.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 1270
Joined: Fri Nov 06, 2015 7:41 pm
Contact:

Re: How to publish "Startup" Mod settings

Post by Deadlock989 » Wed Sep 11, 2019 11:11 am

eradicator wrote:
Wed Sep 11, 2019 11:10 am
I don't have the first clue how IR is structured
I do, though. I'm on it.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 3496
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: How to publish "Startup" Mod settings

Post by eradicator » Wed Sep 11, 2019 11:16 am

Deadlock989 wrote:
Wed Sep 11, 2019 11:11 am
eradicator wrote:
Wed Sep 11, 2019 11:10 am
I don't have the first clue how IR is structured
I do, though. I'm on it.
Sorry for trying to help then.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Stimpatch
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Sep 11, 2019 8:23 am
Contact:

Re: How to publish "Startup" Mod settings

Post by Stimpatch » Wed Sep 11, 2019 11:19 am

eradicator wrote:
Wed Sep 11, 2019 9:54 am
Normally the sever should just ask your friend if he wants to synchronize the settings with the server.
Ah, okay, thats what i expected to happen.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 1270
Joined: Fri Nov 06, 2015 7:41 pm
Contact:

Re: How to publish "Startup" Mod settings

Post by Deadlock989 » Wed Sep 11, 2019 11:20 am

eradicator wrote:
Wed Sep 11, 2019 11:16 am
Sorry for trying to help then.
Now, now. No need for that. This psychologist puts it better than I could. I know when and how to ask for help.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 3496
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: How to publish "Startup" Mod settings

Post by eradicator » Wed Sep 11, 2019 12:36 pm

Deadlock989 wrote:
Wed Sep 11, 2019 11:20 am
eradicator wrote:
Wed Sep 11, 2019 11:16 am
Sorry for trying to help then.
Now, now. No need for that. This psychologist puts it better than I could. I know when and how to ask for help.
I think i'll bookmark that for later use. Maybe someone else'll find the code bit useful ;).
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 1270
Joined: Fri Nov 06, 2015 7:41 pm
Contact:

Re: How to publish "Startup" Mod settings

Post by Deadlock989 » Wed Sep 11, 2019 11:36 pm

In tests on Windows hosted games, I've not been able to reproduce this. However I don't currently have access to a Linux install so I can't test the headless server.

On two Windows machines, with identical versions of IR and any other mods installed, if laser beam colour start-up settings differ, then the client trying to join the game will be prompted to sync settings and restart the game. Click confirm, the game restarts, you're able to connect. This is correct and expected behaviour. My understanding is that if it works on a Windows host, it should work on a Linux headless host.

Is it at all possible that "some error about mod mismatch" was actually an error about mod mismatch?

The best place to report suspected bugs in IR is on the mod portal page, please follow the advice there about the information required to successfully diagnose issues.

Post Reply

Return to “Technical Help”

Who is online

Users browsing this forum: everything-narrative