Hey everyone! Alpha 18 has been on unstable for a couple of days now, and we’d love to hear how it’s treating you. It’s most notable feature is the grand return of Building Removal, which we cover in depth in today’s Desktop Tuesday. While Chris was busy with that, the rest of the team continues to work on far-reaching projects like performance (a giant bucket that includes investigating lua optimizations, AI benchmarking, memory footprint reduction, and pathfinding tuning) and high-level artistic concepting. But enough of that!
On to explosions.
Exploding Buildings
Recap of the video:
- Building removal has been disabled in the UI for a couple of Alphas now. We’re very sorry about this, and we wanted to fix it in Alpha 18!
- So why was building removal, removed? Two reasons: One, it was very buggy, and two, it took foreeeeehhhhvvveeerrrrrr
- It was buggy because removing a building was essentially building a building in reverse: hearthlings put up scaffolding and ladders and and hammered at blocks to remove them. Removal was just as buggy as construction, and as buildings got more complex, it started to fail more and more often, and this was incredibly frustrating. There’s really nothing worse than desperately wanting your hearthlings to do something that looks simple (even if it isn’t) and then watch them just stand around doing nothing.
- Now that building has been dramatically improved, destruction should be much better as well. However, it still takes forever. Giant castles can take months to go up–should they really take months to go down? It makes sense to have to wait for something amazing to be built, but if you just want something gone b/c it’s in the wrong place or because you don’t like the way it looks, it seems unnecessarily frustrating to spend hearthling cycles on removal. I’m sure there’s other things you’d much rather they be doing!
- Chris decided that to fix this problem, we should just blow everything up for removal.
- Here’s how it works: after you hit the destroy button, we take all the pieces of the building, and “chunk” them even further, making sure we have a maximum size of each piece of the existing building.
- Large roofs, walls, bridges, etc, get split up into smaller segments.
- Then we swap out the actual model for the building structure for the new chunks, apply a little gravity and rotational-acceleration, and let them fall. There’s no collision with the ground (yet), so it’s a very simple effect, but especially on larger structures, it looks quite pleasing.
- For items placed in the walls, or on floors, we turn them back into their ‘iconic’ versions, and then just let gravity do its thing.
- You get back all your items when the dust settles, but only 70% of the resources that went into the actual construction.
- So… what happens to the hearthlings? Originally, we thought it would be cool to write some AI to get all the people to evacuate the building upon removal. However, we weren’t sure how long this would take them and if you the player would still be watching as their pathfinder attempted to evacuate them. And what would happen if someone couldn’t make it out in time? So for now, people are unharmed by building destruction.
- We worked through some unfortunate bugs in which people were sleeping in beds on second floors of buildings, and then just got trapped up there forever after their beds got blown up from under them. Now everyone just lands safely on the floor.
- There’s a few more things we’re considering adding to this feature, for example, some fancier VFX for the explosion, or better hearthling reactions on discovering that their building is about to explode.
- In a future alpha, we may also consider making this kind of speedy building removal the function of a higher level class: smaller, earlier structures would still have to be removed by hand. What do you think?
Btw, many thanks to @mindemann for the castle. It doesn’t quite build yet, but man we’re learning a ton every time we use it for something!
Other Announcements
Streams will happen this week as usual!
As we go into A19 planning, we have some questions for you. Aside from the usual big items (Mac, PC, Multiplayer), what could we add to Stonehearth that would most improve your enjoyment of the game? Let us know!