Mythruna
March 28, 2024, 07:27:00 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Physics - some final decisions and compromises  (Read 7129 times)
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« on: December 15, 2019, 03:25:43 AM »

So, it seems like I only post these once a year at this rate.

Over the summer I had to come to some hard choices about the physics engine.  Try as I might, I just couldn't get dynamic object->object joints working in a way that would ultimately be useful.  After some soul searching, I decided to cut this feature from the engine and stop wasting time on it.  Maybe someday, I'll be able to swap out the physics core with something more robust and we'll see some improvements there... but in the mean time, I had to look in other directions.

One feature that I'd been putting off was object/shape hierarchies.  This is the ability to glue multiple objects together into some configuration and have them all be treated as the same object for the physics engine.  In the back of my mind, I was 100% sure I would need this feature for attaching things... even if it was just attaching objects to sailing ships and stuff.  I had sort of hoped that I could put it off and maybe the dynamic joints would allow me to do something similar.  When dynamic joints didn't work, I turned back to implementing proper object hierarchies... with an eye on being able to animate the relationships.

Being able to animate the relationships was important because even if I couldn't make a dynamic treasure chest with working physics hinges, I could at least glue the top to the bottom and make the opening/closing of the top an animation.  Allowing users to create their own objects that can still work in the world is a critical feature to me.  Animated joints was going to be a compromise to allow that to happen.

Implementing this took the better part of the summer and finally all of Thanksgiving week to work through the last of the issues.  Keeping track of the center of mass of all of the parts, their orientation to one another, relative coordinate spaces, etc... is quite tricky to debug when something goes wrong.

You can see a video of some of the failures and successes here:
https://www.youtube.com/watch?v=WyKdBM2Bqvc

At this point, I'm ready to declare a sort of 'victory' and make some lasting decisions about what will/won't be in the Mythruna physics engine.
1) Craftable giant objects like sailing ships and blimps, etc.: Yes, definitely.
2) Craftable objects that can be configured with animated hinges: Yes
3) Craftable objects that can be configured with dynamic physics joints: No
4) Craftable objects that can be attached to the world with physics joints: Probably, with some restrictions. (maybe for doors, swings, etc.)
5) Craftable objects that can be attached to the world with animated hinges: Yes  (Doors, draw bridges, ferris wheels, etc.)

Open questions for another time:
A) dynamic physics based combat. This is not really a problem for the physics engine but it touches on it so I'll mention it.  The biggest open question here is whether I can implement just enough inverse kinematics to make this work without killing performance.  It would have been nice to use dynamic joints for the person->weapon link but it's not 100% required.  Note: either way, whether dynamic or animated, I'm still 90% sure that I can base weapon damage on the physics collision and thus crafting becomes important.  It's just that weapon balance will be much less important.
B) wires and pulleys.  Pretty sure that I can't do this without some kind of dynamic joint... but we'll see later.
C) object and water interaction.  There are a dozen water problems to solve/explore and this is at the heart of it all.  Flowing water is a much simpler problem until you allow users to block it with crafted physics objects.  There's also the probably about what to do about boats and other vehicles displacing water.

This last one leads to what will probably be my next area of exploration: water physics.

I have plenty of ideas but they all need testing as there is some significant 'risk' associated with each approach.  My current number one idea is very intriguing because it might be able to handle vehicle displacement.

In the end, I suspect some things to work and some things will not work... and I'll have to come to some similar hard decisions about features.  Hopefully that won't take me until next December.  Also, there is no way that it's going to be as much of a huge time suck as physics has been.  So much of the physics engine has required large chunks of dedicated time.  It usually takes me 2-3 days just to get my head back into it.  Water shouldn't be like that.  There is no math on the fringe of my understanding... just technological limitations that must be managed and clever ways to work around those limitations.  It's a great "ideas while taking a shower" time.

I will be off from my "day job" from December 20th to January 2nd and plan to devote as much time as possible to Mythruna/MOSS development.

Keep an eye on my twitter feeds if you want to get the most current updates on where I am.
https://twitter.com/Simsilica
https://twitter.com/MythrunaGame

The simsilica feed is the most active because it includes everything I do gaming related... not just direct Mythruna stuff.  (And I always retweet MythrunaGame tweets from Simsilica anyway so you won't miss anything if you just watch that one.  I mean, obviously you should follow both. Smiley )
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!