[i]Read this post on our [url=https://factorio.com/blog/post/fff-305]website[/url].[/i] [h1]Lua Mod GUI additions[/h1] Mod GUIs have been an interesting part of Factorio modding since I started working at Wube. They allow scenarios and mods to add GUIs that look and feel like the base game. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/0c947bdd0d4c030cf2af87197866c3893daad7ba.png[/img] When someone new to Factorio modding is introduced to how they function, they almost always have the same questions:[list][*]Why is mod GUI part of the game state?[*]Why do mod GUIs need to be deterministic?[*]How can I edit the base game GUIs?[/list] And then comes the explanation:[list]The actual widgets are not part of the game state and are not deterministic. The part that mods have access to however is. In an environment where mods have to operate deterministically, if a mod is allowed to read some data that data must be deterministic. In that simple bit of logic; if a mod can read the checked state of a checkbox then that checked state needs to be deterministic. If the mod didn't have access to read that state it would need to store the last-known state and update it every time it got the changed event.[/list] Try to imagine that: every single mod implementing their own system for remembering last-known-state about GUIs they're using. Instead of leaving that entire mess to mod developers we decided long ago that we would manage that "last-known-state" for them. The basic data about what a given mod wanted to show on screen is recorded so mods can read and change it as they want and not need to be concerned with constantly updating it every time some changed event happens. Additionally it means that the game can use that "last known state" to restore what the player sees if they save, quit, and load the game. That still leaves the last question: "How can I edit the base game GUIs?". Using the above example it's much easier to explain that: as a mod - you can't. The base game GUIs are not implemented using this same system - they're just pure collections of widgets. None of the "last known state" is saved anywhere and it's all lost when saving, quitting, and loading. However, that leaves a divide: we need to implement each widget type through the "CustomGui" system in order for mods to be able to use them. With this latest release I finally figured out a way to do tabbed panes since they're special in how they work compared to everything else. Additionally I figured out a semi-friendly way for mods to put things directly on the screen in a way that the player can drag them around - instead of being limited to some fixed area (left, top, center, etc). Another system which I've been thinking about for quite some time is some way for mods to position GUI elements relative to base game GUIs. For example: a mod wants to add a pane which shows on the left of the character inventory GUI. Currently it's not possible - the base game GUI isn't readable by mods so they can't do anything with it. My idea is some system where a mod can say "I want to add this GUI, and I want it to be shown relative to [i]the character GUI[/i] on the left side" and then any time the character GUI is shown it would also show the mod GUI. There are some critical parts to this new system. It needs to:[list][*]Be easy to expand (either automatically works with all new base game GUIs or works with minimal effort).[*]Not break with simple refactoring.[*]Not cause other programmers trouble by existing.[*]Not prevent base game GUIs from working how they need to work.[/list]So far none of it seems impossible. I don't know when I'll have it working, but I'm looking forward to what mods will do with it. [h1]The Oil Changes[/h1] In the last [url=https://www.factorio.com/blog/post/fff-304]FFF[/url], we presented changes to how Basic oil processing works along with some other changes (mainly moving Worker robots behind Chemical science pack), which resulted in a lot of discussion as it is a very sensitive topic. We have discussed with as many of you as we could, and in this FFF we would like to present to you what conclusions we came to, and try to explain our ideas in more detail. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/4d69d569b64e97fc5cc0d736a3eaf3c8fb29af42.png[/img] [h1]Basic oil processing changes[/h1] A significant portion of you has voiced concerns about removing Light and Heavy oil from the outputs of Basic oil processing, be it about the change itself, or that it does not fit because of some other factors... Automating Chemical science packs is generally considered to be a huge step by many, mostly because even for veteran players, setting up oil processing consists of many steps, and for newer players there’s many new things to learn very quickly. This change is trying to address both of these issues. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/fff418e4bc34e80f892adb5cf3ce760b01e96151.png[/img] As for the complexity, the most confusing factor is the specific mechanic of the Oil refinery, that all products need to be used or stored in order to keep it working. This is made worse by the common situation that the player can be very far ahead with what they have unlocked with technologies, while being very far behind with what they have already automated. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/589f65570a5d832b919590558ba93a7d87420c65.png[/img] This can lead to a new player having every Logistic science technology researched before setting up the refinery, and just the sheer number of new unknown items and recipes can get very confusing, especially when some are not really useful at the moment. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/8a5ccc46ffaa08c1a5e79248c788dc85dc3ff262.png[/img] One of the ways we can look at the Chemical science pack is "the proof that the player has managed to set up a functional refinery". With this in mind, it fits very well to have them set up a rather basic refinery, and get to know most of the new entities/items/recipes that are necessary to progress, first. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/9f4acccab3ab9974c88b5dce6d6340ad7f84f5d3.png[/img] After 'proving' that Basic oil processing is working, the player can proceed to a more advanced version with more outputs and more recipes - but as the player is already familiar with the basics and has their infrastructure already in place (Pumpjacks, oil transport, how pipes work, Chemical plants, ...), it’s not nearly as confusing and daunting to unlock and orient themselves in the Advanced oil processing, yet it still has new concepts to grasp (multiple outputs, cracking, more recipes). [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/2f70fa31aebbfb982082e7ec033c2e0a99bc8861.png[/img] A lot of people have voiced their concern about simplifying the game, but setting up Advanced oil processing (or Coal liquefaction which also has the same challenge of multiple outputs and using cracking) is still mandatory in order to launch the rocket. The learning curve is just smoother. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/be4329c328759544d481256968f685409c948604.png[/img] All in all, we would like to keep this change as we believe it has a positive impact on the game both for newer and veteran players, however when discussing the changes, we realized there are things that would make this change fit in the game much better... [h1]The use of Light oil[/h1] Many of you pointed out that Light oil has very few uses in the game - mainly producing Solid fuel efficiently, but it’s possible to ignore Light oil altogether and just produce Solid fuel from Petroleum gas, sacrificing some Crude oil efficiency for simplicity. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/7f5bac8b72f3889e622950c1f3bdce4e76d97a67.png[/img] One of the topics repeated many times was that with the proposed changes, suddenly the player is incapable of producing Solid fuel "the right way" (from Light oil) from the start. While this alone is not a big problem and can be justified by "at least the player will appreciate Advanced oil processing more", the efficiency of Solid fuel from Light oil is fairly unobvious, and the player has so many more critical problems to focus on that it’s easy to miss. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/df895781bd0a1ebcdf09d3f09c308d56c55b8502.png[/img] [h1]Rocket fuel behind chemical science pack, requires light oil[/h1] We are adding Light oil to the Rocket fuel recipe, and therefore moving Rocket fuel behind Advanced oil processing, with Rocketry taking the pre-requisite of Flammables instead. This should help as a slight hint to produce Solid fuel out of Light oil and to make the recipe a little more interesting - we don’t have many assembling machine recipes with fluid input and a refinery-related fuel recipe is a good fit. One of the obscure details was that the only motivation that made Advanced oil processing mandatory was just Lubricant - which does not feel like a high-tech product - now there is Rocket fuel as well. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/a0eb707e1d0fa46a6c8b4507f5077e744db0c993.png[/img] The more important question many of you have asked would be "why even make Solid fuel with the changes". This applies even more now that Rocket fuel is behind Advanced oil processing. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/49598496b3b72cd9a8690141e2c51a0f1049973f.png[/img] One of the great things about the idea of adding Solid fuel to a science pack was that it could be created from the excess Light oil that the player has no use for until unlocking Advanced oil processing. Then it could easily be burned to get rid of it to keep the refinery working, but since Basic oil processing has no excess byproducts anymore, every bit of Petroleum gas is valuable - therefore producing Solid fuel feels like a waste, unless the player has a desperate lack of coal to burn. [h1]Chemical science pack change - Sulfur[/h1] There is however an item that is much more useful than Solid fuel, and is also created from Petroleum gas - Sulfur. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/62e12f492cc8ac06602e4dabd527d6fc8e893d13.png[/img] It opens the path towards Sulfuric acid (for Batteries both for Modular armor and for Accumulators), and more interestingly Explosives. Unlocking the Rocket launcher often feels like a big side step mainly because it requires setting up Explosives production. With Sulfur set up for the science pack, this is one step more convenient. A similar case occurs with Tank and Cannon shells later. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/675f38fb361dadee23fb988345fdf980b51177ef.png[/img] Therefore we find it fitting to replace Solid fuel with Sulfur in the Chemical science pack recipe, as there are multiple uses for it even with Logistic and Military science packs, and Solid fuel has lost a lot of its charm with the new changes. [h1]Robots behind chemical science pack[/h1] One of the obviously controversial changes from the last FFF, was that Worker robots would become gated behind Chemical science pack. Our thought process behind this change was that you need to set up pretty much all of the oil refining recipes anyway, so it is not as much of a big jump as it seems. In fact, we believe it has been a confusing trap - it has appeared as a Logistic science pack tier technology, but in reality requires all the items that the next technological tier would expect you to have. On top of that, worker robots are a good motivation and reward for unlocking Chemical science pack which does not have that many big shiny technologies behind it. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/fa6fb200a960b4a92b2bd89df83c5c620a99c07f.png[/img] With the change of putting Sulfur into the Chemical science pack recipe, worker robots are even closer to it as all the items in the science pack directly contribute to getting robots. [h1]Flamethrower ammo change - Crude oil[/h1] With Heavy and Light oil behind Chemical science pack, Flamethrower ammo needed to be moved as well or have its recipe changed. Rather hastily we chose to change the recipe for Petroleum gas instead of the oils which does not make much sense, especially as the Flamethrower turret can’t take Petroleum gas. After some of you pointed this out, it shall be Crude oil instead. Technically you can already use the turret with Crude oil barrels on the offensive, so making Flamethrower ammo simpler is not a problem. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/bda2670b5edda530ca4ff0191117f5e54fb7c369.png[/img] [h1]Adjusting the numbers[/h1] We made slight changes to the numbers in the recipes - specifically, Basic oil processing results in a bit more Petroleum gas (45 instead of 40), and Advanced oil processing results in more Heavy oil (25 instead of 10) than before. This is because it was common to use Basic oil processing over Advanced oil processing when you needed a lot of lubricant for Express transport belts. [img]https://steamcdn-a.akamaihd.net/steamcommunity/public/images/clans/12002589/1872486e6f240994bfa1f5a54f3eb5ba4343f5a8.png[/img] We are confident about these changes but nothing is set in stone, so let us know what you think about them. We actually found a bug with the new 'block water input fluidbox' feature we added, so we won't release the changes until we have that sorted. You can test these changes (except the reserved fluid inputs) with [url=https://mods.factorio.com/mod/Oil-Changes]this mod[/url].