[Long-term suggestion] Client-side mods

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
EditorRUS
Fast Inserter
Fast Inserter
Posts: 118
Joined: Sat Feb 23, 2013 10:32 pm
Contact:

[Long-term suggestion] Client-side mods

Post by EditorRUS »

Currently, as it stands, each player must download and activate all of the mods used by the host in multiplayer. However there are some mods that are non-game changing or only do things that can be replicated without this mod by players. Those mods are, in a sense, "client-side", that is, they only change things for the player using them. But they still must be explicitly activated by the host and each player must use them. In some cases the inability to use this mod normally forces players to either open a second instance of Factorio just to use this mod or use a standalone application.

Factorio has plenty of public servers and their number is only going to grow in the future, yet the mod system is inflexible for players.
My suggestion is to split mods into two categories: "server-side" and "client-side". Server-side mods enjoy full unrestricted access to API and must be downloaded and activated by all players wanting to play on a server. Client-side mods must only use a different API that is just a safe wrapper around game's API, that is, they are given only limited access. Things like changing biters' AI (Rampant) or cheating yourself items (Creative Mode) clearly belong to server-side mods whereas evenly distributing items between multiple containers (Even Distribution) or calculating requirements for production (Helmod) or even just showing which assemblers are idling or lack resources (Bottleneck) are clearly client-side and should bear no cost for the server.

To be more clear, client-side mods can only do things that a player can do himself.

This is a long-term suggestion because currently there isn't such a great demand for it, but I am pretty sure it's soon going to be problematic if things were to left this way.

Related:
Client side modding (UI / UX)

torne
Filter Inserter
Filter Inserter
Posts: 341
Joined: Sun Jan 01, 2017 11:54 am
Contact:

Re: [Long-term suggestion] Client-side mods

Post by torne »

The issue is that with the current game architecture *all* the mods you mention modify the game state, and thus need to be the same on all copies of the game in multiplayer so that the game state doesn't desync, because the way that multiplayer works is that the only thing distributed between players is their keyboard/mouse inputs. So, for Even Distribution, every player's game needs to agree that "When someone ctrl-drags over multiple items, what that means is even distribution" - they all need the mod. Mod GUIs are also part of the game state: every player knows whether you have helmod open, because everyone is collectively agreeing "when you click on the helmod button that creates a window with these contents" - it's just that the window is only *rendered* on your screen. Bottleneck's lights are actually entities in the gameworld that are just placed on top of the machines; the entities exist for all players and their exact states/locations are part of the game state.

So, yeah: it would be nice to be able to do this, but it would require pretty huge changes to how multiplayer currently works before anything like this would be possible at all.

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

Re: [Long-term suggestion] Client-side mods

Post by ssilk »

Actually I like this idea. But I think the usage is quite limited. I mean, there is just the player - he can craft, build and so on. That's clear.

But the player can also "look around". That is the map view, which is important, cause a player cannot look around everywhere. He cannot add new recipes, cannot add behavior on entities and so on. Sounds simple, but cause everything is connected with everything this can be really hard to be removed for this kind of mod.

Well, I think it is worth beeing implemented as prototype somehow and see, what kind of mods can be done with such an API.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Azgard
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Jul 25, 2017 2:28 am
Contact:

Re: [Long-term suggestion] Client-side mods

Post by Azgard »

+1 for this. I really would like server side mods. There is many thing that can be done and do not need code to be run on client side. For example mod can write some data about the game statistics in database, or generate a game map available on the web, or have some admin commands (there is no need to provide such code for clients). I hope at least something for client/server side mods will be implemented in 0.16 :)

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

Re: [Long-term suggestion] Client-side mods

Post by bobingabout »

Client side mods are actually a possible thing right now... There's one with a bob name in it. Bob Locale.
And as you should be able to tell by the title, it adds translations. Since locale entries aren't server based (Allowing people to play using different languages) it's fine. And the game actually recognises that there is no control.lua, data.lua or settings.lua, and accepts it as a client only mod.

I think scenario packs also work as a client side mod (The optional scenario pack is what actually introduced the client only mods that exist as they do now, though the effort to do this became moot when the steam edition became a thing, because the scenario pack became included for everyone. I paid extra money for that pack too, now everyone gets it.)

The problem comes when you have something that looks like it could obviously work as client only, like "clock", my clock mod (The only mod I've released that doesn't have my name in the title. There's a reason why it doesn't), which adds a clock to the top GUI. It adds a display, nothing more, but because there is actually an on-tick event (draws it on on_init, updates it every tick), there is some data that needs processing. the clock being there or not has absolutely no bearing on the game state, you can't click anything, it doesn't change anything, you can't interact with it in any way, but that update event is a calculation, and just to be sure, it needs to happen on all sides.

Granted, I'd probably need to rewrite things so that it only updates for the client, rather than the current "Multiplayer compatibility" changes I had to do to make it work in multiplayer, but it's a good example of something that I think should be on the client only mods list.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Post Reply

Return to “Ideas and Suggestions”