RoverDude

[1.3] Alcubierre Warp Drive (Stand-alone)

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.

Share this post


Link to post
Share on other sites

You have some neat tricks there! Cant wait to get far enough into my career save to try them out!

Edited by blu3wolf

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

EDIT: Disregard, found my answer! Sorry!

 

 

For some reason, I can't find the drive in any of the tabs. I've got the latest version installed. Can anyone help?

Edited by theaveragepxtseryu

Share this post


Link to post
Share on other sites
2 hours ago, TheDerpSquid1 said:

There's texture glitches if you fly into the sun, don't ask how I figured that out. It flashes blue and yellow.

They're not glitches! They're bonus warning lights! 

Share this post


Link to post
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 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
11 hours ago, TiktaalikDreaming said:

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

That worked. I am now happily going 1 trillion m/s. 

 

Thank you! 

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Does this version work in 1.2.2? I saw this in one of Nassault's videos. Its pretty cool

Share this post


Link to post
Share on other sites
12 minutes ago, Voyager1Fan5213 said:

Does this version work in 1.2.2? I saw this in one of Nassault's videos. Its pretty cool

nah, @RoverDude is totally lazy about updating his mods.

Share this post


Link to post
Share on other sites

@RoverDude PLZ update to 1.2.2!!!!!!!!!!!!!!!! This needs to happen!

Edited by Voyager1Fan5213

Share this post


Link to post
Share on other sites
Just now, Voyager1Fan5213 said:

@RoverDude PLZ update to 1.2.2!!!!!!!!!!!!!!!!

He was just joking. RoverDude is one of KSP most active modders and actually works for Squad as well as modding. This mod definitely works in 1.2.2.

Share this post


Link to post
Share on other sites

Thx dude :). I got the ring up and running.

Share this post


Link to post
Share on other sites

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.