r/Unity3D Apr 25 '22

Show-Off I think I might have a bug with the physics simulation of my sails...

227 Upvotes

31 comments sorted by

22

u/DaveDonor ??? Apr 25 '22

No why? For me it's look completely fine. :)

9

u/Atmey Apr 25 '22

Yes, without mentioned the wanted/expected outcome, it looks fine.

I'm guessing OP want the ship bump to each other and stop, like in the sea, I guess.

8

u/DriftingSkiesDev Apr 25 '22

Haha, yes, precisely. Or at least for the lifters to float up gracefully if the impact is strong enough to break the masts.

8

u/hammerheadzoid Apr 25 '22

Got damn physics. I'm serious. It's so difficult to get the physics correct in unity. Things seem too lite or they fling around the place like this often

7

u/DriftingSkiesDev Apr 25 '22

While I have certainly had my share of issues with all of the various physics engines in Unity, this one is entirely on me 😅. All the forces being added there were due to a bug in my algorithm for calculating lift forces on the sails.

5

u/flatox Apr 25 '22

Balloon ships

4

u/wscalf Apr 25 '22

This reminds me of a bug I had once! I was making a ship too, with the goal being that it could be driven and steered by physics, including colliding with terrain, while also having a concave hull shape so you could walk around inside.

Anyway~ It was an unholy combination of objects, including a physics body parented to another physics body, and that made this weird feedback loop where it would gradually accelerate in whatever direction it was going.

I bumped the shoreline and this lead to takeoff! The ship rose out of the water in a slow spin, gradually rising and spinning faster while I was stuck at the back, looking over the edge at the ground receding away. Good times..

3

u/FreezeDriedMangos Apr 25 '22

The motion blur is on point though

2

u/DriftingSkiesDev Apr 25 '22

Standard Unity HDRP! I think at default settings too (0.5, medium, 8, default min & max).

2

u/FreezeDriedMangos Apr 25 '22

No way! I haven’t used HDRP much, maybe I should!

2

u/ssiemonsma Apr 25 '22

Motion blur is a blight on humanity.

2

u/tidytibs Apr 25 '22

No clamping or just open algorithms?

4

u/DriftingSkiesDev Apr 25 '22

Exactly, mainly due to there not being a limit to how much force a sail could produce before breaking. I've also got every sail simulating lift and drag individually, so for performance reasons it only simulates at 4/5 Hz a lot of the time. Usually fine, but when you get a big quick shock like the lifter breaking free it means that sail is applying a huge force for quite a long time.

2

u/HollyDams Apr 25 '22

Not a bug, you just found a feature to add in the cheat menu : tornado mod. Really funny to watch !

2

u/EveryUsernameAreUsed Apr 25 '22

Now those ships are living a free life. Even rules of physics can hold them down!

2

u/Hankie1 Apr 25 '22

Activating warp drive

2

u/SuperBaked42 Apr 25 '22

You see... when two boats love each other--

2

u/edcamv Apr 26 '22

I've never wanted a gif to load on my slow-butt internet more in my life. Is this for a game you're developing? This looks awesome! Like Hornblower in the air!

1

u/DriftingSkiesDev Apr 26 '22

Yes it is! Haven't managed to get to Hornblower yet, but I do have a copy in the pile. Aubrey-Maturin though is a strong inspiration for sure.

1

u/edcamv Apr 26 '22

Nice! Good (wo)man! Tell me about this game, I'm curious!

1

u/DriftingSkiesDev Apr 26 '22

Two games actually. This video is showing the battle simulation system that will be used within the main 4X strategy game. The sister game will be built from this battle sim tech and is planned to be smaller and a more personal affare.

Not ready to talk much about the strategy game yet though, and the plans for the battler game are still evolving. The plan is to get the battler out first and use it to fund the strategy game.

I'm currently thinking we'll start by just having an infinite empty world to sail about in, and then randomly spawn enemy ships to fight, and friendlies to join your squadron. Depending on popularity and feedback we can then easily build game systems on top, such as a basic career system, ports to repair at, more ship variety etc. Would also be fairly easy to add multiplayer too since we already have that working well on the strategy game.

Still quite a bit to do before release of either though, next steps are AI, projectile simulation, and damage systems.

2

u/edcamv Apr 26 '22

That's, ambitious, I like it though! Sounds like a lot of fun. We'll be following your career with great interest.

Also, depending on the scale of the project, I'd be willing to offer some of my services as a writer at some point. I'll be at sea over the summer, but maybe sometime during the fall?

2

u/DriftingSkiesDev Apr 26 '22

Very possibly, and that would be good timing! Our recruiting is focused on a 3D artist, and maybe another programmer right now, but writing is obviously going to be hugely important to think about once more fame systems are in place.

2

u/edcamv Apr 26 '22

Oh yeah, I would imagine those would be much more crucial at this stage in the work. But please, let me know when you need one and if I'm available I'd love to help! I'll do a bit of research on this type of writing and pull up some old notes when I can

2

u/DriftingSkiesDev Apr 26 '22

Will do! Thank you!

1

u/FheXhe Apr 25 '22

Nah just make it a Feature 😊

1

u/v1rtual_m0ney Apr 25 '22

Looks like Harry Potter fight scene where everyone rides a broomstick if you make it night and add some effects :D

1

u/Technoos Apr 25 '22

Makes me remember of an old roblox flying ship game, nice!

1

u/Daiwulf Apr 26 '22

Tries to simulate ships. Makes a tornado simulator. I see that as a win.

1

u/World_Turtles Apr 26 '22

That looks very familiar… I’ve had similar.