Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gravity overhaul #110

Open
CaptainMegavolt opened this issue Oct 31, 2015 · 7 comments
Open

Gravity overhaul #110

CaptainMegavolt opened this issue Oct 31, 2015 · 7 comments

Comments

@CaptainMegavolt
Copy link

I had an idea regarding gravity in space: Have gravity function such that entities in space will move in whatever direction their last momentum was (so for example thrown items will fly in the direction they were thrown), that is until they reach a gravity well. Gravity wells are caused by large concentrations of blocks. The more blocks, the larger and stronger the gravity well will be. Any entity entering a gravity well will slowly begin to move towards the source of the gravity well, at a speed dictated by A: The entity's proximity to the source of the well, and B: The strength of the well (dictated by the amount of blocks in its source). This means spaceships do not automatically have gravity. For a ship to have gravity, it must be added with a Gravity Adjuster block. This block uses electricity to generate a localized gravity field. Like everything else in WarpDrive, it is controlled with a CC or OC computer. You can use the computer to dictate the direction of the gravity (up, down, left, right, or whatever), the strength of the gravity, and the size of the gravity field (configured much like how you configure the dimensions of your ship). The Gravity Adjuster consumes energy based upon the size of the gravity field and the difference between the dimension the Gravity Adjuster is in's normal gravity and the gravity field it is emitting (so for example, if the Gravity Adjuster were in the Overworld generating a null gravity zone of 5x5x5 meters, it would consume energy for the 5x5x5 size of the field, and for the gravity adjustment which is changing the gravity from Overworld norm to null gravity). And yes, the Gravity Adjuster works in any dimension.

@LemADEC LemADEC changed the title Idea: Improved gravity mechanics and gravity generators? Gravity overhaul Oct 31, 2015
@LemADEC LemADEC added this to the Tentative milestone Oct 31, 2015
@LemADEC
Copy link
Owner

LemADEC commented Oct 31, 2015

This is fairly expensive computation wise and assume we've realistic environment which far from true here (moons are way too small and let's not talk about planet or suns).

@LemADEC
Copy link
Owner

LemADEC commented Oct 31, 2015

For the record, the WarpDrive gravity was the first to actually simulate momentum in space and gravity relative to environment.

@CaptainMegavolt
Copy link
Author

I know, I just figured it might be possible to have some fairly simple system for causing entities to gravitate towards the nearest large cluster of blocks from any direction. I admit the gravity generator is a little farfetched though. And yes, the momentum physics are already quite good, don't intent to criticize or alter those at all.

@LemADEC
Copy link
Owner

LemADEC commented Oct 31, 2015

gotcha

@LemADEC LemADEC modified the milestones: Not planned, Tentative Apr 12, 2016
@LemADEC
Copy link
Owner

LemADEC commented Aug 15, 2017

Gravity can now be adjusted per celestial object (dimension).
Proximity fields will come later.

@LemADEC
Copy link
Owner

LemADEC commented Apr 24, 2019

Currently, space boots are considered magnetic, vertical only, towards any full block (including stone).
Here are a gameplay aspects to consider:

  • a free full rotation of the player causes motion sickness.
    => We need a visual reference in the surrounding (planets in distance for example).
    => Most players will require a quick/permanent stabilization method to return to a 'heads up' position.
  • artificial gravity is a pure lore thing. There's no scientific knowledge allowing such a thing to happen without a supersized or very fast rotation of the ship, or having a big earth sized chunk of blocks below the ship. On the other end, faster than light technology implies, at least indirectly, changing gravity way beyond earth like levels.
  • Star Trek refers to 'hull plating' as the powered source of gravity. Stargate & StarWars lore just ignores it. Babylon5 loosely refers to rotation and skip it most frequently.
  • games frequently refers to a Gravity generator (Space engineers, Empyrion, etc.).
  • it's interesting to amplify decay gravity over distance (free floating area at the crossing of fields, etc.)
  • it's tempting to amplify the gravity effect of an asteroid, but it can quickly be confusing & frustrating for players that bounce in an asteroid field.
    => player need to visualize the gravity field (HUD?)
    => player need a ways to navigate/counter it.

Coding wise, we also need to consider:

  • regarding decay over distance, there's a strong need to cache the gravity source and synchronize it with clients.
  • It can quickly consume CPU to update the cache every tick when mining a moon for example.
  • vanilla/mods assume entities are walking/landing on the top of the block, not a side. Fall damage for example.

@elijahlorden
Copy link

Free rotation could be very problematic, and unnecessary considering ships would likely not be able to freely rotate (many modded multiblocks can only 'rotate' on the Y axis, for example).

As for caching, it might be better to asynchronously iterate over loaded gravity sources, rather than recalculating mass every time a structure is changed. This way the workload is more consistent, and less likely to spike if many gravity-producing structures are being updated at once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants