Jump to content

Test of continuing KER developments [0.24.2]


Padishar

Recommended Posts

Oh cool.

One more thing. Are individual thrust vectors being taken into account? Sometimes people angle their engines. Just some basic trigonometry I guess?

Not at the moment, no. Actually, the "correct" way to do it requires no trigonometry, it just needs all the thrust and deltaV related calculations to be done as vectors rather than scalars (because force and velocity are both vector quantities). Simply calculating a cosine loss against the primary axis of the vessel (or any fixed axis) assumes that all the stages are fired with the vessel pointing the same way. Doing it all as vectors allows it to easily account for very odd designs, e.g. with a first stage that points up, and a second that points sideways where you will change the orientation of the vessel between the stages, a simple cosine loss calculation will get 0 dV for the second stage. Doing it as vectors per stage makes a "smaller" assumption, that each stage is burned completely in one direction but each stage can be in a different direction. The calculated deltaV for each stage will be a vector and, when totalling the deltaV, the magnitudes of the individual stage vectors will be added.

I plan to do this fairly soon though there are a number of other things I'll be doing first.

Link to comment
Share on other sites

I think this should be fixed by a change I did yesterday evening that makes it ignore decouplers that have already been fired. I have made quite a few other tweaks and fixes but didn't get around to updating the DLL zip in the first post. I will try to update the zip later this evening but if you are desperate you should be able to download the two updated DLLs from the github repository. Make sure you are looking at the simulate branch, navigate into Output\Engineer and download the Engineer.dll and EngineerToolbar.dll.

My new machine arrived yesterday so I obviously spent some (considerable) time enjoying the improved speed. Going from a 2.16 GHz CoreDuo laptop to an i7-4770K means I can now run at default graphics settings at full HD and still get much better frame rates than my laptop could manage with heavily optimised settings at 1360x768. I don't have a decent video card yet but the on-board Intel HD4600 video has a 3dmark of about 13 times what my laptop has. I'm still probably going to tweak the ocean subdivision settings a bit as looking at Kerbin is still a bit sluggish.

While I was playing I did notice a problem with the latest DLLs in GitHub. The flight engineer is not calculating the deltaV for the asparagus launch stages of my large asteroid tug correctly. It appears similar to the strut issue introduced by 0.23.5 where it works correctly in the VAB but seems to lump all the asparagus stages together in flight. So, I don't recommend that anyone tries using the DLLs from GitHub as I suggested above. I'll be investigating this later today and I will update the zip in the first post once it has been fixed.

Edited by Padishar
Link to comment
Share on other sites

While I was playing I did notice a problem with the latest DLLs in GitHub. The flight engineer is not calculating the deltaV for the asparagus launch stages of my large asteroid tug correctly. It appears similar to the strut issue introduced by 0.23.5 where it works correctly in the VAB but seems to lump all the asparagus stages together in flight. So, I don't recommend that anyone tries using the DLLs from GitHub as I suggested above. I'll be investigating this later today and I will update the zip in the first post once it has been fixed.

I've found the cause of this issue. I changed the threshold at which a part is considered empty of resources and this has uncovered a bug in the simulation code where it is tracking the amounts of all resources and not just the ones being burnt by the engines. Specifically the KS25x4 engines read as having a small quantity of electric charge which causes it to think there is still unburned fuel in the stage so it doesn't stage at the correct times. It should be fairly easy to fix it but I am away from home until Monday night and, while I do have my dev machine with me, I haven't set it up yet. Hopefully I should post a fixed version this evening sometime...

Link to comment
Share on other sites

I've now updated my github branch and the zipped DLLs in the first post. This version includes a fix for the asparagus issue mentioned earlier, a fix for the "already fired decoupler" issue and a number of other tweaks and optimisations. The rate the simulation runs can now be controlled with a tweakable slider on the engineer part both in the VAB and in flight. It basically sets the minimum time (in ms) from the start of 1 run to the start of the next, so a value of 200 should give 5 updates per second and 1000 would be 1 update per second. Setting it to 0 (or to any value < 50 due to the way the sliders work) will run the simulation as fast as possible but will probably affect the speed of the game significantly.

Next job, starting the simulation with the currently active engines...

Link to comment
Share on other sites

I will be continuing work on KER but I will be creating a new fork in my github repo and working from there. This thread should now be considered dead. I will make a new thread once I have a new development version for people to test.

All queries and bug reports with the 0.6.2.4 version should now be posted in the main KER thread again.

Thanks.

Link to comment
Share on other sites

Next job, starting the simulation with the currently active engines...

I have now implemented this and, rather than posting a new thread, I have resurrected this one as it contains various posts about this issue (and others that I will be working on).

During flight, if the currently active engines are different to what should be active in the current stage then an extra "stage" of calculations will be done with just the currently active engines. This stage is reported in the VES window as "DeltaV (active)". The simulation runs the current engines until they are completely out of fuel and then continues with the normal staging process. This should make KER much more useful in situations where engines are manually stopped and started differently to the defined staging.

Please give it a try and continue to use this thread to report issues or give other feedback.

Link to comment
Share on other sites

I have updated the zip in the first post to include a couple of new fixes:

The simulation will now not stage if nothing is decoupled and any engines are still burning. This fixes the pod with a chute on a solid booster to show the deltaV in S1 rather than in S0 (with the chute).

The RealFuels support now checks for a third type of engine module.

Link to comment
Share on other sites

I have updated the zip in the first post to remove some annoying log spam when using non-RF engines when RF is installed. I have also removed the logging of the simulation timing to further improve performance.

Link to comment
Share on other sites

I have now implemented velocity thrust correction for jets. The flight engineer uses the craft's current surface speed and the build engineer has a new tweakable slider to set the speed from 0-2500 m/s.

Link to comment
Share on other sites

Little feature request: you know how the TWR of each stage is shown in the VAB? Well, would it be possible to show it in flight as well? Just the starting TWR of the next stage assuming 100% trust and throttle, possibly in the brackets that include the burn time (like "(1.02.8s, 1.4)").

Thanks for your continued work on this. I've certainly noticed it get a lot better at calculating dV in different situations so yeah, thank you :)

Link to comment
Share on other sites

Oh cool.

One more thing. Are individual thrust vectors being taken into account? Sometimes people angle their engines. Just some basic trigonometry I guess?

I have now implemented correction for engine thrust vectors. The build and flight engineer tweakables have a new toggle that switches between "scalar", the old simple method, and "vector", the new method that tracks the thrust vectors of the individual engine modules of each engine, giving adjusted values for thrust, TWR, deltaV and ISP. This method allows each stage's overall thrust vector to point in a totally different direction and the deltaV is calculated relative to this which gives meaningful results for even very obscure designs, e.g. if you mount your lander sideways on top of the rocket it will still read the correct (i.e. useful) values for the lander and all the launch stages.

Little feature request: you know how the TWR of each stage is shown in the VAB? Well, would it be possible to show it in flight as well? Just the starting TWR of the next stage assuming 100% trust and throttle, possibly in the brackets that include the burn time (like "(1.02.8s, 1.4)").

Thanks for your continued work on this. I've certainly noticed it get a lot better at calculating dV in different situations so yeah, thank you :)

If you only want the stats for the next stage then this can probably be managed quite easily but I'm trying to avoid doing too much to the UI because Cybutek is still working on v1.0.

Edited by Padishar
Link to comment
Share on other sites

Two things:

I recently started my spaceplane programme and having the dV displayed for the ACTIVE engines, not the ones in the stage is so helpful. I think that solves a lot of problems with incorrect dV/engines in another stage firing/action group controlled engines. Very welcome addition, it's nice to begin orbital insertion and see that I have over 2km/s left. Few tweaks needed to the plane but I can't fault KER while flying it, does its job perfectly. It doesn't trip up switching between jets and the aerospike or both, it's all clear and as far as I can tell, correct. Even with PWB fuel balancer that moves fuel around and everything.

Second thing, what's the 'Dump Tree' option do? I saw it appear on the right click menu and looking at the craft file, it's from the Engineer module. My command pod right click menu is getting rather crowded (thanks in part to the GUI) so is it entirely necessary? Or can it be hidden and toggled from the KER window or something? Just curious.

Edited by ObsessedWithKSP
Link to comment
Share on other sites

Two things:

I recently started my spaceplane programme and having the dV displayed for the ACTIVE engines, not the ones in the stage is so helpful. I think that solves a lot of problems with incorrect dV/engines in another stage firing/action group controlled engines. Very welcome addition, it's nice to begin orbital insertion and see that I have over 2km/s left. Few tweaks needed to the plane but I can't fault KER while flying it, does its job perfectly. It doesn't trip up switching between jets and the aerospike or both, it's all clear and as far as I can tell, correct. Even with PWB fuel balancer that moves fuel around and everything.

Cool, thanks for the report. I'm pretty happy with how it's behaving now...

Second thing, what's the 'Dump Tree' option do? I saw it appear on the right click menu and looking at the craft file, it's from the Engineer module. My command pod right click menu is getting rather crowded (thanks in part to the GUI) so is it entirely necessary? Or can it be hidden and toggled from the KER window or something? Just curious.

Yes, this is a development/debugging tool I added to my development version. It basically dumps out the part tree of the vessel into output_log.txt on the next run of the simulation code. It can be useful to diagnose weird issues with the simulation. It almost certainly wont be in any official release of KER. I'll probably add a switch in the settings soon.

Edited by Padishar
Link to comment
Share on other sites

My new machine arrived yesterday so I obviously spent some (considerable) time enjoying the improved speed. Going from a 2.16 GHz CoreDuo laptop to an i7-4770K means I can now run at default graphics settings at full HD and still get much better frame rates than my laptop could manage with heavily optimised settings at 1360x768. I don't have a decent video card yet but the on-board Intel HD4600 video has a 3dmark of about 13 times what my laptop has. I'm still probably going to tweak the ocean subdivision settings a bit as looking at Kerbin is still a bit sluggish.

I've got a few more tweaks to the simulation code that need a bit more testing. I'll try to post an updated dev version this evening but I've now managed to pick up an overclocked GTX560ti so my 3dmark is now another 5-6 times higher and I've not done a lot of development over the weekend because I've been too "busy" checking out how well all sorts of games run now...

Link to comment
Share on other sites

It's been a while since I played KSP, but I encountered a bug I reported previously again so now I have the output_log. However, I wasn't using this development version.

Just to remind what bug it was...

I have a weird problem right now. KER was working fine until I got RSS and Real Fuels (with RftS) working. Now it (KER, I mean) usually works, but often there is a bug where a stage's dV is only shown for a split second when I attach the engine. If I then remove that engine and add it again, it won't show dV even for that split second. If I remove the engine and select a new one (even if it's the same type of engine) and attach it, it will show dV for that split sec again.

Output file.

Link to comment
Share on other sites

It's been a while since I played KSP, but I encountered a bug I reported previously again so now I have the output_log. However, I wasn't using this development version.

Just to remind what bug it was...

Output file.

Well, I can't see any obvious KER related errors except for the unnecessary log lines that I removed in the development version a couple of weeks ago.

Can you give me some idea of what you did in this run of KSP, when the problem started, what sort of engine it was you added when the problem started and how long you left it going wrong before you quit? It looks to me like the craft has 4 solid rocket boosters but can you tell me what other engines etc it uses (or post the craft file)?

I have just updated the dev version in this thread to add the "Dump tree" button to the build engineer tweakable. Can you install this version and, when it happens again, right click on the engineer part (or the command pod if you use a module manager config), click the "Dump tree" button and then make sure you save the ship in the broken state. Then if you could post the log and the craft file I may be able to extract more useful information. If I don't get enough information from that then I may need to add a toggle that turns on the full debug logging in the simulation code.

It may also be worth checking with the Real Fuels people as it sounds like the first run of the simulation after adding the fresh engine works but then something is modifying the engine in some way that makes it not work.

It is probably unrelated but I did notice there are quite a lot of other errors in your log, specifically a whole bunch of TACLS things. I would recommend you run these past the TACLS folk to find out if they are normal or indicate some real issue.

Edited by Padishar
Link to comment
Share on other sites

Can you give me some idea of what you did in this run of KSP, when the problem started, what sort of engine it was you added when the problem started and how long you left it going wrong before you quit? It looks to me like the craft has 4 solid rocket boosters but can you tell me what other engines etc it uses (or post the craft file)?

I was making a small rocket to launch a small useless probe to the orbit, I think. The problem started when I was making the second stage of the rocket (or it might have been the third) and added the Decurion engine to it. I quit pretty much right after I noticed the problem. It has indeed 4 SRB retrorockets, the other engines were an LR25R I think, and the Decurion I mentioned earlier.

I have just updated the dev version in this thread to add the "Dump tree" button to the build engineer tweakable. Can you install this version and, when it happens again, right click on the engineer part (or the command pod if you use a module manager config), click the "Dump tree" button and then make sure you save the ship in the broken state. Then if you could post the log and the craft file I may be able to extract more useful information. If I don't get enough information from that then I may need to add a toggle that turns on the full debug logging in the simulation code.

The problem goes away once I leave the VAB and come back. Reloading the ship might also have been necessary, I don't remember. I'm pretty sure quitting the game was not necessary. Therefore I doubt there will be any anomalies in the save file. I will try and remember to do it next time this happens, though.

It may also be worth checking with the Real Fuels people as it sounds like the first run of the simulation after adding the fresh engine works but then something is modifying the engine in some way that makes it not work.

It is probably unrelated but I did notice there are quite a lot of other errors in your log, specifically a whole bunch of TACLS things. I would recommend you run these past the TACLS folk to find out if they are normal or indicate some real issue.

I'll talk to them.

Link to comment
Share on other sites

I've got a bug. It only happens with my large mothership and no other of my ships. Whenever the KER tab is up it flickers in the toolbar and causes my game to lag TREMENDOUSLY. When I hide the ui or minimize KER in flight the lag goes away. I remember mentioning this before and you telling me it was fixed. I just realized there was a new update so I installed that. The flickering has gone away and some of the lag with it, but it still lags whenever the KER information tabs are up. Again, it's weird that it happens only with this ship..I tried replacing the KER part as well

Soup

edit: It's whenever the vessel tab is open so I assume its the dv calculations that are lagging it up.

Edited by How2FoldSoup
Link to comment
Share on other sites

I've got a bug. It only happens with my large mothership and no other of my ships. Whenever the KER tab is up it flickers in the toolbar and causes my game to lag TREMENDOUSLY. When I hide the ui or minimize KER in flight the lag goes away. I remember mentioning this before and you telling me it was fixed. I just realized there was a new update so I installed that. The flickering has gone away and some of the lag with it, but it still lags whenever the KER information tabs are up. Again, it's weird that it happens only with this ship..I tried replacing the KER part as well

Soup

edit: It's whenever the vessel tab is open so I assume its the dv calculations that are lagging it up.

What spec is your machine (specifically CPU type and speed, though any other details you have may be handy) and how big/complex is the ship in question? I presume it is quite complex as you call it a "large mothership". One thing you can do to reduce the lag caused by the deltaV calculations is to right click on the engineer part and drag the slider for "Sim time" to the right. This increases the delay between runs of the simulation code and should improve matters...

Assuming the list of mods it uses isn't too extreme, could you post a craft/persistence/quicksave file that I could take a look at (and a list of the mods)...?

Edited by Padishar
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...