1. Factorio
  2. News

Factorio News

Version 0.18.11 released

Graphics


  • Fixed player character shadow didn't animate in idle state when not facing north.
Bugfixes


  • Fixed that LuaEntity::splitter_filter would reject a LuaItemPrototype. more
  • Fixed smart entity collision mode in tile editor did not work with offshore pump. more
  • Fixed that modded shortcuts that spawned items not visible in the blueprint library didn't work. more
  • Fixed that technology tooltips didn't show debug tooltip data the same as other tooltips. more
  • Fixed that crafting machines would report as supporting backer names through the Lua API. more
  • Fixed that un-researched recipes couldn't be used while in the map editor. more
  • Fixed that the removed-content GUI didn't include some translations. more
  • Fixed a desync related to invalid rail signal requested to be closed by circuit network. more
Modding


  • Added InserterPrototype::chases_belt_items. more
Scripting


  • Added LuaEntityPrototype::inserter_chases_belt_items read.
  • Added surface to the selected-area events.
  • Changed LuaSurface::spill_item_stack() to return the created entities if any.


You can get experimental releases by selecting the '0.18.x' beta branch under Factorio's properties in Steam.

Friday Facts #337 - Statistics GUI and Mod Debugger

Read this post on our website.

Statistics GUI (Klonan, Oxyd)

The statistics GUI (electric network stats, production stats, etc.) is one of the GUIs that has been in the game for a very long time, and has had its functionality fleshed out reasonably over the years. It was not long ago when Twinsen added hovering and highlighting to the graphs.

Given that, and the relatively short timeframe for 1.0 release, the update of the statistics GUI has really just been a style update, no new features or heavy logic rewriting. Oxyd has most of the work done, so we are happy to show some real in-game screenshots of how it looks:



A notable change with the electric stats is that the Satisfaction/Production/Accumulator charge are next to each other in a single row, as opposed to each in a separate row. The label for the exact amount has also been moved to inside of the progress bar, which itself is much thicker.





The production stats are pretty much the same functionality wise. One new button you might spot is the search button.



However there are some problems with the search feature. As you can see, production and consumption frames have a different search box independent from each other. The main problem is when pressing CTRL+F to perform a regular search: How do we know which frame to open? Of course this could lead to different solutions like the use of a cycle for the focus of the search, in which the second time you press CTRL+F the other frame gets the focus. Or both of the search boxes open at the same time but only one gets the focus. Or only one frame gets the focus and the other one works only by pressing the button. But let's face it, these "solutions" are not solid at all and create inconsistency in the main design.

To solve this issue we decided that the simplest way to go is the use of just one search box on the header of the panel. This new location works as a general feature for the entire panel. One single search gives you 2 results, one on each frame. This solution is used in the new character window -to come soon- making it consistent with the whole design of the GUI.



You can also see we took this opportunity to integrate the Kill statistics in with the rest, instead of being its own window with its own hotkey.

The Statistics GUIs will need a few tweaks and polishings here and there before it is ready for release, but unless something unexpected happens you can expect it coming out in a release soon.

Community spotlight - Mod Debugging and Instrument Mode (justarandomgeek)
This topic is a guest post by our community member and mod maker justarandomgeek.

Historically, while developing Factorio mods, you just had to write some code and try it, until you get one of these:



Then you go back and find that spot in your code and try to figure out what went wrong. If the error is particularly confusing, you start sprinkling log() or game.print() around to try and figure out what the heck is going on. And, of course, when you find the problem, you inevitably forget to clean all of these up, and now you're spamming the log or chat forever.

Well there's your problem! Perhaps a bit constructed...

For the last few months I've been working on a debugger to improve this experience. The first step was to spend some time with the Lua debug library and VSCode's Debug Adapter Protocol making introductions to get them talking to each other. Factorio doesn't give me many options, but Lua's debug.debug() and print() functions are enough to interact with the (normally invisible) console.

VSCode can launch Factorio and attach itself to this console to inject commands as needed to read and manipulate the state of the running code. This gets us VSCode's debugger interface, with all the pre-built tools for displaying variables, setting breakpoints and stepping through code. Wrapping some of the game's APIs like remote.call() and most of script to add a little extra special handling, we get nice labels on event handlers in the call stack and a first version of break-on-exception for when things go wrong. I even built some nice detailed variable views for the most common LuaObjects:



But there's a catch, and it's a big one: because of the way Factorio sandboxes mods, the debugger (which is itself a mod, in part) can't actually get to your mod to install all these hooks! The first solution to this is to simply add a line to load the debugger, but this puts us right back where we started with log() - you put something in for debugging and forget to remove it.

To solve this problem we need a little help from the API, a way for a mod to hook every other mod. Unfortunately, this level of hooks is too powerful of a capability to be generally available to mods, so it can't really be added to the normal mod API (it allows you to fairly trivially break nearly all assumptions about data lifecycle and mod sandboxing). After some discussion with Rseding, we eventually arrived at Instrument Mode (released with 0.18.10), a special mode which allows a selected mod to hook all the Lua instances Factorio creates, at the cost of disabling multiplayer and only allowing one Instrument at once. This also provides a hook for a better version of break-on-exception.

This gets us all the way to the rich debugger experience: When you run under the debugger, all loaded mods automatically get debug hooks installed for the session (but not permanently), and you can step through the code and examine all your variables!

While I was building tools, I also added some highlighters for locale and changelog files, and validation for changelogs:





And of course, it's a game about automation, so we need some modding workflow automation too:



Modders, please give it a try and let me know what you think!

Version 0.18.10 released

Graphics


  • New offshore pump graphics.
Changes


  • Removed the sound effect from the console-only electric-energy-interface.
  • Item localised name takes priority over place-result localised name when showing item's tooltip. more
  • Offshore pump is now buildable on ground tile adjacent to water instead of water tile adjacent to ground.
Bugfixes


  • Fixed that the map generator GUI didn't reset to the correct defaults when changing presets. more
  • Fixed blueprint window sizing for wide blueprints.
  • Fixed some cases of not considering dark background icon when drawing alt mode overlay. more
  • Fixed that burner generator idle_animation and animation could have different frame counts.
  • Fixed icons with overlays were drawn incorrectly when used in sprite widget. more
  • Fixed crash when loading map after removing fluid recipes with indexes. more
  • Fixed spitters would not break from attacking an obstacle when the obstacle moved away. more
Modding


  • Added Instrument Mode to support mod development tools.
  • Added optional burner generator prototype properties always_draw_idle_animation, performance_to_sound_speedup and min_perceived_performance.
  • Added optional offshore pump prototype properties min_perceived_performance, adjacent_tile_collision_box, adjacent_tile_collision_mask and center_collision_mask.
  • Changed offshore pump graphics definition. Old definition will still be accepted, but is deprecated.
Scripting


  • Added optional parameters daytime and water_tick to LuaGameScript::take_screenshot() function.


You can get experimental releases by selecting the 'experimental' beta branch under Factorio's properties in Steam.

Friday Facts #336 - Offshore pump redesign

Read this post on our website.

Offshore pump redesign (V453000, Albert)

As one of the last entities which do not have high resolution graphics, the time has come for the offshore pump.

The offshore pump is practically a 1-tile entity, but they must have a 1 tile gap between each other. It is also the only entity placed on a water tile at the moment.

When we changed the way how terrain to water transitions work, we moved the offshore pump to be placed on the water tile. This can result in the pump drawing over terrain in ugly ways.



With the redesign, we took the oppourtunity to move the offshore back onto land, and additionally the pump checks a 2x3 tile water area in order to be buildable.



The new placement rules only applies to newly built pumps. Offshore pumps on existing maps will keep functioning, they’ll just be shifted out from the shore.

There is no blue colour for water integration at the tip of the offshore pump, so the offshore pump will look correct even with unexpected water types (not a big problem in vanilla). The water integration is split to an underwater layer which does not show when the pump gets landfilled over.



In the basic concept, the offshore pump is another type of a pump, so it should be similar to the other pump entity Albert made a few years ago, including the animation and visible fluid in it.

The obvious difference is the connection to water. However we felt that is not different enough and needs more visual balance, so we added a pair of supportive legs.

https://cdn.factorio.com/assets/img/blog/fff-336-offshore-pump.mp4

We are planning to release the new offshore pump graphics with the next release, likely next week.

Mod spotlight - Built in beacons (V453000)

Beacons strongly motivate building in rectangular repeatable patterns. The results generally look clean, but also very predictable and boring. Furthermore, the differences between different recipe builds are only minimal, so the visual difference between builds is minimal.



The issue is, I like to build the opposite of clean and predictable. The factory looking increasingly complicated and harder to expand over time is what keeps me engaged to continue playing a map. When it starts looking easy, I lose interest.

I’ve been trying to solve this for myself by either restricting myself from using Beacons (which is a massive sacrifice of productivity and speed), or by putting the sub-factories with high Beacon counts outside of the starting area, as keeping the organic starting area is key for me.



Eventually I thought about creating a mod that makes machines behave as if they had the maximum possible amount of beacons around them - allowing me to upgrade the starting base, but that also causes higher demand on the throughput of logistics, which the most interesting part - snaking more belts, fitting in more rails.



The mod defines 3 tiers for every producer to simulate beacons with tier 1, 2 or 3 of Speed modules in them. These machines cannot be further affected by normal Beacons and only accept special productivity modules defined by the mod.



Creating the mod was a ton of fun. I rewrote it about 3 times as I was learning how to do it better. I hacked together some basic graphics for it from some special passes (height and Ambient Occlusion) that we use for postproduction in our gfx workflow.

I played with the mod and got some interesting results (imgur album) as I was able to continue building in the starting area instead of refactoring it for Beacons.

Click to view full resolution

Lastly, I wrote a timelapse-screenshot tool. It can either be used by taking a screenshot each N ticks automatically, or in my case I give it a folder with savegames and it takes X number of screenshots, then moves to the next savegame. It's quite crude so I won't release it on the mod portal for now.

[previewyoutube][/previewyoutube]

Making Beacons disappear into producer machines to allow for more organic bases fits my perverted playstyle, but Beacons actually do bring a lot of interesting motivations to the base game, and it can be a lot of fun to mess with the building rules that Beacons force.

You can find the mod on the mod portal if you are interested.

Version 0.18.9 released

Features


  • Added Rocket rush scenario. more
Changes


  • Changed Team production team joining system and cleaned up the map sets.
  • Changed Wave defense bounty system and refactored unit spawning logic.
  • Changed fire sticker to deal damage only once per 10 ticks.
Graphics


  • Added big scorch mark which is now used by atomic rocket and nuclear reactor meltdown.
Bugfixes


  • Fixed that fluid energy source effectivity was not shown in the tooltip. more
  • Fixed that the default column ordering in the update-mods GUI didn't match the visual ordering. more
  • Fixed that train could accelerate for one tick into wrong direction when train stop is disabled. more
  • Fixed that minimap would not allow setting temporary train stop when train would have to change movement direction. more
  • Fixed damage value in sticker tooltip was 60 times too small.
  • Fixed icons with overlays were drawn incorrectly when used in rich text. more
  • Fixed PvP error when DEFCON was active alongside normal labs. more
  • Fixed that modded recipes with no products or no ingredients still showed those sections in the recipe tooltip. more
  • Fixed that modded burner generator equipment didn't show pollution in the tooltip. more
  • Fixed teleporting or changing the force of an entity with a control behavior that was connected to the logistic network. more
  • Reverted optimisation that caused inserters picking up items from belts to be slower.
Modding


  • Added support to filter on-damaged trigger effects through the trigger prototype definition.
  • Added secondary_draw_order property to simple-entity prototypes.
  • Added StickerPrototype::damage_interval, defaults to 1.
Gui


  • Updated the window of creating/editing blueprint.
Scripting


  • Added LuaTile::surface read.
  • Added event filtering support to on_sector_scanned and on_entity_cloned.
  • Added "original-damage-amount", "final-damage-amount" and "damage-type" filters to the on_entity_damaged event filters.
  • Added LuaGameScript::is_valid_sprite_path().
  • Removed the required argument from LuaEnity::to_be_deconstructed() because it did nothing.


You can get experimental releases by selecting the '0.18.x' beta branch under Factorio's properties in Steam.