Jump to content

[1.11.x] AmpYear Main & Reserve Power Manager (v1.5.9.0) 22nd Feb 2021


JPLRepo

Recommended Posts

 

Possible clue - in the parts calculation is says 0 Ec usage (as in no SAS registered), but in the Subsystem calculation it says 0.017/s (as in SAS registered?). Unless that's a dummy variable.

Craft is just a Mk1 pod, some modded fuel tanks, stock decouplers, embedded MechJebCore in the pod (no SAS here), saturated Reaction Wheel mod, parachute (realchute), the Flare engine from SXT, and some science stuff.

 

9BsE8rb.png

Log (excuse the KeepFit spam, it's apparently a debug build)

 

Suggestions listed here as per request:

https://github.com/JPLRepo/AmpYear/issues/23

Link to comment
Share on other sites

On 01/05/2016 at 6:49 AM, Deimos Rast said:

 

Possible clue - in the parts calculation is says 0 Ec usage (as in no SAS registered), but in the Subsystem calculation it says 0.017/s (as in SAS registered?). Unless that's a dummy variable.

Craft is just a Mk1 pod, some modded fuel tanks, stock decouplers, embedded MechJebCore in the pod (no SAS here), saturated Reaction Wheel mod, parachute (realchute), the Flare engine from SXT, and some science stuff.

 

9BsE8rb.png

Log (excuse the KeepFit spam, it's apparently a debug build)

 

Suggestions listed here as per request:

https://github.com/JPLRepo/AmpYear/issues/23

Sorry a bit tardy to reply. Totally forgot about this. I haven't looked at your log... But looking at your picture it looks like my picture (except for one thing, which I'll get to in a minute).
SAS module is using Zero EC as per the parts list. The Grey'd .017 next to SAS is an indicator of what EC it WOULD use if turned on. Is that what you are referring to?
What is really bothering me is why you don't have Turn Booster above SAS in your AmpYear Window.

I noticed a LOT of other Null Reference errors. Are you sure all your mods are 1.1.2 compatible?

Link to comment
Share on other sites

2 hours ago, Grunf911 said:

will you support kerbalism ?

 

Well that all depends.. If you mean support the Kerbalism specific parts that use EC to display EC usage in this mod correctly, then I could. I note that kerbalism has its own type of EC monitoring so don't know how that would go together. I can put it on the list, don't know when I will get to it though.

Link to comment
Share on other sites

41 minutes ago, Lennartos said:

Hi there.
Is there a way to reduce the per frame CPU load of this mod?
AmpYear is king of all mods in regards to used CPU load and garbage created.. which honestly has reached a level that seems a bit excessive.

https://onedrive.live.com/redir?resid=715EC76A10372B02!12143&authkey=!APYWXCtAf0Qcy1U&v=3&ithint=photo%2cpng

 

I'll look into it. There are a number of factors contributing to this.
1) There is no easy way to get parts and parts lists from active vessels (cached).
2) The more parts and part modules that are loaded the worse it gets.
3) You haven't specified how many loaded vessels there were and how many parts and part modules when you captured that profiler picture.
4) The new ESP processing I implemented may be contributing to this, I will look for efficiencies throughout.

Link to comment
Share on other sites

1 hour ago, JPLRepo said:

I'll look into it. There are a number of factors contributing to this.
1) There is no easy way to get parts and parts lists from active vessels (cached).
2) The more parts and part modules that are loaded the worse it gets.
3) You haven't specified how many loaded vessels there were and how many parts and part modules when you captured that profiler picture.
4) The new ESP processing I implemented may be contributing to this, I will look for efficiencies throughout.

1) you have done this a lot longer than me, but as fra as i have seen in the log im assuming that one can detect a change of active vessel, and propably undocking / staging.
so reusing the same list for lets say an entire second or until vessel changed somehow shouldn't be that bad to do?
2) i see that, but there has to be code that doesnt nee to be calculated for each frame... most calculations should be just fine once per second instead.
3) 1 active vessel, 95 parts beeing constructed of 2 docked vessels ( my mun station )  - Image below
As you can see in the image i'm not running 1:1 time after installing this mod and even a simple station like this.
My biggest interest is actually the nighttime calculation, seeing if i can survive in a specific orbit while in VAB..emergency power is a nice addition, but not at this cost :)


3C001939004174E48B8535A2DC4369308279C60A

Edited by Lennartos
Link to comment
Share on other sites

26 minutes ago, Lennartos said:

1) you have done this a lot longer than me, but as fra as i have seen in the log im assuming that one can detect a change of active vessel, and propably undocking / staging.
so reusing the same list for lets say an entire second or until vessel changed somehow shouldn't be that bad to do?
2) i see that, but there has to be code that doesnt nee to be calculated for each frame... most calculations should be just fine once per second instead.
3) 1 active vessel, 95 parts beeing constructed of 2 docked vessels ( my mun station )  - Image below
As you can see in the image i'm not running 1:1 time after installing this mod and even a simple station like this.
My biggest interest is actually the nighttime calculation, seeing if i can survive in a specific orbit while in VAB..emergency power is a nice addition, but not at this cost :)

 

1) It does that already.... But you still have to calculate the EC usage and production every physics frame or it will lag and be inaccurate.
2) It does this as well... but again, the longer you leave between updates, the more out of date the EC usage, production, etc is.
3) Yeah that's a big vessel. Won't help.
Again, probably because the new EPS processing is chewing up too much. I will look into improvements.

Link to comment
Share on other sites

Looked through the code a bit
Quite a lot going on, many modules taken into account.
Looots of string comparissons etc, and even worse is string parsing and splitting....
you will propably need to make some more detailed profiling on where it pays off more to improve, maybe EPS indeed is a big chunk...
But if its not, then i see no other way than not to rebuild the entire data 30 times a second.

There has to be a way to reduce the calculation needed, and only check production and consumption without doing all the hard work of building the part tree

Edited by Lennartos
Link to comment
Share on other sites

3 minutes ago, Lennartos said:

Looked through the code a bit
Quite a lot going on, many modules taken into account.
Looots of string comparissons etc, and even worse is string parsing and splitting....
you will propably need to make some more detailed profiling on where it pays off more to improve, maybe EPS is a big chunk...
But if its not, then i see no other way than not to rebuild the entire data 30 times a second.

Yes - thanks. I will investigate. I will probably change the dictionaries (added for ESP) to be hashtables, and a number of other things can be done to improve things.

Link to comment
Share on other sites

4 hours ago, Gordon Dry said:

The enriched uranium reactor "WIP RO" works, but its output is not shown in AmpYear.

Is that RO as in Realism Overhaul? Is that in the list of supported mods in the OP? Yeah no it isn't. Sorry but there is no support currently for RO. Probably need to deal with the performance issues @Lennartos has raised before I get to that. That's actually a big piece of work as RO adds and changes LOTS. Something for a future release perhaps.

Link to comment
Share on other sites

i installed Amp Year, now i wanna delete it. After doing it through CKAN and continue playing i cannot recover vessels, or destroy them or fly them anymore. these buttons are not clickable now (shaded). I have mods and all the mods i had before Amp Year without issues.

Any ideas? What u need as information?

20160510185142_1.jpg

Link to comment
Share on other sites

1 hour ago, LeLeon said:

i installed Amp Year, now i wanna delete it. After doing it through CKAN and continue playing i cannot recover vessels, or destroy them or fly them anymore. these buttons are not clickable now (shaded). I have mods and all the mods i had before Amp Year without issues.

Any ideas? What u need as information?

That's a shame, but we can't determine if it is AmpYear or what is going on without a log, as per the OP:
Support:
For support please ensure you are following these instructions.
NO LOG = NO SUPPORT.

Link to comment
Share on other sites

1 minute ago, LeLeon said:

first the working version log. i can install and uninstall and reinstall again. Savegame works, i can chooose every vessel with every normal option in Tracking Station.

Log with Amp Year

Now the log, when i uninstalled Amp Year and can't access a vessel in Tracking Station on my savegame.

Log without Amp Year (with the bug)

Oh I am sorry I misunderstood you... You want to uninstall AmpYear and that is breaking your game... Yes it will... Generally uninstalling mods will break save games.

Went through your log after you uninstalled:

Spoiler

NullReferenceException: Object reference not set to an instance of an object

  at KSP.UI.Screens.KnowledgeBase.<GetUnloadedVesselMass>m__96B (.ProtoPartResourceSnapshot x) [0x00000] in <filename unknown>:0
  at UniLinq.Enumerable.Sum[ProtoPartResourceSnapshot] (IEnumerable`1 source, System.Func`2 selector) [0x00000] in <filename unknown>:0
  at KSP.UI.Screens.KnowledgeBase.GetUnloadedVesselMass (.Vessel v) [0x00000] in <filename unknown>:0
  at KSP.UI.Screens.KbApp_VesselInfo.CreateVesselInfoList (.Vessel v) [0x00000] in <filename unknown>:0
  at KSP.UI.Screens.KbApp_VesselInfo.ActivateApp (.MapObject target) [0x00000] in <filename unknown>:0
  at KSP.UI.Screens.KnowledgeBase.ActivateApps (KbTargetType targetType, .MapObject target) [0x00000] in <filename unknown>:0
  at KSP.UI.Screens.KnowledgeBase.OnMapFocusChange (.MapObject target) [0x00000] in <filename unknown>:0
  at EventData`1[MapObject].Fire (.MapObject data) [0x00000] in <filename unknown>:0
  at PlanetariumCamera.SetTarget (.MapObject tgt) [0x00000] in <filename unknown>:0

  at KSP.UI.Screens.SpaceTracking.SetVessel (.Vessel v, Boolean keepFocus) [0x00000] in <filename unknown>:0

  at KSP.UI.Screens.SpaceTracking+<setRequestedVessel>c__IteratorD0.MoveNext () [0x00000] in <filename unknown>:0

This appears to be a bug in the stock code. It's not happy. I'm not sure why this would happen. It's not liking something.
All I can offer you is if you send my your save game file I can have a look see if there is anything obviously wrong. but can't guarantee anything.
The cost of uninstalling mods, generally, can break your save game file.

Link to comment
Share on other sites

Okay, i thought first, Amp Year just a fine display thing (what i was looking for as main reason and what i only found at Amp Year), After i installed it, i've seen that reserve power was coming with it, now this ressource is probably missing.

Just before, i used the savegame without AY and made a MK1 pod as vessel. Launched, so it sit on ramp. Went into Space Center, then Tracking Station and here i could select every vessel as normal. But only one time. After i left the vessel to Space Center and went back to Tracking Station, same situation where i can't access vessels. :rolleyes:

I havn't thought about game breaking mods. Most i tried and uninstalled were part mods like launchpad and kerbal stats or russian probes, all without issues. But these where not deep mods.

I wanna thank you for your offer. It's not neccessary. I can also live with Amp Year.

I uninstalled it, because i dislike reserve power (or better i havn't seen advantage of it), wanted to reduce parts and wanted to reduce the patches amount at start (without Amp Year on my game 700 patches less). Hoped to reduce the load a bit.

 

But even with my little issue, i wanna thank you for spending time while creating this mod and your fast response. I'm pretty sure as Realism-player i would see more reasons to use AY, than only use the EC-Production & Use display.

Link to comment
Share on other sites

54 minutes ago, LeLeon said:

Okay, i thought first, Amp Year just a fine display thing (what i was looking for as main reason and what i only found at Amp Year), After i installed it, i've seen that reserve power was coming with it, now this ressource is probably missing.

Just before, i used the savegame without AY and made a MK1 pod as vessel. Launched, so it sit on ramp. Went into Space Center, then Tracking Station and here i could select every vessel as normal. But only one time. After i left the vessel to Space Center and went back to Tracking Station, same situation where i can't access vessels. :rolleyes:

I havn't thought about game breaking mods. Most i tried and uninstalled were part mods like launchpad and kerbal stats or russian probes, all without issues. But these where not deep mods.

I wanna thank you for your offer. It's not neccessary. I can also live with Amp Year.

I uninstalled it, because i dislike reserve power (or better i havn't seen advantage of it), wanted to reduce parts and wanted to reduce the patches amount at start (without Amp Year on my game 700 patches less). Hoped to reduce the load a bit.

 

But even with my little issue, i wanna thank you for spending time while creating this mod and your fast response. I'm pretty sure as Realism-player i would see more reasons to use AY, than only use the EC-Production & Use display.

I'm not sure why your game is breaking...
As for ReservePower - You don't necessarily need to use it.
You can remove the reverse power battery parts folder (/GameData/REPOSoftTech/AmpYear/Parts/*) without an issue.
All command modules get 80 reserve power by default. You can remove this by removing the RESOURCE statements in file: GameData/REPOSoftTech/AmpYear/MMConfigAmpYear.cfg
Don't delete the rest of the file - you have to have the MODULE's defined or AmpYear will break if installed. It should then look like this:

Spoiler

@PART[*]:HAS[@MODULE[ModuleCommand],!MODULE[MechJebAR202],!MODULE[MechJebPod]]:NEEDS[AmpYear&!RealismOverhaul]
{   
    MODULE
    {
        name = AYCrewPart
    }
}

@PART[*]:HAS[@MODULE[ModuleCommand],!MODULE[MechJebAR202],!MODULE[MechJebPod]]:NEEDS[AmpYear&RealismOverhaul]
{   
    MODULE
    {
        name = AYCrewPart
    }    
}

@PART[*]:NEEDS[AmpYear]
{    
    MODULE
    {
        name = AYPart
    }
}

You can't remove the rest of the patches, I'm not sure I understand why you think MM patches cause issues? It only adds a small amount to start up time.
Without any reserve power your vessel will simply run out of EC when it drains all it's EC and AmpYear won't be able to use reservepower if there is none on-board.
You can't remove the ReservePower resource with AmpYear installed, or it will break.

Link to comment
Share on other sites

After looking at features i've seen dark side calculations. Great idea, i hate, when my scanner probes run out of energy in the dark sides.

So your Amp Years reserve will drain itself, after i'm running out of normal EC. Fine, fine. Will reserve power be filled with Near Future Electricals capacitors (blue energy bursts) ? I have seen that it's on compatible list.

Link to comment
Share on other sites

1 minute ago, LeLeon said:

After looking at features i've seen dark side calculations. Great idea, i hate, when my scanner probes run out of energy in the dark sides.

So your Amp Years reserve will drain itself, after i'm running out of normal EC. Fine, fine. Will reserve power be filled with Near Future Electricals capacitors (blue energy bursts) ? I have seen that it's on compatible list.

If you remove the parts and only have the ReservePower in command pods/probes then yes that is used once all EC runs out. You can Isolate the Reserve Power, there is an option for that in the AmpYear window under the "Reserve" button called "Isolate Reserve Power". If this is on AmpYear will not use any ReservePower when you run out of EC.
It will recharge any ReserverPower when your main EC gets to a certain percentage, it doesn't matter What is generating the EC as long as something on the vessel is generating it.
If you open the settings menu (Click the AmpYear button in the space center) the first setting is called "Reserve Battery Rechard Percentage". This is the %age at which your EC must be at before AmpYear starts charging any ReservePower. You can of course change this setting.
I have not checked what the Near Future capacitors do, if they generate EC into the vessel then the answer is yes.
If it is on the compatible list then that means that AmpYear recognisesparts in those mods and any EC they use or generate.

Link to comment
Share on other sites

 

On 09/05/2016 at 9:48 AM, Lennartos said:

Looked through the code a bit
Quite a lot going on, many modules taken into account.
Looots of string comparissons etc, and even worse is string parsing and splitting....
you will propably need to make some more detailed profiling on where it pays off more to improve, maybe EPS indeed is a big chunk...
But if its not, then i see no other way than not to rebuild the entire data 30 times a second.

There has to be a way to reduce the calculation needed, and only check production and consumption without doing all the hard work of building the part tree

On 09/05/2016 at 9:52 AM, JPLRepo said:

Yes - thanks. I will investigate. I will probably change the dictionaries (added for ESP) to be hashtables, and a number of other things can be done to improve things.

@Lennartos - Had a first run through cleaning up the code. In a preliminary test it appears it's reduced Garbage by 11% and CPU/GPU by about 85%. There is probably more that can be done and I need to do more testing to confirm these numbers. the biggest cost saving was converting the list of parts from a sorted dictionary to un-sorted. That obviously changes what you see in-game though as the parts list is no longer the same order every time.

Edited by JPLRepo
Link to comment
Share on other sites

Can someone do a video of how to use this?  I used to use fusebox and it was great.  Using this has me totally baffled.  I  have nearly died on my last three missions.  I get back to kerbin and resource manager says I have 100% EC, ampyear is red, I keep clicking on xfer reserve to main, and main ec turns white and goes to 99.9999 and yet I have no control over my ship and ampyear icon stay red.  I don't know what the heck it is doing???  I have 100% ec, the ampyear screen says I have 99+ % but everything is actiing like I am out of power.

 

Please someone record a video and link it.  Otherwise I am yanking  this mod before I get dead because my ship acts like I am out of power while resource display says I have 100% and my solar panels are in full sunlight and I am racing toward the atmosphere with no control of my ship!

Edited by ctbram
Link to comment
Share on other sites

7 hours ago, ctbram said:

Can someone do a video of how to use this?  I used to use fusebox and it was great.  Using this has me totally baffled.  I  have nearly died on my last three missions.  I get back to kerbin and resource manager says I have 100% EC, ampyear is red, I keep clicking on xfer reserve to main, and main ec turns white and goes to 99.9999 and yet I have no control over my ship and ampyear icon stay red.  I don't know what the heck it is doing???  I have 100% ec, the ampyear screen says I have 99+ % but everything is actiing like I am out of power.

 

Please someone record a video and link it.  Otherwise I am yanking  this mod before I get dead because my ship acts like I am out of power while resource display says I have 100% and my solar panels are in full sunlight and I am racing toward the atmosphere with no control of my ship!

I'm sorry to hear you are having issues. I'm not sure what your problems are. As little information is provided, other than "I have no control". Sounds like you have something else going on with your install, but without a lot I can't provide any assistance. I have on my list of to-do's new KSPedia pages. There are no videos that I am aware of. Try reading the OP and the change log as lots of info there. And Of course you are free to use whatever mods you wish.

Link to comment
Share on other sites

Small not quite a bug: "Isolate Reserves" (maybe) does not appear to be persistent (as in it persists through saving/load). At least, in my scenario, I had an isolated reserve, played a bit, game crashed, restarted the next day, no isolation. Thinking about it now, if I remember correctly, AmpYear saves settings on a clean quit, so that's probably when it saves final states/status of isolation (aside from periodically I'm guessing from looking at the log). Am I correct in my thinking? If so, then I guess I crashed before it could save and never mind this report. If no, then something for the issue tracker I guess.:)

Cheers.

 

And to the above user who is possibly having issues with the mod, check the subsystems tab and the parts section to make sure things are functioning correctly. Those can be a bit fussy at times. But it sounds like something else is at work.

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