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 #204 - Another day, another optimisation

Hello,as the team is getting slowly bigger and we still don't have any dedicated project manager, we had to start looking for tools to help us manage the team. We are testing software that allows our team members to track time spent on individual tasks, so right now my timer on "Friday facts related work" is running. I hope it to give me better insight into what kind of tasks our time goes to, where are we losing most of it, or what were the people doing when I was not here. People tend to not like these kind of changes, but we just have to admit that we are not the 4 people punk development team working from our living room and we need to invest more time into working efficiently.

Prefetching (Technical)


Kovarex already presented a concise summary of the prefetching patch, here is some more background and dirty technical details. I started to look into Factorio performance improvements a while back, more specifically UPS (updates per second) improvements for large bases. It is widely recognized that the UPS are mostly limited by memory performance (more). That is normal - even highly optimized scientific simulation codes are rarely limited by arithmetic instructions. At first, I looked into ways to reduce the size of Entities. Common entity sizes like Inserter (536 bytes) or AssemblingMachine (648 bytes) seem surprisingly large at first. I tried some changes, e.g. moving less frequently accessed data out of the actual entity in a separate object in memory. These changes had significant impact to the code in many files, but just saving a few bytes didn't make a measurable impact to performance. Back to a bit of theory - there are two different ways in which memory can become a bottleneck: bandwidth (the amount of data supplied over time, e.g. 50 GB/s) and latency (the time until a requested piece of data is available, e.g. 50 ns). Comparing the results for different RAM timing settings (CAS latency) shows, that latency has a significant impact. It is important to note, that Factorio is not a homogeneous workload - some parts are still limited by memory bandwidth, others by CPU. Modern CPUs are extremely good at mitigating memory bottlenecks by using caches, speculative execution and prefetchers. However, all active entities are read at every tick of the game. In large factories, this is too much data for caches. Also a virtual function call - such as the update of an entity - cannot be executed speculatively. Prefetchers are a part of the CPU that predicts what memory is going to be accessed soon and transfers it even before it is explicitly loaded. But since the entity update loop iterates over a linked list - the address of the next entity is stored within the entity itself - it is difficult to predict (not impossible). This is where software prefetching comes in - the programmer gives a hint to the CPU what memory is accessed soon. That is what we now do in Factorio: Before an entity is updated, the next entity is already requested so that it can be loaded in the background. The principle also applies to a few other loops over linked lists. The nice thing about this, is that it is an extremely simple and isolated change in the code. The downside is, that you are entering the realm of architecture-specific micro-optimization. If you aren't careful, it can even be bad for performance. A good rule is to never guess about performance - always verify. So I did some tests with different maps and the results were promising. Entities are larger than a single cache line and the pointers point into the middle of the object due to multiple inheritance. Many experiments later, the optimal range showed to be -128 byte to +384 byte (8 cache lines). This coincides with the sizes of typical entities. The prefetching instruction has another parameter determining the cache level used - which again was determined experimentally.
To get a bit more diversity, the measurements for this chart were done on a different CPU (i7-6700K vs i7-4790K previously), and include some more maps. It showed that the new belt-heavy map got less speedup (+5%) from software prefetching than the others. As a remedy, this map gets a huge boost from the belt optimization before. Other saves got a nice 9-13% speedup. All measurements are averages update times over 3600 ticks, the boxplots show 20 repeated runs. Overall software prefetching is a nice effective micro-optimization with very little code changes, but many measurements to find the right configuration and verify.

Crafting machine animation optimisation


The issue is, that crafting machines can have arbitrary count of secondary animations tied to it (rotating fan, liquid in the chemical plants etc.). As each of the animations can have different speed and frame count, we kept positions of all of these animations in dynamically allocated vector and just updated each of these independently whenever the crafting machine was producing. But now, we just have one number representing the overall offset of the animations. We move it depending on the speed of the crafting machine and all the animations calculate their cyclic position depending on the modulo of this value only when we need to actually draw the machine. This means, that this complicated code: [noparse]void CraftingMachine::setupWorkingVisualisationFrames(double performance) { const CraftingMachinePrototype& prototype = *this->getPrototype(); this->frame.move(performance, prototype.animation.getAnimation(this->direction)); if (this->workingVisualisationFrames.empty()) { this->workingVisualisationFrames.resize(prototype.workingVisualisations.size()); for (size_t i = 0; i < this->workingVisualisationFrames.size(); ++i) this->workingVisualisationFrames.randomize(prototype.workingVisualisations.getAnimation(this->direction), this->getMap().getRandomGenerator()); } for (size_t i = 0; i < this->workingVisualisationFrames.size(); ++i) this->workingVisualisationFrames.move(prototype.workingVisualisations.getAnimation(this->direction)); [/noparse] Becomes this simple: void CraftingMachine::setupWorkingVisualisationFrames(double performance) { this->frameReference += performance; this->showWorkingVisualisations = true; } The memory size of crafting machine is decreased and the overall performance of game is improved by additional 2%. Another day, another optimisation :)

HR Lab


The weekly dose of update high resolution graphics:
Related to HR entities, It turned out that our zooming system never showed an exact zoom of 2.0, which would be the 'pixel perfect' zoom level for the HR entities. By changing the zoom rate from 1.1, to the 7th root of 2 (1.104089...), the zoom now increments perfectly from 1.0 to 2.0 in 7 steps. As always, let us know any thoughts or feedback over on our forum.


[ 2017-08-18 18:16:52 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 ]

4.44$ (78%)
20.74$ (17%)
7.99$ (80%)
33.19$ (17%)
25.19$ (16%)
8.89$ (11%)
17.54$ (12%)
26.09$ (13%)
33.59$ (16%)
1.11$ (78%)
12.59$ (16%)
16.79$ (16%)
8.59$ (14%)
52.19$ (13%)
1.64$ (18%)
16.94$ (15%)
10.07$ (16%)
13.19$ (12%)
8.89$ (56%)
18.91$ (14%)
2.22$ (78%)
2.22$ (78%)
23.95$ (60%)
13.34$ (11%)
16.79$ (16%)
50.39$ (16%)
41.49$ (17%)
21.22$ (15%)
18.99$ (62%)
12.72$ (15%)
GAMERSGATE

[ 764 ]

0.53$ (92%)
9.41$ (69%)
3.87$ (70%)
0.6$ (91%)
15.99$ (20%)
4.25$ (83%)
10.58$ (47%)
0.53$ (92%)
2.21$ (83%)
0.85$ (91%)
1.0$ (80%)
1.7$ (83%)
1.11$ (91%)
7.65$ (62%)
3.83$ (74%)
4.59$ (62%)
0.53$ (92%)
2.0$ (50%)
5.6$ (53%)
3.83$ (74%)
2.25$ (89%)
0.53$ (92%)
7.64$ (49%)
8.5$ (66%)
0.64$ (87%)
0.34$ (83%)
0.51$ (91%)
6.8$ (66%)
7.73$ (45%)
3.19$ (79%)

FANATICAL BUNDLES

Time left:

12 days, 11 hours, 6 minutes


Time left:

19 days, 11 hours, 6 minutes


Time left:

8 days, 11 hours, 6 minutes


Time left:

5 days, 11 hours, 6 minutes


Time left:

13 days, 11 hours, 6 minutes


Time left:

15 days, 11 hours, 6 minutes


Time left:

36 days, 11 hours, 6 minutes


Time left:

356461 days, 3 hours, 6 minutes


Time left:

18 days, 11 hours, 6 minutes


Time left:

47 days, 11 hours, 6 minutes


Time left:

33 days, 11 hours, 6 minutes


HUMBLE BUNDLES

Time left:

0 days, 5 hours, 6 minutes


Time left:

2 days, 5 hours, 6 minutes


Time left:

7 days, 5 hours, 6 minutes


Time left:

9 days, 5 hours, 6 minutes


Time left:

14 days, 5 hours, 6 minutes

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