Jump to content

[1.12.x] Alcubierre Warp Drive (Stand-alone)


RoverDude

Recommended Posts

Alright, the first version with just words is done, feel free to have a look. Let me know if you find any mistakes (or correct them), or if you can think of an important maneuver that's missing, or even any important info about the drive itself.

https://github.com/jd284/WarpDrive/wiki

I'll be generating some screenshots and maybe diagrams to visualize what I so far tried to explain with words.

Link to comment
Share on other sites

  • 3 weeks later...

Still planning to add some pictures and/or animations to explain the maneuvers...

But in the meantime, I found a bug in the code. After building my second warp ship, I boosted it to high enough apoapsis, and when I got there I tried to enable the warp drive. But no bubble appeared (this may be the same as issue #38). The 1kN thrusters were working but the info popup said "Warp Drive: inactive".

Then I noticed an exception spamming the log:

[LOG 12:13:40.022] [WARP] Error in OnFixedUpdate - Object reference not set to an instance of an object

Adding some debug statements to the code, I found that FixedUpdate was called with eModule == null, which was because for some reason OnAwake was called with vessel == null, which in turn was presumably the reason the code couldn't find the engine module.

I was able to fix it by adding the following to FixedUpdate:

                if (eModule == null)
                	OnAwake();

@RoverDude: Do you want a PR for that fix? Or should OnAwake not be called there and just use eModule = part.FindModuleImplementing<ModuleEngines>() directly to set the module? Maybe it would be best to completely move that to FixedUpdate instead then.

It's kinda weird though that it worked fine for my first warp ship but now broke for the second. Could it be because the warp drive is the root part on this ship and in OnAwake the vessel isn't set until after the root part is processed? Let me know if you want the craft file to test this. By the way, on a whim I tried calling base.OnAwake() before searching the module but it didn't help.

By the way two, my compiler complained that StartState _state was never set to any value so all the code checking _state == StartState.Editor would be useless. I removed all references to _state and it didn't seem to break anything so I guess that's a leftover which is no longer needed.

Link to comment
Share on other sites

@jd284 very good.
Something to note: I wrote the angular momentum conservation mode. The reason it's there is so you don't get free energy (or at least not as much as conserving velocity). As you climb out of the gravity well you have to give up your kinetic energy for potential energy and vice versa. You describe this effect pretty well. I do agree that the velocity mode is much simpler and easier to understand.

The conservation modes were meant more as a gameplay option than to solve a delta-v problem. Also, that multiple slingshots work with angular momentum mode, they don't with velocity. That's what got me to write it in the first place. Also didn't like that when I went from Kerbin to Eeloo suddenly I had enough energy to escape the solar system. That just seemed... wrong.

Link to comment
Share on other sites

  • 2 weeks later...
On 2/26/2017 at 4:15 AM, jd284 said:

Still planning to add some pictures and/or animations to explain the maneuvers...

But in the meantime, I found a bug in the code. After building my second warp ship, I boosted it to high enough apoapsis, and when I got there I tried to enable the warp drive. But no bubble appeared (this may be the same as issue #38). The 1kN thrusters were working but the info popup said "Warp Drive: inactive".

Then I noticed an exception spamming the log:


[LOG 12:13:40.022] [WARP] Error in OnFixedUpdate - Object reference not set to an instance of an object

Adding some debug statements to the code, I found that FixedUpdate was called with eModule == null, which was because for some reason OnAwake was called with vessel == null, which in turn was presumably the reason the code couldn't find the engine module.

I was able to fix it by adding the following to FixedUpdate:


                if (eModule == null)
                	OnAwake();

@RoverDude: Do you want a PR for that fix? Or should OnAwake not be called there and just use eModule = part.FindModuleImplementing<ModuleEngines>() directly to set the module? Maybe it would be best to completely move that to FixedUpdate instead then.

It's kinda weird though that it worked fine for my first warp ship but now broke for the second. Could it be because the warp drive is the root part on this ship and in OnAwake the vessel isn't set until after the root part is processed? Let me know if you want the craft file to test this. By the way, on a whim I tried calling base.OnAwake() before searching the module but it didn't help.

By the way two, my compiler complained that StartState _state was never set to any value so all the code checking _state == StartState.Editor would be useless. I removed all references to _state and it didn't seem to break anything so I guess that's a leftover which is no longer needed.

Cool, I was just about to ask about this exact issue, it's always a good day when you come to report a bug and someone else has already found it.

So yes, I'm having the same problem here but since it seems a fix is already in the works, I'll be paitent :)

Link to comment
Share on other sites

Cool. Also if it helps, I noticed @jd284 mentioned that it possibly had something to do with the warp drive part being root or not, if so that makes sense because of my ship design. The warp ship itself is fully remote-controlled, but has docking rings in the fore and aft to accommodate manned modules and/or resource containers (its purpose being to deliver RocketPart and fuel containers, as well as crew, to planet and moon bases that I will be constructing via EPL)

When I tried to jump I had a manned module docked to the forward docking ring. This module was actually from a larger multi-stage rocket, and in all likelihood the docking ring on the manned module was root for that ship, while the warp drive was root for the RC ship (I built it all around the drive so I could ensure parts stayed inside the bubble). It's possible docking the two craft together superceded the root part somehow which caused the drive to fail.

Though it does sound like you've already developed a fix, figured I'd throw that out there as a theory. Might help catch something you missed, maybe. Thanks again - can't wait for the updated version! My crew is stuck in orbit all disappointed while Mission Control is trying to figure out what went wrong and program a software update, and you know what they say about monkeys Kerbals and typewriters :P

Link to comment
Share on other sites

This is kinda a technical question, if I wanted to idk...

 

Increase thrust faster then 10x the speed of light for no specific Over Powered reason

 

how would I edit the .cfg to do so? I can't find the actual thrust value in the .cfg 

Link to comment
Share on other sites

48 minutes ago, Rainbowd4sh said:

This is kinda a technical question, if I wanted to idk...

 

Increase thrust faster then 10x the speed of light for no specific Over Powered reason

 

how would I edit the .cfg to do so? I can't find the actual thrust value in the .cfg 

You'd be after the warp factor.  There is no thrust.

Link to comment
Share on other sites

  • 2 weeks later...
1 hour ago, SYDWAD said:

anyone know how to remove the Orbit safeguard? i find 600k a bit too high, or could it be toggles in the next update?

There is a minaltitude in the config.  Not sure what it does though.  I doubt it will be toggleable as it's a bit of a balance issue.

Link to comment
Share on other sites

32 minutes ago, goldenpsp said:

There is a minaltitude in the config.  Not sure what it does though.  I doubt it will be toggleable as it's a bit of a balance issue.

the minaltitude is the orbit safeguard, and yes, afaik it's a balance thing.  That doesn't stop you changing it.  The lower it goes, the more the drive is "cheating". of course.  But you're installing an alcubierre drive that doesn't require a significant fraction of the universe's mass (down from early estimates of roughly equivalent) converted to negative mass.  So there's a bit of cheatiness inferred by using it at all.

Link to comment
Share on other sites

  • 2 weeks later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...