Friday Facts #357 - Nuke
Author: Klonan,
published 4 years ago,
[i][url=https://factorio.com/blog/post/fff-357]Read this post on our website.[/url][/i]
[h1]Blueprint library finishing touches (kovarex)[/h1]
At the time of writing the Friday Facts last week, not all of the planned changes were finished, here is the finalisation, so here we go.
[h3]Persistent library contents[/h3]
The problem is old. You play a modded game and have your blueprints in the library. Then, you decide to put the mods aside for a reason (to join a MP game, or just try a different modset). At that moment, if we didn't handle it in a special way, all your mod-related content in your blueprint library would be removed.
We solved the main part of the problem already [url=https://www.factorio.com/blog/post/fff-211]quite some time ago[/url]. But with the upcoming support of other tools in the blueprint library it had to be extended.
Special system was created for these things:[list][*]The preview icons of the blueprint tools[/*][*]The filters of the deconstruction planner[/*][*]The upgrade specification of the upgrade planner[/*][/list]
If the related ID isn't available any more while loading a game. Instead of just plainly removing it, it is marked as unknown and the original textual representation of the ID is stored in a special way.
The tool can still be normally used. Clearing the "unknowns" removes the information about the slot for good, but if you don't clear them it stays there.
[img]https://clan.cloudflare.steamstatic.com/images//12002589/f99a90e0eb1237d9b039a2084d9dfe754bc66b3f.png[/img]
[img]https://clan.cloudflare.steamstatic.com/images//12002589/f1942165a8f65e686b57b280f2968dcb0e0e6032.png[/img]
[img]https://clan.cloudflare.steamstatic.com/images//12002589/ff97b5b6fa728c1a07948d023e351b6f3e94ff91.png[/img]
Once you load the appropriate mods again, the IDs are restored.
[img]https://clan.cloudflare.steamstatic.com/images//12002589/b2e791f5f8bfa528bbb3ac196ce77f01179db5ba.png[/img]
[h3]Upgrades[/h3]
The UX of upgrading blueprints/books with the upgrade planner was meant to be provisional, but somehow, it remained in use for quite some time.
Currently, the only way to use it is to click the button with an upgrade planner in your cursor, which is sometimes quite annoying, as you don't even have access to your inventory or Blueprint library when you want to click the button, so you have to close the window, find the upgrade planner you want to use, open the window with the upgrade planner already in cursor, and then use it.
So this window was created. When you click the upgrade window, the game searches all the upgrade planners available to you (inventory and blueprint library) and lets you select which one to apply, and always offering the default upgrade planner.
[img]https://clan.cloudflare.steamstatic.com/images//12002589/23ef9a6157785caf1803be76a086a529f8880dc5.png[/img]
As you probably noticed from the picture, I couldn't restrain myself from adding a little feature. Upgrade planners can be now used both ways: as upgrade with left click and downgrade with right click. It obviously works also when upgrading in the world.
The problem is, that you can already do 3 different kind of things with the tool, and there are generally quite a lot of people that don't know about basic things you can do, like cancelling a deconstruction orders or force-building a blueprint. Because of that, we added instructions to every tool so the users won't miss it.
[img]https://clan.cloudflare.steamstatic.com/images//12002589/3da66cb8bc4fb66406a3cd880a889bd49699599c.png[/img]
[h3]Snapping[/h3]
This is a great example of a feature, that I expected to be done quickly and easily... but you know how it goes.
The first problem is related to build and drag. Most of the blueprints don't work that well when you just build and drag them.
https://cdn.factorio.com/assets/img/blog/fff-357-dragging-blueprint.mp4
The second problem is that blueprints are often designed to work in a grid, but there is no way to enforce it. Either you have to build slowly and cautiously, or you misclick often. And with the new feature of building in map, the problem was just elevated. This is what the second checkbox is for, it forces the blueprint to be built in a grid aligned to the map center. To ensure, that the user can configure individual blueprints in a way that they would match perfectly, the relative position of the blueprint to the grid can be configured by moving the red flag.
[img]https://clan.cloudflare.steamstatic.com/images//12002589/777da2485d6e8970bb2aee8fe735b9d2d6d67743.png[/img]
https://cdn.factorio.com/assets/img/blog/fff-357-blueprint-snapping.mp4
Thanks to Boskid, our beloved tester, a big pile of bugs had been already identified and fixed, so there is a chance of the BP library being released next week.
[h1]Story of the nuke (Dominik, Posila, Ernestas, V453000)[/h1]
Since more than a year ago Dominik has been updating and improving all kinds of visual effects in the game - particles, splashes, explosions and so on. During most of the time we’ve also been getting valid questions - "But what about the nuke?".
[img]https://clan.cloudflare.steamstatic.com/images//12002589/2facbc1f47c0fcb47b3da900958e8ff3f2d4adcc.png[/img]
It was the plan from the start that the explosion of the atomic bomb would come last. Not because it’s the lowest priority, quite the opposite - however it’s also by far the most challenging effect to create, both on the technical and graphical side, so we kept improving how particles/explosions work, and experimenting with graphics for effects - essentially practicing and preparing ground for the nuke.
The most major challenge visually is the sheer size of the explosion. Normal explosions already benefited greatly from more flexible and various scorch marks and particles, and improving the explosion sprites themselves, but that’s not enough here.
The atomic bomb has such a giant explosion radius that we simply cannot (mostly because of VRAM requirements) create an explosion sprite that would cover all of it.
https://cdn.factorio.com/assets/img/blog/fff-357-explosion-solo.mp4
We’ve tried to make an explosion as large as we could fit in a reasonable spritesheet, and limit its frame count as much as we could as well. Just like we did in the old days when VRAM was much more of a concern.
This mushroom cloud does not cover nearly enough though, so for sure some part of the effect needs to be procedural.
The VRAM is not the only problem though, the biggest challenge for the visuals is yet again the perspective of square tiles, where visually the game looks like the player is viewing it at 45° angle, but everything is presented as if viewed top down. Both of these things are intentional and graphics get the shorter end of the stick when it comes to compensating for this dichotomy ([url=https://www.factorio.com/blog/post/fff-133]FFF-133[/url]).
After discussing many really different approaches we could take, we decided to create a combination of a central spritesheet, with a shockwave of smokes being moved outward from the center.
https://cdn.factorio.com/assets/img/blog/fff-357-circular-damage.mp4
We tried to make graphics hide this perspective problem as always, and made the explosion move slower vertically, resulting in a visually correct ellipse.
As you can see in the animation above, this exposes the problem of entities dying in the vertical direction before the waves get to them.
So we made the damage apply slower in the vertical direction as well. This does mean you can minmax and run away vertically when shooting the atomic bomb under your feet and you will have a better chance of survival, but that shouldn’t be too much of an issue
We’ve also added a secondary damage radius, so it’s more forgiving if you’re just barely getting hit while running away.
https://cdn.factorio.com/assets/img/blog/fff-357-random-improved.mp4
For further improvement, we’ve added a ton of random elements to how the particles move and when they disappear which again makes the edge of the explosion less obvious, but also helps diminish the crescent-like shapes at the end.
The explosion is so large that even creating a scorch mark of an appropriate size for it is a problem, so Ernestas created a scorch mark as big as we could afford, and added a whole new tileset to the ground zero, with decoratives to smooth the edges out a bit.
[img]https://clan.cloudflare.steamstatic.com/images//12002589/bfd640dad7fc1233fa5502db0ff448e7f97ac201.png[/img]
The atomic explosion also destroys everything in a small radius at the center (killed entities don’t spawn corpses, decoratives are destroyed and cliffs disappear), which makes the explosion feel a lot more powerful and impactful.The nuclear tiles remain there forever and are visible from the map view as they have their own map colour, though you can place concrete over them to hide the evidence of your actions.
https://cdn.factorio.com/assets/img/blog/fff-357-final-nuke.mp4
To complete the effect, we’ve added a brief overbright of the whole screen based on how far the player’s screen is from the explosion, and added sound effects which also react to distance from the explosion.
You will be able to enjoy becoming death, the destroyers of worlds, in the new fashion on 14th August, in 1.0.