TUXDB - LINUX GAMING AGGREGATE
by NuSuey
NEWSFEED
▪️ GAMES
▪️ STEAM DECK ▪️ DEALS ▪️ CROWDFUNDING ▪️ COMMUNITY
tuxdb.com logo
Support tuxDB on Patreon
Currently supported by 9 awesome people!

🌟 Special thanks to our amazing supporters:


✨ $10 Tier: [Geeks Love Detail]
🌈 $5 Tier: [Arch Toasty][Benedikt][David Martínez Martí]

Steam ImageSteam ImageSteam ImageSteam ImageSteam ImageSteam Image
Friday Facts #317 - New pathfinding algorithm

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 wasnt the only biter-related update we released this past week. Somewhat coincidentally, this weeks updates have included something Id 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 its what makes the algorithm initially go straight. Its 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 wouldnt 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 doesnt 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 hasnt 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 dont 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'.
Allaizns key insight was that we dont 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 isnt 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 chunks 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 whats 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 dont 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 shouldnt 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.


[ 2019-10-18 11:05:32 CET ] [ Original post ]

Factorio
Wube Software LTD. Developer
Wube Software LTD. Publisher
2020-08-14 Release
Game News Posts: 506
🎹🖱️Keyboard + Mouse
Overwhelmingly Positive (164072 reviews)
The Game includes VR Support
Public Linux Depots:
  • Factorio Linux64 [306.86 M]
  • Factorio Linux32 [300.1 M]
Available DLCs:
  • Factorio: Space Age
Factorio is a game in which you build and maintain factories. You will be mining resources, researching technologies, building infrastructure, automating production and fighting enemies. In the beginning you will find yourself chopping trees, mining ores and crafting mechanical arms and transport belts by hand, but in short time you can become an industrial powerhouse, with huge solar fields, oil refining and cracking, manufacture and deployment of construction and logistic robots, all for your resource needs. However this heavy exploitation of the planet's resources does not sit nicely with the locals, so you will have to be prepared to defend yourself and your machine empire.

Join forces with other players in cooperative Multiplayer, create huge factories, collaborate and delegate tasks between you and your friends. Add mods to increase your enjoyment, from small tweak and helper mods to complete game overhauls, Factorio's ground-up Modding support has allowed content creators from around the world to design interesting and innovative features. While the core gameplay is in the form of the freeplay scenario, there are a range of interesting challenges in the form of the Scenario pack, available as free DLC. If you don't find any maps or scenarios you enjoy, you can create your own with the in-game Map Editor, place down entities, enemies, and terrain in any way you like, and even add your own custom script to make for interesting gameplay.

Discount Disclaimer: We don't have any plans to take part in a sale or to reduce the price for the foreseeable future.

What people say about Factorio


  • No other game in the history of gaming handles the logistics side of management simulator so perfectly. - Reddit
  • I see conveyor belts when I close my eyes. I may have been binging Factorio lately. - Notch, Mojang
  • Factorio is a super duper awesome game where we use conveyor belts to shoot aliens. - Zisteau, Youtube

MINIMAL SETUP
  • OS: Linux (tarball installation)
  • Processor: Dual core 3Ghz+Memory: 4 GB RAM
  • Memory: 4 GB RAM
  • Graphics: OpenGL 3.3 core. DirectX 10.1 capable GPU with 512 MB VRAM - GeForce GTX 260. Radeon HD 4850 or Intel HD Graphics 5500
  • Storage: 3 GB available space
RECOMMENDED SETUP
  • OS: Linux (tarball installation)
  • Processor: Quad core 3GHz+Memory: 8 GB RAM
  • Memory: 8 GB RAM
  • Graphics: OpenGL 4.3 core. DirectX 11 capable GPU with 2 GB VRAM - GeForce GTX 750 Ti. Radeon R7 360
  • Storage: 3 GB available space
GAMEBILLET

[ 6102 ]

15.29$ (15%)
4.44$ (78%)
21.21$ (15%)
17.79$ (11%)
21.99$ (12%)
4.12$ (17%)
13.34$ (11%)
8.29$ (17%)
13.59$ (15%)
20.74$ (17%)
11.03$ (8%)
24.89$ (17%)
4.44$ (11%)
34.79$ (13%)
20.49$ (18%)
24.87$ (17%)
17.79$ (11%)
16.57$ (17%)
2.22$ (78%)
13.34$ (11%)
3.29$ (18%)
5.77$ (17%)
6.71$ (16%)
16.99$ (15%)
33.17$ (17%)
17.79$ (11%)
1.64$ (18%)
13.34$ (11%)
12.45$ (11%)
4.22$ (15%)
GAMERSGATE

[ 764 ]

1.13$ (77%)
0.6$ (92%)
1.32$ (91%)
3.4$ (83%)
0.9$ (92%)
2.04$ (66%)
0.53$ (92%)
1.8$ (82%)
0.85$ (91%)
1.02$ (74%)
0.85$ (91%)
3.4$ (83%)
0.77$ (91%)
8.92$ (40%)
0.37$ (63%)
13.59$ (32%)
0.64$ (87%)
0.53$ (92%)
18.74$ (25%)
2.1$ (79%)
6.99$ (30%)
0.43$ (91%)
0.64$ (87%)
4.49$ (55%)
0.53$ (92%)
8.49$ (58%)
3.86$ (45%)
8.37$ (51%)
11.04$ (45%)
1.7$ (91%)

FANATICAL BUNDLES

Time left:

12 days, 10 hours, 45 minutes


Time left:

19 days, 10 hours, 45 minutes


Time left:

8 days, 10 hours, 45 minutes


Time left:

5 days, 10 hours, 45 minutes


Time left:

13 days, 10 hours, 45 minutes


Time left:

15 days, 10 hours, 45 minutes


Time left:

36 days, 10 hours, 45 minutes


Time left:

356461 days, 2 hours, 45 minutes


Time left:

18 days, 10 hours, 45 minutes


Time left:

47 days, 10 hours, 45 minutes


Time left:

33 days, 10 hours, 45 minutes


HUMBLE BUNDLES

Time left:

0 days, 4 hours, 45 minutes


Time left:

2 days, 4 hours, 45 minutes


Time left:

7 days, 4 hours, 45 minutes


Time left:

9 days, 4 hours, 45 minutes


Time left:

14 days, 4 hours, 45 minutes

by buying games/dlcs from affiliate links you are supporting tuxDB
🔴 LIVE