With the recent news that Crafting is coming to Co-op in TerraTech we thought it would be insightful to host a Q&A on the TerraTech Discord with Django, the programmer tasked with making Co-op Crafting a thing. And so, for posterity’s sake, we’ve got the whole Q&A for you here too:
Q: How much time did it take and what were the major problems were encountered and their solutions when making Co-op Crafting?
A: First up, thanks for your question! Getting crafting to behave in MP was definitely a big chunk of work, but I’m happy to say some parts were slightly less painful than expected!
Crafting as you know has a lot of moving parts, from the resources bobbing along, to the intricacies of the crafting machines themselves, to the animations, particles and sfx. This means there’s a lot of work to get this all working nicely across the network. It really doesn’t help that TT was written to use Unity’s UNet networking layer, which unfortunately just isn’t very good. So much so that Unity have officially deprecated it and removed it from the newer versions of Unity. Sadly that doesn’t help us (in fact it’s one of the reasons upgrading the engine is problematic), and it means writing each networked replication requires a lot of careful manual balancing.
Replacing the whole network layer would be a huge undertaking, so instead I’ve added several strategic wrapper API’s to take care of the grunt work which made implementing things later much easier.
The biggest hurdle still is simply the amount of moving objects in the crafting system, as it generates a lot of network traffic. Currently we’re (still) trying to balance lower network traffic vs desync, hoping to find a happy medium.
Q: Will crafting remain physics-based, or are you planning on using a completely different system for it?
A: Physics based crafting is a bit of a double edges sword in that it has quite a high performance cost, but it also brings a lot of character and options for player creativity to TerraTech. We’ll keep resource ‘holding’ a thing as it is, though the idea of ‘virtual’ conveyors as an option is something we might play with in the future.
Q: Is co op crafting development going well or not?
A: Thank you, development is going well with all the major interactions working as expected. We’re in the later phases of fixing desync issues and small bugs; most of which have to do with (network) performance.
Q: do you think making crafting compatible with multiplayer was worth it? also whats next for the future of terratech?
A:Definitely. It’s a big part of the TT experience and having it missing from MP just didn’t feel right. It’s been a giant bugbear for a long time, and I’m glad we finally managed to tackle it.
As for the future, I think I can tell you that we’re aiming to bring a set of QoL changes to the game in the near future. I’m personally really excited about seeing our upcoming C&S blocks integrate with the game, and see how players enhance their contraptions with it. We’ve also started work on future update content, but that needs a bit more time before we’re ready to tell you about 🙂
Q: Will the usage of world capacity of certain blocks on console editions ever get fixed?
For example: The RR 2x2x1 block needs 1 unit and the GC 2x2x1 needs 10. Also why don’t GC Boss and Overlord Cab use 10 like other cabs without animations/wheels/weapons?
A: This could be a bug where the values for these blocks haven’t been updated as they should be, or there is an element of hidden complexity on some of these blocks. In general, the world capacity is a complex, necessary evil required to provide a smooth play experience on consoles. And this might just be an issue that slipped through the net. Thank you for pointing it out!
Q: does payload studios plan to address the fact that terratech only uses one core, and suffers heavily performance wise because of it?
A: That’s a great question though I’ll try to keep it short so I still have time to answer other questions.
It’s a common misconception, but TT does use multiple cores, it’s just that a lot is centred around the main thread.
The Unity engine relies heavily on the main thread (single core) for manipulating any native object. The main bottleneck in TT is the high number of objects (blocks, resources) with their physical nature. Everythingis physics, which is what makes TT such a fun sandbox to play around in, but it’s also why it uses up so much CPU time.
The core of the game/engine will always be limited by needing to access the UnityObjects, but we do our best to distribute performance where possible. Heavy things such as the wheel calculations and terrain generation already happen on separate threads, as well as many smaller things. The latest addition is the generation of the Minimap images which is done entirely async.
We have plans to look at some older systems to see if it’s worth re-writing them for increased performance, but they run the risk of being a lot of work for only 1-2fps improvement, so we want to make sure it will be worth it; otherwise we’d much rather give players more features/bugfixes/QoL.
Q: Will the forgotten game modes (Sumo/Gauntlet/Deathmatch) ever receive any modernization or new content? They all have potential to be great fun if given enough love.
A: Ha! We still test the modes when we make changes, but sadly they don’t receive much attention from us or players. They were fun experiments in the early days of the game, but over time we’ve focussed more on an experience closer to what is on offer in Campaign. I personally would love to give Sumo a revamp, but it would come at the cost of other features so it’s a difficult balancing act. Who knows?!
Q: will you be adding an oceans to the game with aquatic blocks?
A: From a technical standpoint, I’m concerned that adding buoyancy physics might put a high strain on our performance budget, which means spending even more time on “tech stuff” and less time on “cool stuff”. I also think before we add water there is a lot of cool stuff we could do to make flying/space more interesting, but we do try to make what the community wants as well, so how about a couple years of ‘water when?’
Q: Can the block reservation system for inventory be extended to handle arbitrary amounts of an arbitrary number of items please?
A: I’m not entirely sure what system you’re referring to, but I suspect it’s the one in MP that flags a block for use by one of the clients without actually consuming it. Having just looked at the code it doesn’t seem too entangled with other systems, so maybe? I’m guessing there’s a mod use-case for this as we don’t currently need it in the base game.
So there you have it! Thanks to all the Discord users who submitted questions, and thanks to Django for taking the time to answer them. Hopefully this gave you some insight into how we do things in TerraTech. We will definitely be doing more of these in the future so stay tuned for for more info!