1. Factorio
  2. News

Factorio News

Friday Facts #344 - Tile transition collisions Team Steelaxe speedrun record.

Read this post on our website.

Tile transition collisions (Klonan)

We first mentioned a change to our tile transition logic back in FFF-199, and not long after in FFF-214. These two posts focused more on the visual side, and how it makes the game terrain look so much better.

In short, the tile transition logic overlays an additional sprite over adjacent tiles, so that where the two tiles meet has a much more natural look.

Tile transitions on. Tile transitions off.

So while the looks were taken care of, we also had to deal with the 'feel' of the tiles. The easiest example of this is the 1x1 landfill 'stepping stones'. It really looks like you should be able to walk/drive across the 1 tile of water. So we added in an additional layer of collision checks, which will consider the transitions when performing the logic of what can go where.

https://cdn.factorio.com/assets/img/blog/fff-344-stepping-stones.mp4

Now some of the cheesier among you will know that biters don't know how to get across these 1 tile gaps. That is because simply we never enabled the biters to use this collision check logic. One reason is that more checks means more UPS usage for the biter pathfinding, another is that we didn't think it was necessary. However it was available in the engine, and any mod could enable it if they want. That is exactly what I did with my Mining drones mod. Initially this seemed to work, and I thought it might make them walk around lakes a bit more naturally (like the player character does).

However quickly I noticed that people were reporting on the forum that the game was crashing with the mod installed. I quickly reverted the change to my mod and we started looking into it. It turns out that the new abstract pathfinder we added for better unit pathfinding (FFF-317) was not set up to consider units using this tile transition collision logic. This same crash was happening sometimes without any mods installed, but the case was more difficult to reproduce, so this is a nice situation where mods help us work on issues in the base game.

Recently I have been working on another unit heavy mod, Transport drones, and the principle design behind the mod heavily relies on the tile collision logic (the units don't even collide with entities). It turned out to be a really nice test of our new pathfinder, but also highlighted some of the issues that not considering the tile transitions can bring.

https://cdn.factorio.com/assets/img/blog/fff-344-drone-zig-before.mp4
By not considering the tile transitions, the drone takes an awkward path along the diagonal road.

This week Oxyd finished his work on an upgrade to the pathfinder, so we can enable the tile transition collision logic with units. The change is immediately noticeable with the above example.

https://cdn.factorio.com/assets/img/blog/fff-344-drone-zig-after.mp4
By considering the tile transitions, the drones path much more naturally.

With the logic now in place, we are debating whether to enable it for biters or not. We probably won't, it is only a minor change and would have a non-zero performance impact (a rough test puts the worst case at about 5%), but then again it is a fun way to surprise those who thought the 1 tile of water would stop the biters attacking, and it kinda makes sense they can walk over it just as the player can. Well we will see if there are any issues with it in the modded cases before any further consideration.

As a bonus fact (this is Factorio facts after all), I spent a bit of time benchmarking some late game Transport drone based factories (screenshot), and found a few nice performance gains.

This game is too short, I want my money back! (Bilka)

This Wednesday, Team Steelaxe set a new Any% multiplayer speedrun world record at 1 hour, 15 minutes and 21 seconds. This is the fastest anyone has ever launched a rocket in an unmodded Factorio game.

[previewyoutube][/previewyoutube]

I am part of Team Steelaxe, so I want to take the opportunity to explain how we managed to beat the game this quickly. In general, it is all about planning and preparation, we estimate that we have put a combined 200 hours into planning just for this speedrun. The Any% speedrunning category allows to change all map generation settings, including disabling enemies. Multiplayer subcategories allow for up to eight players. Planning begins with picking a map seed. Since there are many possible maps to choose from, we let a script generate maps and automatically filter out the ones without enough ore in the starting area, and then handpick from there. With the map picked, it is possible to start planning the base. This begins with setting a target time to finish the game and calculating the amount of science and number of assemblers required from there. We then come together and arrange a base on the chosen map, which will serve as a reference for the factory built in the actual run. It should be noted that the category rules do not allow blueprint imports, so instead we usually have the planning save file open in another window or use screenshots during the run.

Part of the spreadsheet that contains every player’s responsibilities.

Another big part of the planning is also to create a spreadsheet of everyone’s tasks and when they should be done. We distribute the tasks so that two players build smelting, two build mining, one player builds the power plant and only three people build the factory itself. This strict divide means people only ever take and craft the material that they need, so ideally we don’t have to fight over resources. Furthermore, the task list allows us to optimize by shuffling tasks around, so that no time is wasted by anyone. One example of this is that only two people ever chop wood for power poles, the rest get the wood from them and do not have to waste time on finding trees. The task distribution also means that every player has a very different perspective of the speedrun, so here are some more:
With the complete plan prepared, we do runs and iterate on the planning, taking into account what worked well and what did not. The speedrun above is the result of a few of those planning iterations combined with some improvisation to compensate for mistakes in execution. It may not always sound like it during the run, but we are all friends and when someone makes a mistake, others jump in to help out, so the linked run is the result of good teamwork. Without everyone working together like that, we would not have been able to reach our target time of 1 hour and 15 minutes.

In the future, we hope to be able to launch a rocket in less than an hour, you can watch our next attempts on Sunday at 20:30 CEST on Twitch. You can find over 20 active speedrunners, resources such as save games and replays, or even try running yourself, at Speedrun.com/Factorio.

Version 0.18.20 released

Features


  • Added new environmental trigger effects for grenade, artillery and nuke explosions. more
  • Added 3 level 'First steps' tutorial Campaign. more
  • Mini-tutorial improvements.
Changes


  • Moved Compilatron and Compilatron speech-bubble entities from demo to base game files.
  • Removed Introduction Campaign.
  • Removed Compilatron chest, Compilatron roboport, Compilatron logistic chest.
  • Removed Tutorial/Campaign Lualib (base/lualib).
  • Removed other campaign-only prototypes, such as styles, sprites, sounds.
Bugfixes


  • Fixed that thumbnails wouldn't show in the update-mods tab of the mods GUI. more
  • Fixed that LuaSurface::spill_item_stacks return value didn't work correctly. more
  • Fixed that the research progress of the current tier showed for next queued tier in the technology GUI. more
  • Fixed that the game didn't validate modded rail-planner item type values and would crash in some cases. more
  • Fixed that modded units with consider-tile-transitions in their collision mask would cause the pathfinder to crash. more
Modding


  • Empty layers in sprite or animation definition will yield an error now. more
  • Added support for playing a sound when using smart-pipette.
  • Added support for playing activate/deactivate sounds for night vision.
  • Added support for playing a sound while an resource-style is being mined through mining_sound.
  • Added mod-setting value "hidden" to hide mod settings from the GUI.
  • Added 'invoke-tile-trigger' and 'destroy-decoratives' trigger effects.
  • Added 'rotate-offsets' to the create-particle trigger effect.
  • Added 'trigger_effect' to tiles. It is called with the 'invoke-tile-trigger' trigger effect.
  • Added 'trigger_effect' to decoratives. It is called when the decorative is destroyed with the 'destroy-decorative' trigger effect.
Scripting


  • Added on_pre_script_inventory_resized and on_script_inventory_resized events.
  • Added 'allow_paths_through_own_entities' and 'no_break' path finding flags.
  • Added LuaModSettingPrototype::hidden read.
  • Added 'to_be_deconstructed' to the options for LuaSurface::find_entities_filtered. more
  • Added LuaGuiElement::badge_text read/write.


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

Version 0.18.19 released

Bugfixes


  • Fixed a crash when loading saves from 0.18.12 and older while re-spawning and having personal logistics researched. more
  • Fixed offshore pump selection box to match the new graphics. more
  • Fixed possible performance issue related to animated trees in OpenGL rendering backend. more
  • Fixed opening the character GUI through hotkey when the logistic tab isn't visible. more
  • Fixed that curved rail ghosts selection didn't work quite right. more
  • Fixed that the offshore pump would play sounds even when it wasn't doing anything. more
  • Fixed wrong Lua docs for LuaCommandProcessor::add_command. more
  • Fixed a desync when personal logistics is researched while a player is disconnected from the server with personal logistics disabled. more
  • Fixed a crash when moving armors around in other players inventories in multiplayer. more
  • Fixed a regression issue with the select-a-signal GUI related to group ordering. more
  • Fixed that trying to load a save created from a scenario in a now disabled/removed mod would crash the game. more
  • Fixed a crash when trying to join games through Steam when the Steam API fails to initialize.
  • Fixed that the character corpse wasn't included in the post-player-died event 'corpses' parameter. more
  • Fixed that trains pathfinder could create non contiguous path in case of single segment cycle with a single train stop. more
Modding


  • Added warning for empty layers in sprite or animation definition. In next release, this will become an error. more
  • Added a check to make sure placeable_by.count isn't larger than the placeable_by.item.stack_size. more
  • Added support to play sounds when left clicking radio buttons and checkboxes.
  • Added ParticlePrototype::fade_away_duration and vertical_acceleration.
  • Rolling stock entities can no longer have next_upgrade set.
  • Added support for rotated_sound on entity prototypes.
Scripting


  • Fixed that LuaEntityPrototype::fluidbox_prototypes didn't include fluid energy source fluidbox prototypes.
  • Added LuaEntity::productivity_bonus, pollution_bonus, speed_bonus, and consumption_bonus read.
  • Added LuaGameScript::create_inventory() and get_script_inventories().
  • Added LuaInventory::destroy() and resize().
  • Added LuaInventory::mod_owner read.
  • Added LuaEntityPrototype::adjacent_tile_collision_box, adjacent_tile_collision_mask, adjacent_tile_collision_test, center_collision_mask read to access new offshore pump prototype properties.
  • Added "final-health" to the entity-damaged event.
  • Added "final-health" to the entity-damaged event filter.
  • Added LuaGameScript::max_force_distraction_distance, max_force_distraction_chunk_distance, max_electric_pole_supply_area_distance, max_electric_pole_connection_distance, max_beacon_supply_area_distance, max_gate_activation_distance, max_inserter_reach_distance, max_pipe_to_ground_distance, max_underground_belt_distance read.
  • Added LuaEntity::deplete().


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

Friday Facts #343 - Environmental particle effects

Read this post on our website.

Environmental particle effects (Dom)

Since the particle optimization we did for 0.18 (FFF-322) and the introduction of new explosions (FFF-325), we were able to push our vision even more.

It always bothered me that the grenade and other explosions would emit the same type of particles regardless of the context. In most cases it isn't that bad, and somewhat okay, but when you throw a grenade into water, it will still emit stone particles, which breaks the illusion.

Another problem is that we have the nice decoratives on the ground, but they don't really 'interact' with anything that goes on, and can feel like fake flat stickers instead of something 'real'. You would expect that when there is a massive explosion 2ft away, the bushes might have some reaction to that.

https://cdn.factorio.com/assets/img/blog/fff-343-grenade-old.mp4
The explosion effect currently in 0.18

[h3]Specific tile effects[/h3]
One thing we wanted was some way for tiles to respond to the explosions in different ways. The way Posila decided to add this capability, is through the 'Invoke tile effect trigger'. Tiles can define an effect that happens, and the explosion will tell the tile to create that action. After the implementation of this feature, it was smooth sailing from there. I was able to design the explosions like I wanted them, to be emitting specific particles based on their tiles. For example besides the visual improvement of the stone emissions in water, I was able to make the hazard concrete emit dark grey and yellow particles.

https://cdn.factorio.com/assets/img/blog/fff-343-mosaic.mp4

We kept in mind that people might want to tint all the new particles for mods, so we kept everything as tint-able as possible. So a modder can just use our particle definitions and tweak the tints, for instance, if they want to add purple terrain. It's worth mentioning that the same goes for almost all the new particles (metal/stone/vegetation/blood/glass etc). Using the same sprites with different tints also helps us save some VRAM, as the game applies the tint during the render phase.

[h3]Decoratives[/h3]
Posila also added the engine changes required to remove decoratives on impact, and for the decoratives themselves to create some particles on their destruction. This makes it feel much better when you see the explosion, because you see the decoratives reacting as if they were real, and it does not break the immersion in the game. It also helps to make the explosions feel a bit more powerful, at least powerful enough to blow over a bush.

https://cdn.factorio.com/assets/img/blog/fff-343-grenade-new.mp4
The new grenade explosion, showing the new tile effect and decorative effects.

The reactions are also based on the individual decoratives. So each individual decorative will emit a different set of particles, bushes will emit grassy vegetation particles, stones will emit stone particles, etc. We also use the same tinting system here, so a brown bush and green bush will have the same particle sprites, just tinted accordingly.

There is of course the nice benefit of this to a lot of players, now that grenades can clear the decoratives, you can do some explosive cleaning of your precious prestine factory floors.

https://cdn.factorio.com/assets/img/blog/fff-343-clearing-decoratives.mp4
A player clearing decoratives off their precious pathway

Minimal 'No base mod' (Klonan)

Bilka has spent quite some time in the last month working on a new 'mod' for the game. Well its more of a mod that allows the removal of the 'Base' mod.

It has always been technically possible to run Factorio without the Base mod enabled, but anytime you would try you'd be hit by a bunch of missing prototype messages. Basically the game needs to have some minimum amount of prototypes defined to be able to launch properly.

So Bilka's work will act as a foundation for other mods to build on, to help modders make true 'total conversion' mods, or just have fun with the raw Factorio engine. Of course enabling this mod and starting the game isn't very fun on its own.

Factorio, but there is no content

For more details, please check out the detailed forum post by Bilka, and you can find the project repository here.

Friday Facts #342 - The new old tutorial

Read this post on our website.


As stated in previous FFF's we will be making some changes to the demo and tutorial content in the game. I wanted to clarify exactly what is being removed and what it is being replaced with, as this content is almost ready for release. If you would like to catch up on the topic, you can read Kovarex's piece in FFF-327, but I will also summarize it here.

Right now the NPE/Introduction is the scenario that is used as the demo (0.17) and as the tutorial in the full game (0.17 stable, 0.18 experimental). If anyone has played the tutorial in the last 12 months, this is probably what you have played.

The First steps campaign was a series of three levels which used to make up the demo and tutorial in 0.16 and earlier. They were introduced in 2014. We have been working on revamping these levels to bring them up to 0.18 standards.

Very soon the NPE/Introduction will be removed and the First Steps campaign will be reinstated, both as the full game tutorial and the demo.

[h3]What has been changed in the levels?[/h3]
The plan was to change these levels as little as possible while updating them to modern Factorio standards. That is harder than it sounds given these levels were created in 2014.

As stated in FFF-241, there were many things we felt were inconsistent in the First Steps campaign. One of the largest ones was that there were many different and confused channels of information. The newer version has given each channel a purpose and a format.

The most distracting, and the most popular was the character monologues. Some of the messages in each channel were written in the first person, as if the character is talking to themselves. All the instances of this occurring in the Yellow speech bubbles and objective panel are gone or moved to the console. The rule here is that nothing that is actually necessary should come via this channel. To communicate to the player that this is story text, I added a speaker prefix.



The most necessary and most annoying channel was the Yellow speech bubbles. There are situations where it is absolutely necessary to pause the game and tell the player something. Since we have no other technology designed for this purpose, I just resorted to removing as many of them as possible. They only appear where necessary, although I would still like to get rid of more of them.

The final channel is the Objective window. The rule here is, if the player tabbed through all the speech bubbles without looking, and did not read the story text, they should still be able to finish the level. The text should not be in the first person, and we can speak directly to the player.

Due to much more rigorous and dedicated internal testing (Boskid), we caught a lot of corner cases where players can become stuck. The tutorials also now take into account new and updated game features. For example, previously the pickaxe was used to demonstrate crafting, so some extra attention had to be paid to when the player crafts the stone furnace for the first time.

The maps have been updated to look much more like what the random generator creates in freeplay. The new remnants make a great impression here.



Now that the quickbar does not automatically populate, we had to be more careful about when the player has their inventory open. The new standard for new players is: open inventory, take item, close inventory, place item, open inventory, place remaining items, close inventory. Giving new players the option to add quickbar links as early as possible is a challenge because every time you add a new concept, the player must expend some of their attention keeping it in mind. Not only that, but using the quickbar actually removes a perfect opportunity for the new player to practice interacting with the inventory.
[h3]Why are we changing it?[/h3]
Kovarex discussed his reasoning in FFF-327, but a lot of people asked me for more information to help them understand. Post mortems are uncomfortable but necessary so I will try to summarize his point and add one of my own.

The NPE/Introduction was created to widen the audience of Factorio. It takes new players a long time to get into the game and many stop playing before 'getting it'. The strategy was to show new players (both in the demo and tutorial) more of the mid game. After finishing the scenario Kovarex realised that the experience was not in line with his vision for the game.

When he told me how he felt, I think he was surprised that I agreed with his decision to remove it. Vision alignment is very important, especially in a demonstrator product. It isn't something you can just 'fix' when the project is almost finished.

This is not to say that the NPE/Introduction failed in its goals. It did appeal to a wider audience and player feedback at the end of development was overwhelmingly positive. I received a lot of feedback from genuine first time demo players pledging to buy the game immediately and also from story focused, non-sandbox players who were craving more. But as Kovarex said in his FFF, the cost of this was too high.

In light of the full length campaign being cancelled (see V453000s part in FFF-331), this is the biggest reason why I think the NPE/Introduction would have failed as a demo. We would have been offering an experience in the demo which was targeted to a wide audience, but the quest loving players were not going to get any extra content if they buy the game. A literal "It isn't what it says on the tin" situation.

A full post mortem would be much longer than this, and I would have liked to discuss much more about the things that went right. On the up side, a lot was learned from this project and that can only make the game better in the future.
[h3]When is it coming?[/h3]
The new old First steps tutorial is almost ready for release, we are still doing some general polishing and internal testing, and if all goes to plan, it will be released within the next few weeks. However that doesn't mean the work is necessarily finished, as no doubt we will need to tweak, polish and fix a lot more things as player feedback starts rolling in.

Alongside this addition, we will also be removing the NPE, and doing a general cleanup of the now unneeded data changes. This may affect some mods which have dependencies on some new campaign assets. We might leave some assets in if they are significant enough (for instance the Compilatron), so if you are a modder and something in the NPE is of special interest to you, please let us know.