Let graphic-tweak mods not demand multiplayer synch

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
User avatar
Taehl
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Sun Jan 18, 2015 2:23 am
Contact:

Let graphic-tweak mods not demand multiplayer synch

Post by Taehl »

Hard to fit all that in the title, sorry. But what I mean is, currently, if anyone makes a mod which only changes some graphics (like updated icons or that bright-colors terrain one), Factorio sees this as "making a change to game state" which requires everyone else in a multiplayer game to have the same mod. Since these mods don't change gameplay, why would one person having a dark monitor necessitate every player to have brighter graphics?

Currently, the only way I know of around this is to take the graphics from the mod(s) and overwrite Factorio's default images. That's a horrible way to do it. I'm not sure how this change would fit with the data.raw schema... Perhaps it would better if Factorio, like many other games, automatically updates default images to mods' images* when they have an identical name and folder structure? I mean, if the mod has the file /graphics/icons/basic-mining-drill.png but no .lua files, it would be safe to assume the mod just wants to update the graphic (and having no code prevents changing game state!).

The only real argument I can think of against allowing such easy graphics swaps is that someone might replace enemy graphics with super-visible red circles and run an aimbot or something... But you already auto-aim in Factorio. 8-)

*It should probably do a few other file types too, for sounds and whatnot. Perhaps any audio files placed in sound/music likewise get loaded and added to the playlist with no code required.

Koub
Global Moderator
Global Moderator
Posts: 7199
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Let graphic-tweak mods not demand multiplayer synch

Post by Koub »

I think it's already the case. the CRC check is only made on what would cause problems if non identical.
Yes, found it : viewtopic.php?p=145702#p145702
Koub - Please consider English is not my native language.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Let graphic-tweak mods not demand multiplayer synch

Post by ssilk »

It means, that the sizes etc. needs to be exactly the same, just the bitmaps (the linked picure-files) can change.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Let graphic-tweak mods not demand multiplayer synch

Post by bobingabout »

I think the issue is that the graphics are defined in the data files, under animation. Although it shouldn't change anything in game except the graphics.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
Taehl
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Sun Jan 18, 2015 2:23 am
Contact:

Re: Let graphic-tweak mods not demand multiplayer synch

Post by Taehl »

Here's an example of what I mean:
Shows icon change mod requiring synch
Shows icon change mod requiring synch
synch-needed.png (185.96 KiB) Viewed 2313 times
Here's the complete code for IconFix (in data-updates.lua):

Code: Select all

local dat = data.raw

dat.item["basic-mining-drill"].icon = "__IconFix__/graphics/icons/basic-mining-drill.png"
dat.item["solar-panel"].icon = "__IconFix__/graphics/icons/solar-panel.png"
dat.item["steel-chest"].icon = "__IconFix__/graphics/icons/steel-chest.png"
dat.container["steel-chest"].picture.filename = "__IconFix__/graphics/entity/steel-chest.png"

dat.blueprint["blueprint"].icon = "__IconFix__/graphics/icons/blueprint.png"
dat["deconstruction-item"]["deconstruction-planner"].icon = "__IconFix__/graphics/icons/deconstruction-planner.png"
dat.item["construction-robot"].icon = "__IconFix__/graphics/icons/construction-robot.png"
dat.item["logistic-robot"].icon = "__IconFix__/graphics/icons/logistic-robot.png"
dat.item["flying-robot-frame"].icon = "__IconFix__/graphics/icons/flying-robot-frame.png"
dat.item["alien-artifact"].icon = "__IconFix__/graphics/icons/alien-artifact.png"
dat.item["battery"].icon = "__IconFix__/graphics/icons/battery.png"
dat.item["explosives"].icon = "__IconFix__/graphics/icons/explosives.png"

dat.capsule["defender-capsule"].icon = "__IconFix__/graphics/icons/defender-capsule.png"
dat.capsule["distractor-capsule"].icon = "__IconFix__/graphics/icons/distractor-capsule.png"
dat.capsule["destroyer-capsule"].icon = "__IconFix__/graphics/icons/destroyer-capsule.png"
dat.item["land-mine"].icon = "__IconFix__/graphics/icons/land-mine.png"
dat.item["gun-turret"].icon = "__IconFix__/graphics/icons/gun-turret.png"
dat.item["laser-turret"].icon = "__IconFix__/graphics/icons/laser-turret.png"
dat.item["car"].icon = "__IconFix__/graphics/icons/car.png"
dat.item["tank"].icon = "__IconFix__/graphics/icons/tank.png"

dat["movement-bonus-equipment"]["basic-exoskeleton-equipment"].sprite.filename = "__IconFix__/graphics/equipment/basic-exoskeleton-equipment.png"
dat.item["battery-equipment"].icon = "__IconFix__/graphics/icons/battery-equipment.png"
dat["battery-equipment"]["battery-equipment"].sprite.filename = "__IconFix__/graphics/equipment/battery-equipment.png"
dat.item["battery-mk2-equipment"].icon = "__IconFix__/graphics/icons/battery-mk2-equipment.png"
dat["battery-equipment"]["battery-mk2-equipment"].sprite.filename = "__IconFix__/graphics/equipment/battery-mk2-equipment.png"
dat.item["energy-shield-equipment"].icon = "__IconFix__/graphics/icons/energy-shield-equipment.png"
dat["energy-shield-equipment"]["energy-shield-equipment"].sprite.filename = "__IconFix__/graphics/equipment/energy-shield-equipment.png"
dat.item["energy-shield-mk2-equipment"].icon = "__IconFix__/graphics/icons/energy-shield-mk2-equipment.png"
dat["energy-shield-equipment"]["energy-shield-mk2-equipment"].sprite.filename = "__IconFix__/graphics/equipment/energy-shield-mk2-equipment.png"
dat.item["solar-panel-equipment"].icon = "__IconFix__/graphics/icons/solar-panel-equipment.png"
dat["solar-panel-equipment"]["solar-panel-equipment"].sprite.filename = "__IconFix__/graphics/equipment/solar-panel-equipment.png"
dat.item["fusion-reactor-equipment"].icon = "__IconFix__/graphics/icons/fusion-reactor-equipment.png"
dat["generator-equipment"]["fusion-reactor-equipment"].sprite.filename = "__IconFix__/graphics/equipment/fusion-reactor-equipment.png"
I think the issue is that Factorio (understandably) needs data.raw to be synchronized (that CRC check) for clients to have any hope of synching in multiplayer. So by having to update data.raw to change the graphics, the game wants it it synchronized.

(Incidentally, this synch-being-required thing even happens to a mod I'm making which does nothing but change the colors of things on the map)

Post Reply

Return to “Ideas and Suggestions”