Space Engineers

Space Engineers

Gravity Generator Physics (Replaces Vanilla)
30 Comments
Korrd 7 Mar, 2021 @ 11:36am 
I tried this out today and the spherical generator works fine, but the regular generator doesn't seem to be affecting other grids. And of course, that's the one I wanted this mod for. :cubewink:
jetblade545 29 Jan, 2021 @ 12:42am 
a bit broken
BookBurner 6 Jan, 2021 @ 1:47am 
Question, is the performance better or worse than the vanilla artificial gravity?

Such as with multiple generators, artificial masses etc (gravity drives basically)
jonn19  [author] 27 Mar, 2020 @ 3:33am 
Yeah sorry Darian, I am a very intermittent player, let alone modder. It should be fully working again.
QuintusJ 26 Mar, 2020 @ 7:27am 
Works for me though I haven't tested extensively. The elevator is the only issue I've encountered.
Darian Stephens 26 Mar, 2020 @ 7:26am 
Wait, does this work again?
There were a couple of undocumented updates recently, but no mention of any changes anywhere.
jonn19  [author] 26 Mar, 2020 @ 3:19am 
QuintusJ could you use the other mod where my gravgens are separate blocks from the vanilla ones? That way you could use vanillas on your elevators and modded ones elsewhere. Mod linked just above.
QuintusJ 25 Mar, 2020 @ 8:14pm 
Using this breaks the VCZ elevators. Unleashes the wrath of Klang. Any way you could fix this?
Darian Stephens 27 Dec, 2018 @ 2:14am 
I don't know about that, but you can just stack generators; artificial gravity is additive.
Kaii 27 Dec, 2018 @ 12:13am 
Does anyone know if there's a mod or a way to make gravity generators have more than 9.807m/s gravity? I'd like to make a player cannon that uses gravity to fire a player, kind of like an ODST, towards a target, but I don't know any way to make the gravity move them fast enough.
Darian Stephens 16 Jan, 2018 @ 1:12am 
It seems like this mod is completely broken when it comes to affecting other grids.
I've got 40 gravity generators all pulling down in space and a single small grid armor block won't budge, but if I have the same thing on a planet, the grid with the generators on goes flying towards the surface like crazy.
Still doesn't affect other grids, though...
I've heard similar complaints from the Zeppelin Balloon mod, where the balloon no longer gives any force, so maybe something changed with that?
Darian Stephens 12 Jan, 2018 @ 10:05am 
Do you think we'll see a fix for that? I have a video of the inconsistency in action if you want.
Set to -1G, the Spherical Gravity Generator will pull nearby grids towards it (And it to nearby grids), but also pushes itself off the planet's surface. If I set it to 1G, it sucks itself towards the surface while blowing the other grids away.
Darian Stephens 19 Sep, 2017 @ 2:47am 
Okay, yes, the generator works just fine for repelling the surface, but it also pulls all nearby grids in to it. I'm not sure why, and -1 g should push them just like the surface, but it happens.
As for the flat generator, it could just push away from the direction it's facing when it hits a voxel, and push/pull grids when they get in its range. So you'd use the spherical for floating yourself, and the flat for moving other things, like an area of decreased gravity above a landing pad, provided by gravity generators on the pad itself, which has been aligned with the planet's gravity.
You could probably even make a bowl of gravity by angling four of them towards a central point... Or gravity tubes or other weird, crazy, awesome stuff with it!
PeterRabbit 14 Sep, 2017 @ 12:44pm 
I have a linear gravity generator on a station but if I place some floating blocks in range of the gravity generator they are barely pushed around.
ArVe 21 May, 2017 @ 7:54am 
@SpaceMarine256: Yes, yes they do!
Would it be possible to make engineers and ore be affected by this on planets? That would give some GREAT new way to harvest ore and getting around on planets
Spacy 16 May, 2017 @ 7:01pm 
Do they work on planets?
Anunnaki_65355 2 May, 2017 @ 10:30am 
Hi John19. Can I place them also to Small Grids? If not, can you create them too? Even maybe in separate mod?
Korvatus Klok 29 Apr, 2017 @ 7:20pm 
Since you seem to be working with gravity generators, any chance you can get one to work on planets so gravity weapons and "antigravity" systems can work on planets like they do in space?
XCanG 15 Apr, 2017 @ 3:32pm 
Hm. So if I set force something about -100 my ship will hover and will not touch ground? (I really want to make some hover machine)
jonn19  [author] 7 Apr, 2017 @ 11:00pm 
I could make a device which basically neutralises the gravity field, within an area-of-affect, but the design of these gens is to get closer to true gravity performance in a science fiction construct. Antigrav is a whole different gig.
Actually given gravity generation is scifi I was thinking about changing the vanilla gravity generators into magnetic field generators... if you're wearing steel boots, the physics would almost be accurate, although a fall-off effect would need to be added, and of course the effect with asteroids/planets would only be seen near iron ore deposits.
jonn19  [author] 7 Apr, 2017 @ 11:00pm 
Hi guys. Thanks Son o'Petrified, sounds like a good project. I've found that, with the right gravity level and approach speed, you can even manage to get a grid into close orbit.
Darian, I've tested and found that a small grid with three sphericals set to -1g takes off quite effectively, so not sure why you're finding gravity settings inverted. I did set the centre-of-gravity calculation to the centre of the planet/asteroid, because the uneven surface angles made any form of control totally impossible (changing vector with every translation) plus of course the actual centre of gravity IS the centre of a body. Similarly flat generators don't want to work, because their "downwards" gravity field is almost impossible to align with the natural gravity field.
JCapt 7 Apr, 2017 @ 9:53pm 
Yes! Now I can make proper asteroid stations!!! Thank you so much!
Darian Stephens 6 Apr, 2017 @ 11:41am 
I've been playing around with gravity generators on planets, and it's been pretty fun.
I have noticed that only spherical G-Gens appear to repel the planet's surface, and then appear to only repel from the planet's center, not from the voxels it detects.
I'm sure that would be much more difficult to code, and probably not even work it performance-wise, but why were flat grav gens left out?
Also, the spherical grav gen appears to be inversed right now, pulling when it should push and vice versa, which means I can't use them to hover a ship without every other grid in range smashing into me.
If you make the flat grav gens work, I'm building a space gun and no one can stop me.
It's somewhat balanced, too, since it takes a lot of resources to build, needs to be carefully managed or it'll blast itself and everything around it to kingdom come, and with Scarce Resources, you need to get to space and then get the materials from a moon and ship them back to even begin building stuff like that.
jonn19  [author] 5 Apr, 2017 @ 7:15pm 
Hi again Darian. I think you're roughly on the right track; the function causing the error scans the area around the gravgen and the area itself doesn't exist if the world isn't created. Of course the gravgen itself probably shouldn't exist on new world generation, but maybe a respawnship gets pregenerated or something. Anyway I wrapped the function in a try-catch so crashes should have gone away.
Darian Stephens 4 Apr, 2017 @ 3:22pm 
If I had to guess, your mod's probably trying to run on grids that haven't been set up yet by whatever mechanisms take place when you create a world, causing that exception. It's possible that it could happen in other circumstances, like spawning a really big ship through blueprint or the cargo ship system, but I really just don't know.
jonn19  [author] 4 Apr, 2017 @ 3:17pm 
Thanks Darian, yes that exception is definitely due to the mod. I will have a look at troubleshooting tomorrow, I also hadn't created a new world with it so I suspect that will be the issue. Please let me know if there are any other exceptions, and thanks for using PasteBin as that's very handy to track down issues.
Darian Stephens 4 Apr, 2017 @ 7:19am 
So, erm... is this caused by your mod?
https://pastebin.com/6WexuV63
If it helps, this is from starting a new world (I'm kinda eager to try this already, and my main world has lost too much simspeed to be enjoyable right now, so I'll need to clean THAT up...)
I haven't experienced a crash when adding the mod to a previously-existing world, so a workaround is to just remove the mod when creating a world, then add it later.
Darian Stephens 4 Apr, 2017 @ 6:58am 
For my first test, I'm planning to gradually ramp up the generator's strength until it starts floating, then adjust from there until it's able to reliably float. If necessary, I could probably add a small thruster or two to slow falls, or maybe a really powerful hover-GG which activates only when our speed exceeds a TBD amount. There may be a few cases where that would cause bouncing, but it should only happen a couple of times before it bleeds off enough speed to wind resistance.
jonn19  [author] 4 Apr, 2017 @ 6:02am 
Darian, as mentioned on the other mod, I've added planet detection. Be very gentle with setting strength if you're trying to hover, they're touchy. Oh, I managed to put a vanilla respawn ship into asteroid orbit, with two spherical generators on it set to 5m/s/s and an approach speed of around 70m/s. Fun times.
Darian Stephens 4 Apr, 2017 @ 4:24am 
Actually, seeing how this introduces an 'Equal and Opposite Reaction' mechanic, does that mean gravity drives aren't possible anymore? Maybe you could catch asteroids and fling yourself around with them, but that sound actually fun, and like it would take skill. I'd actually want to try that!
Does your mechanic work on planets? You either saw my previous message or this one first, and if you haven't seen my other one on the original page, you'll see why I'm asking about planets.
I really, REALLY hope they do, just so I can do that! It genuinely sounds amazing, and if gravity drives are essentially useless with this mod, it's perfectly fine to allow GGens to work, since they can't create force out of nothing, so you'll still need thrusters to escape or fly on planets, while you could use gravity generators for quick hovering (Which I'm still totally excited to try).