Friday Facts #174 - Mod gui

Regular reports on Factorio development.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14045
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Friday Facts #174 - Mod gui

Post by Rseding91 »

badgamernl wrote:Plss make the mod-gui scenario friendly, it would help my server allot! It would also be cool if there was a way to make server side and client side code and the communication between the client and the server. Take for instance garry's mod it has client and server side code and a way to communicate with a database. This would add the possibility to make a ranking system that will in return get you a more stable player base. Or add a permissions system, but wy make it yourself when the community can make it! The problem with factorio now is that when you make a server and want admins on it they can run commands and then the achievement system says console command used in return players will leave because of it. It would also be cool if there was a server list ranking system and a bookmark system to make the life of players easier!
Factorio doesn't have a concept of client vs. server when it comes to mods.

Mod devs can't even get the basic system we have now correct and frequently cause desyncs. Making them client vs. server and leaving it up to the mod author(s) to do it correctly just sounds like a horrible idea.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Proxy
Fast Inserter
Fast Inserter
Posts: 165
Joined: Mon Mar 30, 2015 11:10 am
Contact:

Re: Friday Facts #174 - Mod gui

Post by Proxy »

Klonan wrote:
Wingman24 wrote:Do we have an ETA on .15? (Sorry if I missed this in a previous FF)
No ETA yet - Further news when we have it folks
Wait, last FFF it was said to be February 2017....

aober93
Filter Inserter
Filter Inserter
Posts: 453
Joined: Tue Aug 30, 2016 9:07 pm
Contact:

Re: Friday Facts #174 - Mod gui

Post by aober93 »

Mod GUI? mmm is it a good idea to have mod sets, that when you join different multiplayer servers ,or just play different singleplayer maps you select a set of mod with a click of a button, so you dont go over selecting and deselecting mods manually. Which would be ok, but its becoming difficult to remember mod names.

Rseding91
Factorio Staff
Factorio Staff
Posts: 14045
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Friday Facts #174 - Mod gui

Post by Rseding91 »

Proxy wrote:
Klonan wrote:
Wingman24 wrote:Do we have an ETA on .15? (Sorry if I missed this in a previous FF)
No ETA yet - Further news when we have it folks
Wait, last FFF it was said to be February 2017....
No, we didn't: https://www.factorio.com/blog/post/fff-173
If you want to get ahold of me I'm almost always on Discord.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Friday Facts #174 - Mod gui

Post by Nexela »

I for one will not install any mods that do not conform to this new unifying script :)

mohkev
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Nov 06, 2015 11:38 pm
Contact:

Re: Friday Facts #174 - Mod gui

Post by mohkev »

I cannot express to you guys how much I appreciate the work that happens on this game. The constant updates, tweaks and full blown additions to this game is awesome. It's obvious that this product is a labor of love for you all. The changes you make really are about bettering the game and the community at large. I am always surprised at how much more awesome this game gets with every change. Thank you. Thank you. Thank you.

User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 416
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

Re: Friday Facts #174 - Mod gui

Post by y.petremann »

Rseding91 wrote:
badgamernl wrote:Plss make the mod-gui scenario friendly, it would help my server allot! It would also be cool if there was a way to make server side and client side code and the communication between the client and the server. Take for instance garry's mod it has client and server side code and a way to communicate with a database. This would add the possibility to make a ranking system that will in return get you a more stable player base. Or add a permissions system, but wy make it yourself when the community can make it! The problem with factorio now is that when you make a server and want admins on it they can run commands and then the achievement system says console command used in return players will leave because of it. It would also be cool if there was a server list ranking system and a bookmark system to make the life of players easier!
Factorio doesn't have a concept of client vs. server when it comes to mods.

Mod devs can't even get the basic system we have now correct and frequently cause desyncs. Making them client vs. server and leaving it up to the mod author(s) to do it correctly just sounds like a horrible idea.
Here is a flowchart of how I think it should works.
Factorio-Modding.png
Factorio-Modding.png (196.43 KiB) Viewed 6727 times
Almost everything can be put in those part already for prototypes, like all visual thing in prototypes are client side, and shouldn't affect checksum and synchronisation, I simply can't see a server side entity for now.
So the only thing needed would be that when registering mods, it would temporary crop every esthetic information and do the checksum, mods that modify nothing that needed for synchronisation could be marked as safe for synchronisation.

Almost all gui are either a informative one the client could hold, a sensitive one the server could handle in conjunction with the client side one, and the other scripts with are common to client and server.

client side control could be naned : control-client.lua
server side control could be naned : control-server.lua

User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 416
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

Re: Friday Facts #174 - Mod gui

Post by y.petremann »

Also if this is a simple optional lua file, could you provide it for modders somewhere, so they could update to this system asap in 0.14 and use it in 0.15 natively ?

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Friday Facts #174 - Mod gui

Post by Nexela »

y.petremann wrote:Also if this is a simple optional lua file, could you provide it for modders somewhere, so they could update to this system asap in 0.14 and use it in 0.15 natively ?

I was thinking along the same lines :)

Rseding91
Factorio Staff
Factorio Staff
Posts: 14045
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Friday Facts #174 - Mod gui

Post by Rseding91 »

y.petremann wrote:Almost all gui are either a informative one the client could hold, a sensitive one the server could handle in conjunction with the client side one, and the other scripts with are common to client and server.

client side control could be naned : control-client.lua
server side control could be naned : control-server.lua
You seem to be missing 2 major issues:
  • If a given GUI is persisted between save/load it must be part of the game state and must be present on all peers
  • If a mod can read information about a GUI existing or read information from the GUI then that information must be part of the game state and must be present on all peers
If not, then it will cause desyncs when mod A on peer 1 says "I've got a GUI so I'll do X" and mod A on peer 2 says "I have no GUI so I won't do X" and the 2 simulations now aren't the same and it desyncs.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Proxy
Fast Inserter
Fast Inserter
Posts: 165
Joined: Mon Mar 30, 2015 11:10 am
Contact:

Re: Friday Facts #174 - Mod gui

Post by Proxy »

Rseding91 wrote:
Proxy wrote:
Klonan wrote:
Wingman24 wrote:Do we have an ETA on .15? (Sorry if I missed this in a previous FF)
No ETA yet - Further news when we have it folks
Wait, last FFF it was said to be February 2017....
No, we didn't: https://www.factorio.com/blog/post/fff-173
Wait... what did i read then?
aww, my Plans have been Smashed. :c

shimadouma
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Jan 11, 2017 5:33 pm
Contact:

Re: Friday Facts #174 - Mod gui

Post by shimadouma »

Proxy wrote: Wait... what did i read then?
aww, my Plans have been Smashed. :c
I think it's fff-164
It's two months ago and their situation might have changed...?

Karakaz
Inserter
Inserter
Posts: 22
Joined: Sat Jan 21, 2017 12:00 am
Contact:

Re: Friday Facts #174 - Mod gui

Post by Karakaz »

Hi, I am quite new to Factorio modding but I've made some addons for wow. I have to say the Ace library is great for making guis in wow. You guys seem to know what you're doing already, but I would definitely take inspiration from that library if I could, as it is quite easy to use for addon creators.

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

Re: Friday Facts #174 - Mod gui

Post by bobingabout »

That example GUI you used doesn't include Bob's Inserters! :o
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: Friday Facts #174 - Mod gui

Post by Nexela »

Sorry Bob, I removed the button because it didn't conform to my "standards" :)
viewtopic.php?f=89&t=31641#p199567

BenSeidel
Filter Inserter
Filter Inserter
Posts: 588
Joined: Tue Jun 28, 2016 1:44 am
Contact:

Re: Friday Facts #174 - Mod gui

Post by BenSeidel »

Can you make the style an optional parameter? so in the API do a
if(style == nil)
style = mod_gui.frame_style
end

I only say that because then the 99% of modders will just automatically fall into the default style guide. If someone wants a different behaviour then they can read up on the parameter and do what they currently do.

User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 416
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

Re: Friday Facts #174 - Mod gui

Post by y.petremann »

Rseding91 wrote:
y.petremann wrote:Almost all gui are either a informative one the client could hold, a sensitive one the server could handle in conjunction with the client side one, and the other scripts with are common to client and server.

client side control could be naned : control-client.lua
server side control could be naned : control-server.lua
You seem to be missing 2 major issues:
  • If a given GUI is persisted between save/load it must be part of the game state and must be present on all peers
  • If a mod can read information about a GUI existing or read information from the GUI then that information must be part of the game state and must be present on all peers
If not, then it will cause desyncs when mod A on peer 1 says "I've got a GUI so I'll do X" and mod A on peer 2 says "I have no GUI so I won't do X" and the 2 simulations now aren't the same and it desyncs.
In the case if GUI, there is two major parts, client and common gui. They are separated and are not relevant to the other one, they don't even can access to each other unless they use the remote remote call (which could try to call a interface function on a specific part)

If the gui is part of control.lua, then it's totally relevant to the game state and then work like now, clicking in a common gui element wouldn't fire a click event on the client part.
If the gui is part of control-client.lua, then the gui is totally irrelevant to the game state, click on a client gui element wouldn't fire a click event on the common part.
The gui would need to rebuild from scratch at each connection, but could ask the server if it has information for him, here a example :
Finaly if any part want to do something (including geting information), it needs to call a interface of the corresponding part, unless this is exposed informations so each part can access their respective environement, client and server have read-only access to common environement)
Here a quick simplified example of what I had in mind :
control-client.lua
control-server.lua
control.lua
For this I've created a temporary script :
advanced_remote.lua
ALso to have control-client and control-server, I've put a require "control-client" and require "control-server" on the control.lua, but that not the way it should work in the future
Rseding91 wrote: You seem to be missing 2 major issues:
  • If a given GUI is persisted between save/load it must be part of the game state and must be present on all peers
  • If a mod can read information about a GUI existing or read information from the GUI then that information must be part of the game state and must be present on all peers
If not, then it will cause desyncs when mod A on peer 1 says "I've got a GUI so I'll do X" and mod A on peer 2 says "I have no GUI so I won't do X" and the 2 simulations now aren't the same and it desyncs.
In fact if information from the client or the server are given to the other part like controls or chat commands. Here I think what your saying is irelevant since common part don't see client or server things (gui included).
Additionnaly if the server hold sensitive informations, if any player try to save the world localy, it would not get the server side informations, Which is an additionnal layer of security.

Crixomix
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Wed Feb 24, 2016 1:10 am
Contact:

Re: Friday Facts #174 - Mod gui

Post by Crixomix »

So is there a way to copy train schedules? One of the longer parts of setting up a new train outpost is creating all the wait conditions and such for the new train. I would love to just copy from another one, and then just change one little thing.

Weresmilodon
Inserter
Inserter
Posts: 40
Joined: Thu Jul 10, 2014 8:11 pm
Contact:

Re: Friday Facts #174 - Mod gui

Post by Weresmilodon »

Crixomix wrote:So is there a way to copy train schedules? One of the longer parts of setting up a new train outpost is creating all the wait conditions and such for the new train. I would love to just copy from another one, and then just change one little thing.
You do it the same way you copy between assemblers, or really anything. Shift Left and Right clicking.

Xeteth
Fast Inserter
Fast Inserter
Posts: 158
Joined: Tue Feb 17, 2015 6:06 am
Contact:

Re: Friday Facts #174 - Mod gui

Post by Xeteth »

Love the coloured Train Stops!

Can I put in a request for Twinsen to do a FFF soon on upcoming 0.15 circuit network/combinator additions and changes? I have many ideas planned combinator-wise and would love to hear exactly what come out of the development proposal thread (viewtopic.php?f=9&t=30853).

Post Reply

Return to “News”