Jump to content

[0.21.x] KerbCom Avionics 0.3.0.6 Alpha (29 August) - now with video!


ZRM

Recommended Posts

The mod isn't loading for me, I found this in KSP.log, any ideas? I made sure I deleted the rar, downloaded it fresh and installed clean but it still does this every time.

[ERR 22:25:10.152] Failed to load assembly C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\KerbComAvionics\lpsolve55.dll:

System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.

at Mono.Cecil.PE.ImageReader.ReadOptionalHeaders (System.UInt16& subsystem, System.UInt16& dll_characteristics) [0x00000] in <filename unknown>:0

at Mono.Cecil.PE.ImageReader.ReadImage () [0x00000] in <filename unknown>:0

at Mono.Cecil.PE.ImageReader.ReadImageFrom (System.IO.Stream stream) [0x00000] in <filename unknown>:0

at Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0

at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0

at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName) [0x00000] in <filename unknown>:0

at AssemblyLoader.ScanForBadTypeRefs (System.String file) [0x00000] in <filename unknown>:0

at AssemblyLoader.LoadExternalAssembly (System.String file) [0x00000] in <filename unknown>:0

Hi I'm having the same problem. I get the same error in KSP.log.

I am also on windows 7 64bit and an i7 920.

I have tried downloading lpsolve55.dll separately (both the 32bit and 64bit versions) but it doesn't make any difference.

Link to comment
Share on other sites

Hi I'm having the same problem. I get the same error in KSP.log.

I am also on windows 7 64bit and an i7 920.

I have tried downloading lpsolve55.dll separately (both the 32bit and 64bit versions) but it doesn't make any difference.

I've just realised what the problem is that you are both having - there isn't one, at least not with lpsolve. Ignore that message - it is perfectly normal, and simply a side effect of KSP trying to load a native library as if it is a managed one. My plugin loads it correctly later on. Make sure that you have installed the configs correctly, as per the readme, and the mod should work.

Link to comment
Share on other sites

Unfortunately, no, not yet. And I can't see why it would ever happen in the first place - I've ensured that the engine throttle input is in a sensible range (i.e. between 0 and 1). It's really peculiar.

Link to comment
Share on other sites

I've just realised what the problem is that you are both having - there isn't one, at least not with lpsolve. Ignore that message - it is perfectly normal, and simply a side effect of KSP trying to load a native library as if it is a managed one. My plugin loads it correctly later on. Make sure that you have installed the configs correctly, as per the readme, and the mod should work.

I found the problem, ModuleManager.dll is not in the most recent release.

Link to comment
Share on other sites

I found the problem, ModuleManager.dll is not in the most recent release.

Heh, sorry about that. Also, I think I may have now found a candidate fix for the flameout bug. So now I am going to upload and release it for testing, with ModuleManager.dll included.

Link to comment
Share on other sites

New release, now including a fix for the flameout bug, and including ModuleManager.dll (sorry again about that).

Hey thanks for the super fast response! I have also just run into the flame out bug so I tried out 3.0.2 and the behaviour has changed but there is still a problem. My main engine (which is connected to the last tank in a series of tanks linked with fuel crossfeeds) flames out when any other fuel tank empties even if that doesn't cause other engines to flameout. If I jettison the empty tank it restarts.

I have helpfully provided a video so you can see what's happening http://www.twitch.tv/havocx42/b/445635206 :wink:

Edit: oh and look at 1:48 for the most important part.

Edited by havocx42
Link to comment
Share on other sites

Hey thanks for the super fast response! I have also just run into the flame out bug so I tried out 3.0.2 and the behaviour has changed but there is still a problem. My main engine (which is connected to the last tank in a series of tanks linked with fuel crossfeeds) flames out when any other fuel tank empties even if that doesn't cause other engines to flameout. If I jettison the empty tank it restarts.

I have helpfully provided a video so you can see what's happening http://www.twitch.tv/havocx42/b/445635206 :wink:

Edit: oh and look at 1:48 for the most important part.

Now that is really weird. I don't even touch anything to do with individual fuel tanks. To make it easier to test, please could you possibly reduce your very considerable number of parts to as small a craft as possible (and ideally 100% stock) that still demonstrates the problem, then post the craft file? Also, I have never tested with that many engines before, so I am actually quite impressed that it works at all in that situation.

Link to comment
Share on other sites

Now that is really weird. I don't even touch anything to do with individual fuel tanks. To make it easier to test, please could you possibly reduce your very considerable number of parts to as small a craft as possible (and ideally 100% stock) that still demonstrates the problem, then post the craft file? Also, I have never tested with that many engines before, so I am actually quite impressed that it works at all in that situation.

I was looking at your last commit:

bool shouldFlameout = false;
foreach (ModuleEngines.Propellant prop in engine.propellants)
{
double available = part.RequestResource(prop.id, 0.0000001);
part.RequestResource(prop.id, -0.0000001);
if (available == 0.0)
{
shouldFlameout = true;
break;
}
}
engine.flameout = shouldFlameout;

Could the problem come from ModulesEngines.Propellant having separate entries for each tank? I've never worked with Kerbal mods before but that would certainly cause this problem.

I will work on a smaller craft for you now.

Edit: here it is https://dl.dropboxusercontent.com/u/20045408/KerbComTest.craft

Edited by havocx42
Link to comment
Share on other sites

I was looking at your last commit:

bool shouldFlameout = false;
foreach (ModuleEngines.Propellant prop in engine.propellants)
{
double available = part.RequestResource(prop.id, 0.0000001);
part.RequestResource(prop.id, -0.0000001);
if (available == 0.0)
{
shouldFlameout = true;
break;
}
}
engine.flameout = shouldFlameout;

Could the problem come from ModulesEngines.Propellant having separate entries for each tank? I've never worked with Kerbal mods before but that would certainly cause this problem.

I will work on a smaller craft for you now.

ModuleEngines.Propellant does not really represent a propellant. A better description is as a record of known state and statistics about resources that ModuleEngines updates for its own benefit. It has no concept of individual containers. You may notice from the code that the resource itself is requested via "part.RequestResource(id, amount)". This is a call to the vessel resource management system. RequestResource is used by any part that uses or generates any resource (generators specify a negative value for "amount"). The game should manage multiple connected containers as if they were one. The only thing I can think of is that it is somehow related to the one-way travel of fuel imposed by the fuel pipes, though I am not sure how that would have an effect.

Link to comment
Share on other sites

I edited in a link for a craft file to my last post. I will see if I can get the problem without the fuel pipes, but I suspect you are right that it is related.

Edit: So I managed to make it happen with an even simpler craft, no fuel lines involved just two tanks stacked on top of each other, just burn it until the top one is empty and the engine flamesout even though the bottom one is full. craft file

Edited by havocx42
Link to comment
Share on other sites

New release (again). Now I have actually tracked down both bugs. They were caused by the same thing - setting the engine acceleration factors to zero. If I instead set them to something very close to zero, the problems no longer occur, but I still have practically the same control over engines as before. It must have been some sort of edge case in the KSP code not being handled correctly.

Link to comment
Share on other sites

New release (again). Now I have actually tracked down both bugs. They were caused by the same thing - setting the engine acceleration factors to zero. If I instead set them to something very close to zero, the problems no longer occur, but I still have practically the same control over engines as before. It must have been some sort of edge case in the KSP code not being handled correctly.

Awww I just found that bug!

basically:

operational = engine.EngineIgnited && !engine.flameout;

then

if (operational)

{

...

}

else

{

engine.currentThrottle = 0.0f;

}

This means once the flameout occurs currentThrottle will never go above 0 right?

But the ModuleEngines code will only recheck to see if the rocket should still be flamed out when a propellant is requested.

So either

1. just do a little propellant request(like you already do, but leave the writing to engine.flameout out)

2. don't simply 0 the throttle if the engine is not operational (this shouldn't be necessary anyway right? Nothing will happen as there is no fuel

Link to comment
Share on other sites

Awww I just found that bug!

basically:

operational = engine.EngineIgnited && !engine.flameout;

then

if (operational)

{

...

}

else

{

engine.currentThrottle = 0.0f;

}

This means once the flameout occurs currentThrottle will never go above 0 right?

But the ModuleEngines code will only recheck to see if the rocket should still be flamed out when a propellant is requested.

So either

1. just do a little propellant request(like you already do, but leave the writing to engine.flameout out)

2. don't simply 0 the throttle if the engine is not operational (this shouldn't be necessary anyway right? Nothing will happen as there is no fuel

Hah, you are right! Now it seems so obvious. What this code needed was a second pair of eyes to go over it. Thank you very much. My "fix" was more of a guess that happened to avoid the problem. I will change it to use your suggestion (set the throttle to something non-zero). So expect yet another release soon, with some sort of excuse in the changelog.

Edit: There you go: New release, now with the flameout and fuel tank bugs hopefully safely behind us permanently.

Edited by ZRM
Link to comment
Share on other sites

Now that those critical bugs are fixed, I think the mod is now actually worthy of being played with regularly. Of course, if you come across another critical bug, please report it. Now I can actually focus on building all of the complex asymmetric landers, shuttles and VTOLs I have been imagining since I first started working on the mod. Of course the mod is still in development, and a particular feature I will try to add is the ability to smooth out the throttle outputs so that engines do not jitter between being on and off.

Link to comment
Share on other sites

This latest one has the same thing in the log

[ERR 22:58:16.854] Failed to load assembly C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\KerbComAvionics\lpsolve55.dll:

System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.

at Mono.Cecil.PE.ImageReader.ReadOptionalHeaders (System.UInt16& subsystem, System.UInt16& dll_characteristics) [0x00000] in <filename unknown>:0

at Mono.Cecil.PE.ImageReader.ReadImage () [0x00000] in <filename unknown>:0

at Mono.Cecil.PE.ImageReader.ReadImageFrom (System.IO.Stream stream) [0x00000] in <filename unknown>:0

at Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0

at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0

at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName) [0x00000] in <filename unknown>:0

at AssemblyLoader.ScanForBadTypeRefs (System.String file) [0x00000] in <filename unknown>:0

at AssemblyLoader.LoadExternalAssembly (System.String file) [0x00000] in <filename unknown>:0

Link to comment
Share on other sites

I've just realised what the problem is that you are both having - there isn't one, at least not with lpsolve. Ignore that message - it is perfectly normal, and simply a side effect of KSP trying to load a native library as if it is a managed one. My plugin loads it correctly later on. Make sure that you have installed the configs correctly, as per the readme, and the mod should work.
This latest one has the same thing in the log

[ERR 22:58:16.854] Failed to load assembly C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\KerbComAvionics\lpsolve55.dll:

System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.

at Mono.Cecil.PE.ImageReader.ReadOptionalHeaders (System.UInt16& subsystem, System.UInt16& dll_characteristics) [0x00000] in <filename unknown>:0

at Mono.Cecil.PE.ImageReader.ReadImage () [0x00000] in <filename unknown>:0

at Mono.Cecil.PE.ImageReader.ReadImageFrom (System.IO.Stream stream) [0x00000] in <filename unknown>:0

at Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0

at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0

at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName) [0x00000] in <filename unknown>:0

at AssemblyLoader.ScanForBadTypeRefs (System.String file) [0x00000] in <filename unknown>:0

at AssemblyLoader.LoadExternalAssembly (System.String file) [0x00000] in <filename unknown>:0

This isn't a bug. It's a side effect of using a .DLL that the KSP engine doesn't understand. KAC does understand it and loads it correctly later on in the initialization routines.

Link to comment
Share on other sites

Hi,

This is a great mod. Would you mind looking at the firespitter-propeller-not-rotating bug?

Sure. I've just looked at the firespitter source. Unfortunately there is not much I can do other than suggest a patch for firespitter. For some reason firespitter calculates the propellor speed manually, using the engine acceleration speed settings (which I override), instead of simply basing it off the engine currentThrottle, which takes those parameters into account anyway, and would give the correct result regardless of whether my plugin is installed. I'll see if I can suggest a change to Snjo.

Link to comment
Share on other sites

seems the rcs fx glitch has reappeared or at least for me it has only when i switch ships then switch back i have a lot of mods installed so it could be 1 of those but i realy dont know let me know if you need more info

It might be a conflict with another mod due to a known KSPAddon bug. I'll see if I can make a version with a workaround added to prevent any conflicts.

Edit: There you go, KSP bug workaround added (New release).

Edited by ZRM
Link to comment
Share on other sites

This isn't a bug. It's a side effect of using a .DLL that the KSP engine doesn't understand. KAC does understand it and loads it correctly later on in the initialization routines.

Ah cheers mate, I'll put it back in then.

Link to comment
Share on other sites

Sorry if this has been mentioned: Despite working fine after upgrading to 0.3.0.5 (It took me ages to track down what was causing the flameout bug), I opened an error log after a recent crash (they just happen. Don't know if Kerbcom is involved) to discover nearly five million lines of Null Reference Exceptions from Kerbcom. I won't post the whole log obviously, but it was a whole, whole lot of

(Filename:  Line: -1)

NullReferenceException: Object reference not set to an instance of an object
at KerbCom.MyRCSModule.FixedUpdate () [0x00000] in <filename unknown>:0

Any ideas? The output file was actually too large for notepad to open; I had to use Notepad++

Link to comment
Share on other sites

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...