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 #326 - Particle emitter Data cache

Read this post on our website.

More particle optimisations (Allaizn)


Rseding's recent optimisations of the particle system (FFF-322) made particles much more lightweight thanthey were before, but it still left particles as rather complex beasts. A quick summary of the possible actions a particle can make during it's update:
  • Move their own position.
  • Advance their animation to another frame.
  • Land in water and apply a trigger.
  • Apply another trigger with a certain frequency.
  • Remove themselves from the game world once their life time ends.
What makes this complex is that triggers are general purpose systems that can do all kinds of things,including creating and destroying entities, fire, smoke and other particles as well as playing sounds or recursively applying even more triggers. In other words:applying a trigger is an "anything can happen" situation and thus totally unpredictable, which in turn makes optimisations extremely hard.

The particle emitter


The base game and most mods don't use particularly crazy triggers when creating particles - the goal is usually to just spawn in a bunch of small animated texturesand make them fly around on screen (which is somewhat ironically what is usually called "particle"). An idea for further optimisations of particles was hence to createa kind of "simple" particle, which couldn't apply all kinds of triggers to allow handling them in bulk, which is usually faster than handling them individually.This bulk handling would be done by a thing called a "particle emitter", whose whole job is to create, update, draw and finally destroy the simple particles it manages,with the idea being that a biter dying wouldn't have to spawn hundreds of particles, but only a single/few emitters. But this is not all: simple particles are not able to change any other game state, and would thus only get updated to maintain their own internal values - mainly theirposition and velocity. A small physics exercise later the idea was born to not update the particles at all - you can compute their current position from their startingone after all! Even better: if the particles aren't ever rendered, then there's no point in creating them in the first place, so there's no reason to do that until theemitter comes into draw distance - millions of biters dying in gigantic blood fountains offscreen would thus basically not matter at all for your frame and update time! https://cdn.factorio.com/assets/img/blog/fff-326-emitter.mp4 A visualisation of the emitter in action: the red box represents the actual screen. Particles managed by emitters outside the screen region simply don't exist at all. The particles themselves not being allowed to affect gamestate has another benefit: in a multiplayer game, each player only has to generate the particles theysee themselves, instead of those that are visible by anyone. This also suggests not using the emitter's update function, but it's draw one instead, which yields even morebenefits due to the draw function being called during the render prepare phase, which runs on as many threads as you allow it to have. However, all of this doesn't just magically work correctly, and there are edge cases that need handling. For example: what happens if an emitter is created offscreen andthen comes into view distance? What happens if you save and reload? What happens if you save and reload with a mod set that doesn't have the particles defined any more? It would be very odd to see your rocket silo explode in uncountable bits, see how they fly and crash into the ground - then save and reload and see everything again because the particle effect restarted. Handling these kinds of issues took some time and thankfully only increased the systems internal complexity marginally, allowing me to focus on expanding it's features.Currently, the following things are supported to be present on an emitter:
  • Handling simple particles with individual random starting positions and velocities.
  • Handling simple particle streams via normal and instant tails as shown in FFF-325.
  • Handling simple particles with a smoke trail behind them (FFF-325 has some examples of this, but the effect already existed beforehand).
  • Handling simple particles impacting the ground by potentially being replaced with a water splash when hitting water.
Particle emitters have two main restrictions:
  • They only handle a single particle type (and technically associated smoke and water splashes). Making an assembling machine burst into metallic blobs and oil splashes would thus require two emitters.
  • The particles managed by an emitter cannot fly too far away from the emitter (which itself will never move), because we need to know how far outside the draw distance to search for emitters that may want to render their particles.
https://cdn.factorio.com/assets/img/blog/fff-326-all-effects.mp4 A demo particle animation showing off all effects at once - all of these are managed by a single emitter.

Startup time - Data Cache (Rseding)


Game startup time (time to reach the main menu) is just as important to us as compile time (see FFF-206). With how frequently we compile and launch the game to test things, every extra bit of time spent waiting for the game to load is wasted time. There are 2 main parts of the Factorio startup process:
  • Go over each enabled mod and collect the prototype data it defines/generates (the 'data stage').
  • Load and process the sprites that the game needs to run.
https://cdn.factorio.com/assets/img/blog/fff-326-mod-loading.mp4 This is a familiar sight to those who play with a lot of mods. In the past we made an experimental setting which would cache the loading and processing of the sprites, so we never need to wait for it when nothing around them has changed. However, the game still had the process all of the 'data stage' every time the game would start. During normal development that wasn't really an issue - it would happen in a fraction of a second in most cases. However, as the game has grown, so has the amount of stuff that gets processed during the data stage. Additionally, for every mod enabled that has anything in this stage, the time would roughly double. Recently I started to wonder what it would take to make the same kind of caching system we have for the sprite loading for the data stage. Since mostly the results are the same between restarts, it would mean it didn't need to do most of the work - and should be faster. After working on it for about day I had a working prototype; but it wasn't actually any faster with just the base game. Not wanting to quit just yet I spent some time with the profiler and managed to find a few areas that I could optimize and reduced the time the caching logic was spending by about half. So, it finally had some benefit for the base game (although quite small). What I didn't expect was just how much of an improvement it was going to have for the modded case. What used to take 25 seconds in my testing took only 4 with the new cache setting enabled. The time savings gets even better as the number of enabled mods increases. The setting is still disabled by default because it's highly experimental, but if it ends up stable enough, we might turn it on by default.

Christmas mods (Klonan)


This is the last FFF before Christmas, so I thought we would celebrate some of the mods which aim to create some holiday spirit in the game.

Alien biomes


Alien biomes snowy terrain is just beautiful. In the map gen settings you can crank up the 'Cold Climates' option, so your whole world is just a cozy winter wonderland.

Holiday artillery


We must also remember to share the love to our biter friends, this mod will lets you deliver gifts far and wide, and embellishes the Artillery Gift delivery turret/wagon with a lovely red and green paint job.

Christmas tree


And of course, no winter factory is complete without a lovely Christmas tree. [previewyoutube=dljJijRJ6vQ;full][/previewyoutube] We wish you a merry Christmas, and as always, let us know what you think on our forum.


[ 2019-12-20 14:27:50 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 ]

20.65$ (17%)
12.72$ (15%)
33.59$ (16%)
27.59$ (8%)
25.19$ (16%)
50.37$ (16%)
14.44$ (15%)
8.79$ (12%)
8.25$ (17%)
29.39$ (16%)
34.79$ (13%)
12.74$ (15%)
4.12$ (17%)
8.25$ (17%)
12.71$ (15%)
16.99$ (15%)
1.11$ (78%)
16.59$ (17%)
12.44$ (17%)
26.69$ (11%)
10.91$ (16%)
3.55$ (91%)
21.22$ (15%)
8.89$ (78%)
12.44$ (17%)
17.79$ (11%)
16.01$ (11%)
8.27$ (17%)
16.97$ (15%)
13.99$ (69%)
GAMERSGATE

[ 764 ]

6.38$ (57%)
2.0$ (60%)
1.0$ (80%)
7.73$ (40%)
6.8$ (66%)
5.95$ (83%)
0.64$ (87%)
0.77$ (91%)
0.8$ (60%)
1.02$ (91%)
8.37$ (51%)
1.25$ (75%)
0.85$ (91%)
8.49$ (58%)
7.44$ (70%)
8.28$ (45%)
3.83$ (74%)
2.55$ (74%)
11.99$ (20%)
5.1$ (74%)
0.9$ (92%)
30.0$ (50%)
4.59$ (74%)
2.25$ (91%)
0.53$ (92%)
8.5$ (66%)
0.43$ (91%)
7.64$ (49%)
0.85$ (79%)
0.53$ (92%)

FANATICAL BUNDLES

Time left:

12 days, 10 hours, 52 minutes


Time left:

19 days, 10 hours, 52 minutes


Time left:

8 days, 10 hours, 52 minutes


Time left:

5 days, 10 hours, 52 minutes


Time left:

13 days, 10 hours, 52 minutes


Time left:

15 days, 10 hours, 52 minutes


Time left:

36 days, 10 hours, 52 minutes


Time left:

356461 days, 2 hours, 52 minutes


Time left:

18 days, 10 hours, 52 minutes


Time left:

47 days, 10 hours, 52 minutes


Time left:

33 days, 10 hours, 52 minutes


HUMBLE BUNDLES

Time left:

0 days, 4 hours, 52 minutes


Time left:

2 days, 4 hours, 52 minutes


Time left:

7 days, 4 hours, 52 minutes


Time left:

9 days, 4 hours, 52 minutes


Time left:

14 days, 4 hours, 52 minutes

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