Friday Facts #383 - Super force building

Posted by kovarex, Klonan on 2023-11-03

Hello, welcome, take a seat...

Update from last time

The tile building animation showcased in the previous FFF is now integrated in the game, and this is how it looks:

Of course being in the engine doesn't mean it's completely done. It is still quite WIP and we have things we would like to improve with it, but showing a bit of progress week-by-week is also part of the fun.

Super force buildingkovarex

In the recent FFF-380 we talked about the possibility of building ghost entities on the top of ghost tiles, so you don't have to wait until landfill or space platform tiles are finished to build on top of them.

This is nice, but this obviously was just a preparation for the main feature we all missed so much, the super forced building.

CTRL + SHIFT + CLICK = Super forced building

In the beginning, we had just the normal way to build blueprints, and anything in the way blocked the blueprint from being built.
Soon after, we realized that we need an automated way to get rid of all the trees, rocks, and cliffs in the way, so we added the forced build mode (shift + click by default) to do that.

Since that time, it happened frequently here and there, that we felt it still isn't enough. Space platform building was the last push where we just couldn't ignore this anymore and had to implement it. With landfill, it is an occasional problem as water is not everywhere, but with space platform building, it is always a problem.

Once we already had the super forced building mode, it was natural to include the other properties of it.
The mindset behind super force building, is that you want to force the full blueprint no matter what, like building rails through a solar field, so this is how we made it behave.

Super force building will mark anything in the way for deconstruction.

Manual super forced building

We were only speaking about blueprints up to this point, but once the super force building worked its way into our muscle memory, we started to try to use it when building entities manually. It is similar to how you can build ghosts manually with the shift modifier, and get rid of trees in the way automatically.

So we added the super force building as a direct build shortcut, not just a specialized blueprint building modifier.

Belt interaction

Once we got used to this, there was a pattern that started to emerge. We would super force build over belts, and then have to manually fix them right after.

If you are a regular reader, you know that the word manually is always an indication of change.

Super force building over belts automatically places undergrounds

Mining landfillKlonan

Landfill has always been a little bit tricky. As it stands it kinda breaks a fundamental symmetry in the base building, in that everything you build can be unbuilt, any mistake erased without judgement. But with landfill, one wrong click and it's there forever.

It has long been on our wishlist to make mining landfill work, but the code and logic around tile building and mining were not set up effectively for it. One major problem is that tile placement/removal would instantly and uncompromisingly destroy or kill anything that was colliding with it when it was changed. Additionally, mining landfill is a specific case, but making the system generalized for all combinations of placing and mining tiles with varying collision masks (for example a placeable water mod) would involve touching a lot of systems (building, mining, blueprints, upgrades, deconstruction).

With the super force building, the problem of 'no way back' when building landfill was even more dangerous and liable to misclicks, so we knew we had to make mining landfill happen.

Through hard work and dedication, Roman was able to clean up all the tile building and mining code, handle all the cases of collisions between entities and tiles, and make it work in a really nice and intuitive way. You can even see some evidence of the groundwork for this back in the 1.1.50 release (December 2021), where we added the TilePrototype 'check_collision_with_entities' property.

You can notice that the landfill underneath the player wasn't marked for deconstruction. In general, landfill can't be mined if there is something on top, but typically entities on top (machines, furnaces, belts etc.) will also be marked for deconstruction anyway, so they will be removed and allow the landfill to be mined.

And with the new super force building, it is only natural that we make the interaction with landfill work in the opposite direction.

These both put together make stamping down steam engine or reactor setups so much nicer and less worrisome.

As always, super force your thoughts to us at the usual places.