Factorio - Klonan
Read this post on our website.

New pathfinding algorithm - Oxyd
Last week we mentioned the change to make biters not collide with each other, but that wasn’t the only biter-related update we released this past week. Somewhat coincidentally, this week’s updates have included something I’d been working on for a few weeks before – an upgrade to the enemy pathfinding system.

Pathfinding
When a unit wants to go somewhere, it first needs to figure out how to get there. That could be as simple as going straight to its goal, but there can be obstacles – such as cliffs, trees, spawners, player entities – in the way. To do that, it will tell the pathfinder its current position and the goal position, and the pathfinder will – possibly after many ticks – reply with a path, which is simply a series of waypoints for the unit to follow in order to get to its destination.

To do its job, the pathfinder uses an algorithm called A* (pronounced 'A star'). A simple example of A* pathfinding is shown in the video below: A biter wants to go around some cliffs. The pathfinder starts exploring the map around the biter (shown as white dots). First it tries to go straight toward the goal, but as soon as it reaches the cliffs, it 'spills' both ways, trying to find a position from which it can again go toward the goal.

https://cdn.factorio.com/assets/img/blog/fff-317-basic-pf.mp4
In this video, the algorithm is slowed down to better show how it works.

Each dot in the animation represents a node. Each node remembers its distance from the start of the search, and an estimate of the distance from that node toward the goal – this estimate is provided by what's called a heuristic function. Heuristic functions are what make A* work – it's what steers the algorithm in the correct direction.

A simple choice for this function is simply the straight-line distance from the node to the goal position – this is what we have been using in Factorio since forever, and it’s what makes the algorithm initially go straight. It’s not the only choice, however – if the heuristic function knew about some of the obstacles, it could steer the algorithm around them, which would result in a faster search, since it wouldn’t have to explore extra nodes. Obviously, the smarter the heuristic, the more difficult it is to implement.

The simple straight-line heuristic function is fine for pathfinding over relatively short distances. This was okay in past versions of Factorio – about the only long distance pathfinding was done by biters made angry by pollution, and that doesn’t happen very often, relatively speaking. These days, however, we have artillery. Artillery can easily shoot – and aggro – massive numbers of biters on the far end of a large lake, who will then all try to pathfind around the lake. The video below shows what it looks like when the simple A* algorithm we've been using until now tries to go around a lake.

https://cdn.factorio.com/assets/img/blog/fff-317-long-pf-before.mp4
This video shows how fast the algorithm works in reality; it hasn’t been slowed down.

Contracting Chunks
Pathfinding is an old problem, and so there are many techniques for improving pathfinding. Some of these techniques fall into the category of hierarchical pathfinding – where the map is first simplified, a path is found in the simplified map, and this is then used to help find the real path. Again, there are several techniques for how exactly to do this, but all of them require a simplification of the search space.

So how can we simplify a Factorio world? Our maps are randomly generated, and also constantly changing – placing and removing entities (such as assemblers, walls or turrets) is probably the most core mechanic of the entire game. We don’t want to recalculate the simplification each time an entity is added or removed. At the same time, resimplifying the map from scratch every time we want to find a path could quite easily negate any performance gains made.

It was one of our source access people, Allaizn, who came up with the idea that I ended up implementing. In retrospect, the idea is obvious.

The game is based around 32x32 chunks of tiles. The simplification process will replace each chunk with one or more abstract nodes. Since our goal is to improve pathfinding around lakes, we can ignore all entities and consider the tiles only – water is impassable, land is passable. We split each chunk into separate components – a component is an area of tiles where a unit can go from any tile within the component to any other within the same component. The image below shows a chunk split into two distinct components, red and green. Each of these components will become a single abstract node – basically, the entire chunk is reduced into two 'points'.



Allaizn’s key insight was that we don’t need to store the component for every tile on the map – it is enough to remember the components for the tiles on the perimeter of each chunk. This is because what we really care about is what other components (in neighbouring chunks) each component is connected to – that can only depend on the tiles that are on the very edge of the chunk.

Hierarchical Pathfinding
We have figured out how to simplify the map, so how do we use that for finding paths? As I said earlier, there are multiple techniques for hierarchical pathfinding. The most straightforward idea would be to simply find a path using abstract nodes from start to goal – that is, the path would be a list of chunk components that we have to visit – and then use a series plain old A* searches to figure out how exactly to go from one chunk's component to another.

The problem here is that we simplified the map a bit too much: What if it isn’t possible to go from one chunk to another because of some entities (such as cliffs) blocking the path? When contracting chunks we ignore all entities, so we merely know that the tiles between the chunks are somehow connected, but know nothing about whether it actually is possible to go from one to the other or not.

The solution is to use the simplification merely as a 'suggestion' for the real search. Specifically, we will use it to provide a smart version of the heuristic function for the search.

So what we end up with is this: We have two pathfinders, called the base pathfinder, which finds the actual path, and the abstract pathfinder, which provides the heuristic function for the base pathfinder. Whenever the base pathfinder creates a new base node, it calls the abstract pathfinder to get the estimate on the distance to the goal. The abstract pathfinder works backwards – it starts at the goal of the search, and works its way toward the start, jumping from one chunk’s component to another. Once the abstract search finds the chunk and the component in which the new base node is created, it uses the distance from the start of the abstract search (which, again, is the goal position of the overall search) to calculate the estimated distance from the new base node to the overall goal.

Running an entire pathfinder for every single base node would, however, be anything but fast, even if the abstract pathfinder leaps from one chunk to the next. Instead we use what’s called Reverse Resumable A*. Reverse means simply it goes from goal to start, as I already said. Resumable means that after it finds the chunk the base pathfinder is interested in, we keep all its nodes in memory. The next time the base pathfinder creates a new node and needs to know its distance estimate, we simply look at the abstract nodes we kept from the previous search, with a good chance the required abstract node will still be there (after all, one abstract node covers a large part of a chunk, often the entire chunk).

Even if the base pathfinder creates a node that is in a chunk not covered by any abstract node, we don’t need to do an entire abstract search all over again. A nice property of the A* algorithm is that even after it 'finishes' and finds a path, it can keep going, exploring nodes around the nodes it already explored. And that's exactly what we do if we need a distance estimate for a base node located in a chunk not yet covered by the abstract search: We resume the abstract search from the nodes we kept in memory, until it expands to the node that we need.

The video below shows the new pathfinding system in action. Blue circles are the abstract nodes; white dots are the base search. The pathfinder was slowed down significantly to make this video, to show how it works. At normal speed, the entire search takes only a few ticks. Notice how the base search, which is still using the same old algorithm we've always used, just 'knows' where to go around the lake, as if by magic.

https://cdn.factorio.com/assets/img/blog/fff-317-long-pf-after.mp4

Since the abstract pathfinder is only used to provide the heuristic distance estimates, the base search can quite easily digress from the path suggested by the abstract search. This means that even though our chunk contraction scheme ignores all entities, the base pathfinder can still go around them with little trouble. Ignoring entities in the map simplification process means we don't have to redo it every time an entity is placed or removed, and only need to cover tiles being changed (such as with landfill) – which happens way less often than entity placements.

It also means that we are still essentially using the same old pathfinder we've been using for years now, only with an upgraded heuristic function. That means this change shouldn’t affect too many things, other than the speed of the search.

Bye bye TOGoS - TOGoS
Hi everybody!
I'm going to be resigning from official Factorio staff after today to start a new job closer to home.

The main reason for this switch is that working entirely remotely turned out to be something that I wasn't able to handle all that well. But also, my primary contribution to the project, the programmable map generator, is complete, stable, and pretty well understood by at least one other person, so timing-wise this seemed a good point for me to move on. To working in a cube farm writing Android applications for treadmills, apparently.
We'll see how that goes!

It's been an honor to be part of this awesome project and to leave my imprint on it. And working on a large and pretty well-managed C++ codebase, full of things done just a bit different than I had ever thought to, has been mind-opening.

I also want to thank the community for your continual patience, honest feedback, and the occasional bit of pressure that you put on us to make the game as good as it can be.

I'll continue to read the Friday Facts every week, lurk on the forums, and probably update documentation here and there. Hopefully I'll find time to crank out some terrain-altering mods of my own. And I'm looking forward to seeing what else y'all do with it, too. (Which includes working through a backlog of mods -- I have yet to get to the space exploration part of Space Exploration!)

Peace out for now.

Community spotlight - 13x9 Micro Factory - Klonan
Over 100 Friday Facts ago we covered DaveMcW's 9x14 Micro Factory (FFF-197). While it may have taken over 2 years, he has improved his design even further, and the result is just as impressive as before.

https://youtu.be/9dzQge6pe2o

He offers some more explanation of his Micro Factory in this forum post.

As always, let us know what you think on our forum.
Factorio - wheybags
Bugfixes
  • Fixed a crash that would happen on loading certain saves made in previous versions. more
  • Fixed entity selection could desync from mouse cursor when switching to cutscene controller in multiplayer. more
Factorio - wheybags
Features

  • Added interface option to adjust the number of shortcut bar rows that are visible on the screen.
  • Added ability to shift click a research in the technology screen to start that research.
  • Allowed setting filters with the ghost cursor.

Changes

  • Biters and Spitters will no longer collide with other biters/spitters. more

Graphics

  • Added new remnants for several entities. They are still work-in-progress and subject to further change.
Bugfixes
  • Excluding runtime fluid mixing check from assembler migration that caused some crashes when loading a save with mixing in it.
  • Fixed landfill map color on old saves. more
  • Added migration to recalculate tile transitions when tile layer definition changes in tile prototype. more
  • Fixed that artillery remote failure sounds could be duplicated in some cases. more
  • Fixed that the game would still process mod dependencies for disabled mods. more
  • Fixed that underground pipes with different length could sometimes connect one tile further.
  • Fixed that the cursor would appear in the wrong position after textbox alignment was changed by scripting. more
  • Fixed placement of scrollbars around textboxes. more
  • Fixed a crash related to teleporting biters during the ai-completed events. more
  • Fixed that non-square crafting machines without fluid boxes didn't rotate correctly. more
  • Fixed that the game would freeze when trying to find automatic artillery targets with very high levels of artillery range. more
  • Fixed tile ghosts sometimes overlapped on edges which created visible lines. more
  • Fixed that the on_gui_switch_state_changed event would fire twice in some cases. more
  • Fixed wrong damage bonus values in tooltips of combat robots and units in a different force. more
  • Fixed that the research screen would show a technology as "available" when it was queued. more
  • Fixed that LuaEntity::last_user didn't support writing `nil`. more
  • Fixed that mod GUIs could show on top of the technology screen after loading a save. more
  • Fixed a crash when using the /screenshot command. more
  • Fixed that the --disable-migration-window command line option didn't always work. more
  • Fixed that pumps had a drain when using a non-electric energy source. more
  • Fixed a bug in fluid system splitting.
  • Changed order of pipe connections to avoid previous cases of fluid mixing. A.k.a Boskid's deferred pipes.
  • Offshore pumps now set fluid filter automatically based on produced fluid. more
  • Fixed crash when closing shortcut selection list while dragging. more
  • Fixed that biters could get overloaded by artillery and stop moving. more
  • Fixed that biters could get stuck during attacks. more
  • Fixed that biter pathfinding could cause unreasonably large save files. more
  • Fixed that biters would attack in a single file due to their colliding with each other. more
  • Fixed that personal roboports would function with literally no power.
  • Fixed migrating pre-0.17 maps with detached characters that had a grid armor in quick bar would corrupt game state. more
Modding
  • Added optional flying robot prototype property "max_speed".
  • Added light_renderer_search_distance_limit to utility constants.
Scripting
  • Changed LuaEntity::color to also work for cars.
  • Changed LuaStyle::padding, margin to also accept arrays of padding values.
  • Added optional "unit_number" to on_post_entity_died event.
  • Added support to teleport car entity types between surfaces.
  • Added LuaEntityPrototype::call_for_help_radius, max_count_of_owned_units, max_friends_around_to_spawn, spawning_radius and spawning_spacing read.
  • Added LuaForce::research_enabled read.
Factorio - Klonan
Read this post on our website.

Map editor Lua snippets

In the last few weeks, we've really accelerated our work on the campaign. We've been pushing ahead a lot with both the scripting and blocking out the physical level design.One of the problems we've come up against a lot, is that we often need to perform custom edits to the map, which are quite tedious, but not common enough to add a new tool to the map editor for them. For example, something like "disable all the spawners in this region".

This kind of problem is easily solved with a little bit of custom Lua code, but getting the specification of the area we want to edit into Lua is a painful process of noting down and typing out location coordinates. It is also easy to lose track of these Lua snippets, as there is no good place to save them.

To solve this problem, we decided to add a Lua snippet tool to the map editor. This tool will let you drag your cursor over an area, and it will then run your custom Lua code on that area. The snippets are named, and saved in your player-data.json, so you can keep them around for later.

https://cdn.factorio.com/assets/img/blog/fff-316-snippet.mp4
For example, this simple snippet replaces trees with biters.

Currently, there doesn't seem to be a very big scene for community made custom maps/scenarios with custom maps, and we're hoping that the example from the campaign once released, as well as the much improved editor we have in 0.17 will encourage more people to give this a go.

Apple signing woes
As some of you may have heard, Apple is introducing a new system called notarizing to their MacOS apps. This is a system where you sign you packages and upload them to apple so they can run something akin to a virus scan, and mark it as approved. As of the new MacOS Catalina version, this will be mandatory. Our friends at Valve were nice enough to send us a warning with some info about the process. Up until now, our MacOS binaries haven't even been signed at all, so this seemed like a good time to get on that. To be clear, you could, and can play unsigned factorio binaries on MacOS, but you need to change your security settings to do so (or so I thought).

To test, I grabbed the .app of 0.17.69, signed it, uploaded it to apples notarization server, and got the notarization process to succeed (eventually). I then copied it onto a completely fresh, default settings install of macOS Catalina, double clicked it, and it ran, with no security prompt. Problem solved, right? Well, after that I decided to do a sanity check, and copied over the completely unsigned binary of 0.17.68, and it ran just fine as well, also with no security prompt.

So, at this point, it seems like we don't really have a way to test this process, so all we can do is set things up correctly to the best of our abilities, and see if it works for people. The next Factorio release should include signed and notarised macOS binaries, so if anyone has problems with 0.17.70 security warning on macOS, please let us know.This whole process has been rather slow and painful (just getting the notarizing tool working was a bit of a saga in itself), and doesn't inspire much confidence in Apple's developer ecosystem, so if anyone at Apple is reading this, please, please, make this process better.

Also to make it known again, we are still looking for a macOS developer to join our team, so if you are interested or know someone who is, please checkout the job listing.

Non-colliding Biters
For a long time we have been improving the biter pathing, with many iterative changes and tweaks. However we have long had a problem in the moment where a group of biters encounters the players base. I am sure the scene below is familiar to all Factorio players:

https://cdn.factorio.com/assets/img/blog/fff-316-biters-collide.mp4

This mating dance or whatever it is, has long been a thorn in our side. The reason behind it is quite logical. When moving, the biters are in a group, and everything goes smoothly. However when they see an enemy, they are 'distracted' by it, and individually try to attack it. Since the biters are now moving and pathing as individuals, things start to get messy. The biters find a path, but then there is another biter in the way, so he tries to move and turn around, but there are biters in the way there too, and each of those biters are trying the same thing, so it all goes gets clogged up for a while.

The solution we have decided, which some might consider a 'hack' is that we simply don't make biters collide with other biters. In the engine this was a rather simple change, and was already possible just using normal mods. The result speaks for itself:

https://cdn.factorio.com/assets/img/blog/fff-316-biters-no-collide.mp4

There is already some 'separation' logic in the engine to keep biters from getting too close to each other, so in the end we get away with a lot of the benefit of no collisions, without the immediate/obvious problem of biters infinitely stacking. There might be some smaller issues to pop-up with this change, and maybe some balancing tweaks to be made, but we are happy with the outcome so far.

Twinsen is going to Poznan Game Arena, Poland
Next week I'll be in Poland for 3 events:
If you are in the area and see a guy with a Factorio hoodie, it will most probably be me. I am looking forward to meet any fellow developers or fans attending.

Ludum Dare entry
Over the weekend, two of us (wheybags + Abregado) entered the Ludum Dare game jam. A game jam is an event where people make a game as completely as can be in a fixed time-frame (in this case 48 hours). We ended up making a rather Factorio-appropriate gear puzzle game. Check it out if you're interested.



As always, let us know what you think on our forum.

Factorio - Klonan
Read this post on our website.

New test servers
We recently bought and assembled some high-end PCs, with the hope to gauge the performance, speed up running tests, and potentially consolidate the number of servers we are maintaining internally. The two lucky CPUs were a i9-9980XE 18-core and a Ryzen 3900X 12-core.



We are using the time to complete our test suite in 'heavy mode' as a benchmark. Heavy mode basically saves and reloads the game each tick, and compares a CRC of the map from before and after. It is super slow to run, but the heavy test is critical to help find any possible determinism issues. There is some more info on 'heavy mode' in FFF-63.

As a baseline, the 'standard' CPU in the office for developers is the i9-7900x 10-core, which runs heavy tests in about 530 seconds. In real time this is 8 minutes and 50 seconds, a long time for a team member to sit around for results before they can push. We can do better!

As you would expect, the new 18-core was blazing fast, with a test time of about 400 seconds, shaving off over 2 minutes. However the Ryzen was a different story, with a test time of about 600 seconds. This goes against what we predicted, where more cores and higher frequency mean lower test times. The initial results from the 12-core Ryzen were worse than from the 10-core Intel; not a good start.

So I did some digging and some research, and the answer I arrived at was RAM. When we ordered the parts, not much thought was given to the selection of RAM, just some standard 16GB 2666MHz sticks to fill all the slots. Luckily, I looked on a local Czech website, and they had some stock of the brand new G.SKILL 3600MHz Trident RGB Neo, a high performance RAM stick made exactly to suit our new Ryzen CPU. After installing the new RAM, we had a test result that better matched our expectations: 450 seconds. We knew beforehand that Ryzen liked fast RAM, but we didn't realize how significant of a difference it could make.

So now we have set up both these new machines to run tests automatically after each commit, and we are very happy with the result. The new i9-9980XE can compile and run heavy tests faster than our old i7-4790K can compile and run just normal tests. Having it run automatically also frees up individual developers from the responsibility of running heavy tests locally, so they can just push as normal and continue working.

Server room organization
Alongside building the new servers, we also had some new storage shelves installed in the server room. So this week I spent some time moving the servers from their old home (of the floor) onto the new racks, and moving a lot of the 'PC junk' (cables, mice, fans, spidertron, keyboards, SSDs, headphones etc.) that had accumulated around the office into the server room.



We now have 10 servers, some run tests, some do the deployments, etc. We are hoping to reduce this number in the future, as we can have 1 beefy PC do the work that is currently handled by multiple older/slower ones.

Community Spotlight - Nauvis Invasion
This week I spotted a Reddit post by /u/Bladjomir. It is a video of this modded base after he had respawned all the biter bases. I was really in awe at just how different the game can 'feel' once you started adding and combining mods (especially when it is coupled with the classic Red Alert 2 soundtrack). So I messaged Bladjomir asking if I could include his video in this Friday facts, and he took the time to create a brand new video for us to showcase:

https://youtu.be/Qekvxw9t7zo

As someone who grew up playing the old school RTS games, these videos really hit on some nostalgia for me. What I am really proud of, on behalf of the team here, is just how well the game supports mods. It really is just so amazing to me that we have a engine now that can be extended and overhauled by mods and just works.

There will be a time when Factorio base game is finished, when we have made the game we set out to make. Yet even though our vision is complete, anybody can come along and implement their own ideas, rework what we have done, and even (theoretically) turn off the base mod and make essentially their own new game in the engine. So in the (super) long run, I believe that mod support will be critical to keep the game and community alive, and continuing to improve the modding capabilities of the game is a strong possibility for post 1.0 support/updates.

As always, let us know what you think on our forum.
Factorio - Klonan
Read this post on our website.

Hello,
technically this post is the Pi Friday Facts, but unfortunately we can't think of anything special to do... maybe someone can make a combinator cake... that can calculate Pi?

0.17 stable
We released 0.17.69 as stable this Tuesday. It seems it all went very smoothly, no avalanche of crashes, and only a handful of technical support emails about updating video drivers.



Apart from stable, essentially no development work has happened this week; nearly everyone is on vacation (I am even writing this as I sit in the airport waiting to fly to London for a wedding). We're hoping that at the start of next week, with all the relaxation over, and the pressure of stable off our shoulders, we will get cracking on the next updates with renewed energy.

In fact I might be a little optimistic in saying this, but I think we are in for some exciting times here in the team. Before now, we have always done a cycle of having the whole team on development for a few months, then the whole team bug fixing for a few months. This binary approach is what gives us the traditional 'stable' and 'experimental' labels. This is not to say that all bug-fixing would stop once stable it out, quite the contrary, but this has been the general strategy.

What we are planning, if the logistics of it turn out okay, is to have significantly smaller feature releases, containing only a handful of new features. This is to have a sort of mixed cycle, and a mixed cycle in two similar ways:
  • Some developers will be on bug-fixing while others are on development.
  • The individual weekly/monthly work of a developer will have a more balanced mix of development and bug-fixing.

For example, while one developer works on a feature for the next feature release, another will be bug-fixing the features in the current release. This is only practically possible if the feature release frequency is relatively high.

This new structure has been a long time brewing in our minds, and we think now is the right time to try it out. With the GUIs we really need to do quick iterations and receive fast feedback to the changes. The traditional release flow meant that we could add a new feature to the game, and players wouldn't get their hands on it for months. Then once it is released and we start getting feedback on it, extra time is spent just re-orienting ourselves to the code and how it was written. If the feedback is given expediently, the rework and improvement is much more efficient.

Furthermore, I think it is more psychologically effective to work on a mix of bug-fixing and development. This is just theory now, but grounded in some observations I have made over time.

Development work, a new feature, new GUI, etc. is generally a long-form creative process. New systems have to be created out of pure thought-matter, ideas for implementation have to be evaluated and determined, and it also involves a lot of 'background processing'. Feature development always has more room for extension, and it is very hard to say 'It is finished'. It is also quite a subjective result, so sometimes it is hard to know if you 'did a good job'.

Bug-fixing on the other hand is very short form and challenge oriented. It is like investigating a murder mystery, and really feels like a complete story. Tracking down a problem inside the game engine engages a logical part of your brain, trying to piece together and backtrace where the fault is occurring. Generally the bug has a very clear 'win-condition', and you can close the game and let your mind rest peacefully. The result of a bug-fix is grounded strictly in objective measurements, so you can be reasonably sure if you 'did a good job'.

So these two parts of the job are in a way, quite distinct and separate: Development is a long-form creative process; Bug-fixing is a short-term logical process. From all this, my reasoning is that focusing on only one for a long period of time leads to quicker mental fatigue, and that a balanced workload will keep us happier and more productive.
In essence, doing development lets our bug-fix circuits rest, and doing bugs lets our development battery recharge.

There are also some pragmatic reasons I think the smaller/quicker releases will make things move along more smoothly:
  • Bug-fixes after stable will be released within a short time-frame.
  • The flow of bugs coming in will be less extreme, no more massive waves with each major release.
  • There will be less 'blocking', where unfinished features delay a release. They will just be scheduled for a different release.
  • Feedback will be more focused, so it is easier for us to evaluate.

At the start of the year, I read a book called "Rolling Rocks Downhill" by Clarke Ching. It is a book about software project management, it was quite an enjoyable read, and gave me a lot of inspiration to try and optimize our development effort. At that time we were just wrapping up 0.17, so there wasn't a whole lot of room to make changes to the way we do things. Now that we have stabilized 0.17, and with it, completed the 'traditional' cycle, there is opportunity for a fresh approach. I guess I will give the book another read next week...

World of Warcraft has some good ideas
As you might know, I've spent quite a considerable amount of time playing World of Warcraft classic the past few weeks. I find it very interesting that many people (me included) find this version of the game way better than the modern version, there are many reasons for it that I see (and some that I don't), yet it deserves some small analysis as it is always better to learn from mistakes of others. By that I mean, that I wouldn't want to spend next 10 years working on better versions of Factorio just to find out, that the old ones were better for some reason.

The topic that connects it all is "Making things more convenient isn't always making things better". There are a lot of activities in life and games that we would like to remove or make more convenient, but we don't really see the hidden benefits of it. Something like making an elevator to save time and effort, and feeling bad for moving less in the long run.

One of the things in wow is nicely illustrated by in this video. When people had to gather group for a dungeon back in the days (and now in classic), they had to do it manually. They had to spam LFG (*Looking for group) channels, ask in guilds or find long-time buddies to play with. In modern wow, they made a dungeon finder that allows you to just select a role and automatically teleport you to a dungeon with the appropriate people. It seems like a great convenience. But in fact, it removes so much that it is considered to be one of the most hated feature by many people.
  • When it is harder to find a group, it has also more value when the group is already assembled. This means, that people are more likely to try to overcome problems while fighting rather then just quitting and re-rolling with someone else. This make it much more interesting as it created a lot of challenges where non-optimal setup or a noob in a group forced people to learn from each other more, or just to try to overcome the problems in a creative ways.
  • When you are not teleported to the dungeon and have to actually travel there, it keeps the immersion of the game, the world is there to be explored, not just an arcade where you push and play. And same as with previous point, getting there requires more effort, so the value of doing the dungeon is higher.
  • And generally, having more dungeon runs in the same time doesn't make it feel like you accomplished more in the game, as it generally just lowers the value of one run. And all this for the cost of it all being way more mechanical.

Another big example is level scaling. The idea is again nice, to make it more convenient. With level scaling, monsters conveniently scale to your level in the zone where you are, so you can quest at any place without having to avoid too high or low levels areas relative to your level.. But I consider this to be actually plague of any game where it appears. Instead of zones, their levels and your level meaning something, and the progress being clearly visible every level, suddenly it all disappears. The world isn't a place to explore, but rather arcade-like place that all resolves around you. Your level doesn't mean much, as it being too low isn't a problem anymore. The moments of having to run from areas where you are too weak to get back later are one of the most important in RPGs, and suddenly they are gone. The progress you see in games is like looking from a window of a train, if the train moved and the landscape moved the same way, you wouldn't feel like you are moving at all.

There are much more lessons learned while playing the game. Not only the mistakes made in modern version, but also lessens of good game design obviously. How could these be related to Factorio? I believe that on the deeper level, there could be a lot of parallels.
  • Getting first mount at level 40 for 100 gold? You have to walk a lot before you get it and it might feel annoying at times. But when you actually get it, it means A LOT. Similar as how it is a game-changer to get construction robots/logistic robots/power armor. Getting there isn't easy, and there are certainly a lot of moments where you/we feel like having these sooner might be more convenient. But it would just decrease how great and valuable upgrade it is.
  • We were thinking about a belt building tool, similar to the rail building tool. It would just connects ends, and even find underground connections etc to get to the point of destination. It would be super convenient. But suddenly, solving the belt puzzle wouldn't mean much, and having the belt factory would feel like much smaller accomplishment.

Anyway, thanks to all of you for such a great year so far, thanks to all our friends on the forum and throughout the community who have helped us in the great bug war of 0.17, and as always, let us know what you think on our forum.
Factorio - contact@rockpapershotgun.com (Natalie Clayton)

Despite being in development for a fifth of my lifetime, Factorio has somehow only reached version 0.17. Crikey, software development terms, eh? Whenever I’ve developed a game, I just make ’em up. Still, I wager the folk behind the mechanical monstrosity that is Factorio have everything scheduled out nicely, laid out on complex spreadsheets which work themselves out without human input. But still, their assembly line continues to self-construct. Nerds.

This week’s latest stable release brings in new content for construction nerds old and new with a new tutorial and world-construction tools.

(more…)

Factorio - Klonan
Read this post on our website.


It has been 6 months and nearly 70 releases since we first launched 0.17 to the world. Now is the time to let is be enjoyed by all the players of the game. We are going to be continuing our work on 0.17 over the next few months, with small experimental releases of new features, and finishing all the GUI reworks.

New map editor
The new map editor can be accessed directly in-game with the <tt>/editor</tt> command. Packed with new features and improvements, such as cloning tools, multiple surface support, and time control. The new editor also allows collaborative map editing in multiplayer. More details: FFF-252.

Redesigned enemies
The enemies in the game, the native inhabitants of the planet, have received a major facelift in this update. As well as a graphical overhaul, the attacks and balancing of the spitters and worms has been revised, incorporating skill-based elements and some tactical decision making. More details: FFF-268, FFF-279.

Automatic mod downloads
Now when trying to join your favorite server, you can directly sync your mods with the server from in-game, and automatically join once they are all installed. This massively reduces the friction for joining modded servers. The in-game mod browser has also been redone to help find new mods and manage your installations.

Optimized fluid system
We have massively optimised (and parallelized) the fluid update in 0.17. In effect each section of pipe can be updated independently of other pipe sections. This comes as welcome news for any megabase planners out there. Furthermore we have limited each pipe section to only a single fluid, and will actively block any placement that could mix fluids, to prevent the catastrophe of mixing water into your oil system and bricking the whole system. More details: FFF-271.

Rewritten rendering backend
This release has a completely new rendering backend, written almost from scratch to our exact requirements. The new engine takes advantage of more modern GPU features and is highly optimized. What this means is that the game can now work with much less VRAM and allow players with older videos cards to still enjoy the game in high resolution at 60 FPS. More details: FFF-251, FFF-264, FFF-281.

Due to the more modern architecture, some issues may be present with certain hardware configurations, please see this forum thread if you experience any graphical problems.

New introduction scenario
We have added a completely new introduction scenario on a hand crafted map. It gives new players some simple goals and provides a place for them to experiment with a smaller toolset than Freeplay allows. The scenario is open ended, so that players may experiment with larger bases. A separate techtree is provided for this purpose which includes some infinite research. Our companion robot, Compilatron, is also present to help guide the player. More details: FFF-262, FFF-306.

Construction shortcuts
We have added some powerful shortcut keys, which use the intuitive layout we are all used to. Now you can undo your last action by pressing CTRL + Z, quick equip a cut tool with CTRL + X, do quick copy/paste actions with CTRL + C/CTRL + V, and assign robots to upgrade your factory with the new Upgrade planner. More details: FFF-255.

New GUI
We added a new GUI skin, along with the first batch of GUI reworks. The new GUI aims to unify the look and feel of the game, and provide a consistent visual basis for the players interactions with the world. More details: FFF-243.

Much more
As always there are a ton of smaller features and changes to discover in this latest major update. You can read the changelog in game for a full rundown, or checkout the release notes here.

We have our plan moving forward for the next version of the game, which you can check out here.
Factorio - Klonan
Read this post on our website.

Hello,
We have had quite a peaceful week here in the office.

Last night we went out for a burger and a beer as a last meal with Ernestas before he flys back home for another few months. It was also quite nostalgic, as we went to a place that we used to go to frequently near our old office, and the staff still remembered us.

Light at the end of the bug tunnel
It seems our 'news' of some programmers taking a break made headlines this last week: Work slows on Factorio while a dev “levels his priest” in WoW Classic.
Even though he is still not level 60, Kovarex found some time to fix a few more bugs, which seemed to go very smoothly, as he is feeling super recharged.

We also had Boskid come to visit the office, and he helped us do some intensive testing and test writing. Working together with Dominik, the two managed to find and fix a lot of bugs related to the fluid mixing system. It was certainly more efficient having someone doing QA inside of the office, so it seems our team might be getting a bit bigger.

With the last 'blocking bugs' resolved, the bug war is almost at a close. The count on the forum is down to only 16, and the automatic crash reports are looking okay:



We have released version 0.17.69, we are optimistic that this version may be able to be called stable. While this is almost over 1 month after our first 'stable candidate', we are confident now that this version is more stable than 0.16.

Landfill update
In last week's FFF we presented the new landfill terrain. We felt relieved by having another task done in GFX.
One of the first reactions in our forums was the idea by eradicator of rotating the grid to 45°. It followed a fast mockup made by ThreePounds. The idea was good, and apart from us, some people on the forums agreed.

The modification of our sources to get this rotation done was very affordable to us, so we decided to make it official and here we are now presenting it:



This solution is nicer than the 90°'s one because basically it doesn't interfere with the tile grid of the game, and provides a nice loose space feeling in the general composition. I just felt a bit guilty for not coming with the best approach from the beginning, but luckily our community is very keen to give us feedback on any aspect of the game.

Thanks guys for the feedback.

As always, let us know what you think on our forum.
Factorio - Klonan
Read this post on our website.

Fluid mixing saga
Hello Factorians,

Today I would like to talk to you about my favourite subject - fluid mixing and its prevention. It is a new mechanic introduced in 0.17 that seemed quite simple at first, but has been giving me nightmares ever since.

A while ago I took on the task of updating the fluid system (FFF-260). The way it works in 0.16 is that the fluid boxes (the thing that holds the fluid and is contained in entities like pipes or refineries) had no organisation whatsoever except their connections. They would sit there and do nothing and then once per update send fluid somewhere. It had it's issues especially with symmetry, and when you happened to put some fluid where it did not belong, you could end up requiring major demolition works.

My task was to develop a better algorithm to move the fluids, and a very very optional side task I had in mind was to do something about the fluids getting to wrong places and mixing. We started by organizing the fluid boxes into systems (connected FBs make a system) managed by a special fluid manager, and optimizing the heck out of it (FFF-271).

Soon after, I started working on the new algorithm and anti fluid-mixing. Until then nobody really considered preventing the fluid mixing seriously as it did not seem possible. But when I thought about it, it did not seem that hard. The idea is to simply not allow any action that would lead to fluids getting where they are not supposed to go. When you build a steam pipeline, you should not need nor want it to touch another fluid.

In principle, it would only require a few quite realistic mechanisms:
  • A connected block of fluid boxes would either be fluid-free, or it would be locked to one fluid.
  • Two such blocks can connect only if they are compatible - either one has no fluid lock, or they have the same fluid.
  • An assembler can only set a recipe if it is compatible with the fluid locks on its fluid boxes.
  • Have a migration from old saves that can contain mixing.
By creating the fluid systems right before, number 1 was almost finished and we only needed to assign the lock. It would be set either by a fluid, or by a 'filter', which is a fluidbox that is set to use a fluid - such as a water pump using water, or assembler having some inputs/outputs given by a recipe.

After a while I had both the fluid algorithm and the mixing done (FFF-274). The mixing was not that easy (like 5x more complicated) but it worked pretty well. As for the fluid algorithm, V453000 and Twinsen found some issues with waves on a macro scale, and because it was right before releasing the 0.17 experimental, we decided to hold it off on it for the time being (we have a new version now that seems okay, but has to wait for 0.17 becoming stable first). The mixing made it through though and seemed quite finished.

It turned out that the work on it was at most one tenth complete.



Some difficulties appeared already before the initial release, but that was only a hint of what would come later. One by one, then ten by ten, bugs started coming. The problem is that as often as not, they were not just little issues with simple fixes. Instead, over and over, they turned the current solution on its head and the code had to be completely rewritten in order to account for the new case. As of now, almost exactly half a year and many rewrites later, it is still not fully bug free.

The number one issue was with Assembling machines. It turned out that their code was pretty messy and does not simply allow the checks I needed, so it had to be refactored. The next problem was that the check was not only required when setting a recipe on an existing assembler - as I naively thought - but in about one million different situations I would not dream existed. Building a fixed recipe assembler. Reviving an assembler. Rotating. Blueprint of an assembler. Blueprint with a recipe and a rotation placed over a ghost with a non-default rotation during a full moon. Teleport. Script building. Copy-paste settings. Any combination of these.

Pretty much every case would go through different paths in the code and behave entirely differently. Fixing one would break another and so tons of tests had to be written. When these cases finally worked, it turned out that doing these operations when they fail (e.g. can’t rotate because it would cause mixing) brings another wave of issues. And then mods come and the complexity multiplies. All this, although in a more simple form, had to be done for all other entities that can use fluid too, such as inserters (mods...).

Another number one issue are underground connections. When playing, you would not think twice about them but on a closer look they are all but simple. They have this (cough) uncomfortable feature (want to shoot myself) that you can build another underground pipe between them (or take it out) and a complex reconnection logic jumps in. It means that based on building order, connections are established and reestablished differently. This is a big thing when building a blueprint with many pipes, or loading a save game.

But the largest issue is one tiny corner case with huge implications. Have two underground pipes that have different fluids, but are split by a third, and it gets removed. Until now mixing was theoretically completely avoidable, but here it was and there was nothing to stop it.



As a result, a new concept is introduced - a blocked connection. An underground connection that would normally connect but can’t. Establishing it is the easier part. But when does it get fixed? An entity miles away gets rotated, that splits a fluid system, disconnecting the blocked connection from a fluid filter on the other side, and the connection should unblock. But even something as simple as a rotation contains fluid fixes and re-establishing of fluid boxes and if it fails, it still fixes the blocked connection in the process and it can’t be undone... You get the picture. And we are still talking about underground pipes, while anything can have underground connections, including said assemblers, which the previous code did not consider at all. The complexity just goes deeper and deeper, and Rseding is probably right that we should have never gone this way at all.

So the bug fixing has been basically running in circles - clearing one batch of bugs, thinking that those were the last ones and the ordeal is finally over, only to find another batch (ideally from some bizzare modder idea) a few days later. Many times I wished that mods never existed. Nor multiplayer, or any players at all for that matter. About two months ago all seemed really fine, with basically no reports and just a few crashes in the automated crash reports.

At that moment another nightmare materialized in the form of a talented volunteer bug tester named boskid, who took on a personal crusade to break the fluids to dust (I actually imagine him sitting in his dark room with evil laughter, dreaming about making my next day worse than the previous). In all seriousness, he has done a great deal of work with his bug testing, creating bizzare modded cases and testing scripts, and deserves a big thanks. He is actually coming to our offices next week, so follow the news for reports of developers falling out of windows.


An example of a nice configuration he found (and I can’t fix).

The whole time we were taking the offensive approach to mixing - crash the game when it happens - so that we know about bugs to fix them. Recently we have decided to put a stop to it and have the mixing automatically fix itself once it is detected, eyeing the end of this episode. Right now I have 3 mixing bugs on the list and I am sure those are the last, and mixing will be done (lying to myself is a way to cope with it) and the new fluid algorithm can come soon after :).


(And of course, boskid found a way to use the automatic mixing fixing as an evil PVP tactic.)

Landfill terrain
This week Ernestas came physically to the Wube office to spend some time with us (he is normally working remotely), so we are taking the chance to finish things that we had in the drawer that needed closer communication. One of those things is a specific terrain for landfill. As you know we were using grass for it. Not anymore.



In Factorio we have a clash of two worlds:
  • The natural and organic planet. Off-grid with multiple terrain types, trees and doodads.
  • The world of the factory, which is mathematical, regular, modular, and totally attached to the grid.
This new terrain represents a boundary in between those two worlds. The grid on its surface tries to express the artificiality of it, like mechanically pressed with some sort of industrial stamp. The imperfections of the grid and its irregularities are holding this man made terrain into the realm of the natural environment.

For now the sound of the landfill action is not solved, 'soon' we’ll take care of it.

As always, let us know what you think on our forum.
...