Replace simple width-based drag by asteroid chunk collision drag

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Erichteia
Inserter
Inserter
Posts: 24
Joined: Mon Jun 17, 2024 12:10 pm
Contact:

Replace simple width-based drag by asteroid chunk collision drag

Post by Erichteia »

TL;DR
Make space ship drag based on asteroid chunk collisions instead of drag
What?
The acceleration code consists of 2 main factors: the thrust-based factor and the drag-based factor. The complete formula boils down to (thrust-drag)/weight. The thrust computation is fine, no changes needed here. But I'd change the drag computation. I propose the following drag formula (to be balanced)

Code: Select all

drag = sqrt((m_ship*v_ship^2-m_out*(v_ship-v_throw)^2)/(m_ship+m_in-m_out))-v_ship,
with v_ship>0 the speed of the ship, m_ship the mass of the ship, m_in = m_asteroid*N_in the total mass of all asteroids colliding/caught by grabbers last tick, m_out the total mass of all asteroids and other stuff thrown out of the ship (optionally only count items thrown out of the back side) and v_throw the relative speed at which and inserter can throw an asteroid (maybe based on inserter rotation speed and arm length, but it can easily be balanced).

In essence, this creates a drag that is caused by the collision with asteroids, rather than the imaginary aether that is currently present. I used the correct physics-based formula to compute the difference in speed, but the formula can be tweaked where needed to get it working and balanced in game. At first sight, it does roughly the same as before: the wider your ship is or the faster it flies, the more it collides with asteroids, the more drag you get. And if you fly faster, the slow down is also larger, giving it both a linear and a squared relation to speed (similar to the current formula). But there are a few nice extras:
  • The ship slows down automatically as the asteroid density increases. This doubles as the beginner-friendly system that avoids ships from just crashing into asteroid fields head-first. Especially useful as an automatic throttle once you reach denser parts of space.
  • You give more design options to the player: they can just take the drag as is (which makes sense for massive haulers where speed is not important), or they can actively catch and throw out asteroids, even if they don't need them, to achieve maximal velocity. Not necessary for normal gameplay, but makes the design challenge for speed competitions more interesting.
  • When v_throw>v_ship, you get a fun gimmick where a ship can throw out asteroids faster than they come in, accelerating the ship more than an incoming asteroid slows it down. This enables asteroid-powered space ships with v_throw as their max speed.
  • Redundant items can serve a final purpose by giving your ship just a little more oumph
  • In very desperate conditions, you can push your ship a bit further by throwing out parts of the inventory/ship. Not a core mechanic, but funny nonetheless.
  • (It obeys the laws of physics, which may be a bit more intuitive)
Why?
Drag is necessary for ships in SA to prevent them from reaching arbitrarily large speeds and turning in a pile of dust when not controlled with circuits. But the current width-based formula feels weirdly arbitrary, unintuitive and a bit restrictive. Although wide ships look incredible, they are punished twice: more defences needed and more fuel required to maintain a fixed velocity. With this proposal, you enable systems to 'bypass' the drag system partially for experienced players, while keeping the save guards there for beginners. And I just think powering a ship based on yeeting asteroids sounds hilarious.
Milichip
Inserter
Inserter
Posts: 37
Joined: Thu Jan 30, 2025 11:51 pm
Contact:

Re: Replace simple width-based drag by asteroid chunk collision drag

Post by Milichip »

I like the overall idea too, though I would have to see what the implementation details are like to fully endorse it.

Another cool piggyback idea off this tho: shooting bullets/rockets/etc (but not lasers) slows down the ship on top of the collisions - a ship twice as big would shoot twice as much, however it would also have twice the mass so the slowdown would be more or less equal. This would be another excuse to have a constant drag coefficient that cannot be worked around, on top of the proposed asteroid chunk collision which could potentially be completely negated.

Also important to note: there will be a max speed cap between planets anyway simply due to the fact that the ship takes time to accelerate and decelerate, however this matters most for the shattered planet where the inertia of the ship could build up really fast. Perhaps after a certain (ridiculous) speed threshold is reached, even small chunks become a threat.
mmmPI
Smart Inserter
Smart Inserter
Posts: 4035
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Replace simple width-based drag by asteroid chunk collision drag

Post by mmmPI »

i fail to see how the proposition is less "arbitrary" than the current one.

Besides if you consider all the collision between asteroid chunk that aren't collected, or the dust that would be present in space, the drag makes perfect sense
Post Reply

Return to “Ideas and Suggestions”