• Register
Post news Report RSS New Physics Overhaul & Embracing Rust

A complete physics overhaul is coming to Assembly RTS! Assembly RTS will be a physics-based online strategy game with unit customization!

Posted by on

Hey everyone and welcome to another devlog for Assembly RTS, the physics-based real-time strategy game.


0 2 1 1

Guess what? You know that tricky bug I mentioned last time that seemed to put a pause on things?
(The one that caused desync and made multiplayer completely unplayable)
Turns out it's been lurking around for quite a bit longer than I realized! It's like a plot twist in our dev journey. 😅

Tracking down such a sneaky issue was a huge challenge. I won't lie, there were moments when I wondered if I'd solve this mystery. But, as always, a little distance does wonders!

A Refreshing Detour

After about two weeks of trying to track down the bug I decided to take some time off from Assembly RTS.
But that doesn't mean I wasn't productive! I worked on a racing game instead! 🏎️

This detour not only provided a refreshing break but also introduced me to some new game engines and art styles: As for the engines, Unreal's Chaos Vehicles caught my eye and its Blueprint system was a great change of pace. Armory3D as well, directly integrated into Blender, was intriguing. But in the end, good ol' Unity offered the best productivity.

This is a race track I was working on in Blender and Aseprite. Can you guess which game it's inspired by? 👀

strwinclt 3yHoTc5bzj

strwinclt jAYspTLzjP

The Real Culprit: The Physics Engine

Returning to Assembly RTS, I felt rejuvenated and ready to tackle anything! I had an inkling about the physics simulation, and lo and behold, that was the sneaky culprit. Knowing what was causing the problem all along was a HUGE relief. 🎉

Transitioning to 2D Physics with Rust

Rolling back to an earlier version of my modified version of Unity's physics engine wouldn't have necessarily solved the issue. So instead of rolling back versions or patching things up, I adopted a novel approach:

Integrating a physics simulation written in Rust (Rapier2D) into Assembly RTS.
First, I tested if the performance would even be acceptable by running a simple physics simulation inside of a Rust application:

It ran great! 👀

physics test 2


Afterwards, making a bridge between Unity (C#) and this Rust library was surprisingly smooth. And guess what? The performance is stellar! Even better than my old 3D physics solution. And that is even though it's running solely on a single thread!

2D Physics? Why the Change?

You might wonder why I chose a 2D simulation over 3D. The answer? Simplicity and efficiency. It's easier to integrate with Unity and honestly, I've always felt the 3D approach was a tad overkill for my needs. But no worries! For that added visual pizzazz, I’ll still use Unity's non-deterministic 3D physics, but in a more controlled manner. Hopefully, it'll all be so seamless that you won't even notice most of the action is in 2D.

Progress and Rust

I'm thrilled to share that the vehicles are now cruising around, reacting to move orders as they did before, but now using Rapier2D under the hood!

The friction still needs some adjusting 👀



The transition wasn't just about 2D physics. Learning Rust has been a valuable experience and the programming language has proven to be a formidable ally, offering speed, memory safety, and an awesome package manager. I'll definitely keep Rust in mind for future projects!

YouTube

While I've been deeply immersed in Assembly RTS's development, I'm keen to return to my YouTube devlogs.
Drop your thoughts in the comments below! Would insights from this post make for engaging video content? Let me know what kind of topics would interest you!

Looking Ahead

It's been a challenging ride these past weeks: uncovering sneaky bugs, venturing into new territories with Rust, and redefining the game's physics foundation. Thanks for coming on this journey with me. To keep tabs on Assembly RTS, just hit that follow button, here on IndieDB:



Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: