- Joined
- Aug 23, 2016
- Messages
- 758
- Reaction score
- 129
My sincere apologies if I'm suggesting something that's actually already implemented...
I'm an engineer who designs (ocean) ships by day, and my (perhaps woefully incorrect) understanding is that rate of rotation in StarMade is a function of mass and length, but doesn't actually use moments of inertia?
Calculating it is simple, you just take the mass of each block, and multiply it by the distance squared from the centre of mass. You'd only need to do this once every time the ship is altered, and you can store the total values for each of the three axes of rotation. Three numbers per ship.
Simple, computationally cheap, and tiny amounts of data, for a very nice, realistic effect.
What rotational inertia means is that if we compare two ships with identical length, mass, centre of mass location, and number of blocks, but one has most of its mass at its ends and is very light in the middle (like a dumbell), while the other has almost all of its mass in the centre close to the centre of mass and is very light at the ends (cut the dumbell in half, and glue the heavy ends of each half together) , the second ship will turn and stop turning much faster/easier than the first.
This is how real spaceships (and everything else) actually behave.
EDIT: To be clear, this suggestion is nothing to do with rotation continuing after the player lifts their finger off the button. It's simply about calculating how fast a ship should turn. The current system can be made better, to match real life, at very, very little cost or complexity.
EDIT 2: Already suggested here in a post that someone has put more effort into than I put into this one: Brainstorm This - Perfect turning system - no half-assed solution
EDIT 3: I just reviewed what I wrote in post #24, and spotted the gigantic, neon-framed mistake in it. I think perhaps the theme of the error was what caused some concerns throughout the thread, that I ignored. My genuine apologies for that. I've updated that post.
The issue is: for destroyed blocks in battle it would be necessary to calculate the change for each individual block (I incorrectly said it wouldn't)
I don't believe that would cause a performance decrease anyway, but in the name of compromise and settling the fears of anyone who disagrees on that point, I suggest:
Undamaged ships would still be using perfect calculations, and damaged ships would (typically) still calculate results that would be very close to perfect. This would result in behaviour far superior to any system that ignores rotational inertia.
I'm an engineer who designs (ocean) ships by day, and my (perhaps woefully incorrect) understanding is that rate of rotation in StarMade is a function of mass and length, but doesn't actually use moments of inertia?
Calculating it is simple, you just take the mass of each block, and multiply it by the distance squared from the centre of mass. You'd only need to do this once every time the ship is altered, and you can store the total values for each of the three axes of rotation. Three numbers per ship.
Simple, computationally cheap, and tiny amounts of data, for a very nice, realistic effect.
What rotational inertia means is that if we compare two ships with identical length, mass, centre of mass location, and number of blocks, but one has most of its mass at its ends and is very light in the middle (like a dumbell), while the other has almost all of its mass in the centre close to the centre of mass and is very light at the ends (cut the dumbell in half, and glue the heavy ends of each half together) , the second ship will turn and stop turning much faster/easier than the first.
This is how real spaceships (and everything else) actually behave.
EDIT: To be clear, this suggestion is nothing to do with rotation continuing after the player lifts their finger off the button. It's simply about calculating how fast a ship should turn. The current system can be made better, to match real life, at very, very little cost or complexity.
EDIT 2: Already suggested here in a post that someone has put more effort into than I put into this one: Brainstorm This - Perfect turning system - no half-assed solution
EDIT 3: I just reviewed what I wrote in post #24, and spotted the gigantic, neon-framed mistake in it. I think perhaps the theme of the error was what caused some concerns throughout the thread, that I ignored. My genuine apologies for that. I've updated that post.
The issue is: for destroyed blocks in battle it would be necessary to calculate the change for each individual block (I incorrectly said it wouldn't)
I don't believe that would cause a performance decrease anyway, but in the name of compromise and settling the fears of anyone who disagrees on that point, I suggest:
- that when I is recalculated for damaged (and only damaged) ships that only the change in mass is accounted for, and the location of that lost mass is ignored.
- So when undamaged, I = [undamaged mass] * [undamaged sum of squared distances from CoM]
- And when damaged, I = [damaged mass] * [undamaged sum of squared distances from CoM]
Undamaged ships would still be using perfect calculations, and damaged ships would (typically) still calculate results that would be very close to perfect. This would result in behaviour far superior to any system that ignores rotational inertia.
Last edited: