Jump to content

[1.3.0] Kerbalism v1.2.9


ShotgunNinja

Recommended Posts

@leomike I noticed you are not using the ProfileScope how it was meant to be used. You need to use it in this way:

  void my_function()
  #if PROFILER
  { using(var prof = new ProfileScope("my_name"))
  #endif
  {
    // do stuff here
  }
  #if PROFILER
  }
  #endif

so that the Dispose() method is called automatically at scope exit (function return, exceptions, etc). Alternatively you just use Profiler.Start()/Stop() directly, but then you have to call Stop() at any potential scope exit manually.

 

@subyng Yes, take a look here. In the Features section.

Open Kerbalism/Profiles/Default.cfg and delete the line that read "@Kerbalism:FOR[EnableSignal] {}" to disable the signal system.

To disable storms instead, set "StormDuration" to 0 in Kerbalism/Settings.cfg

Edited by ShotgunNinja
Link to comment
Share on other sites

18 minutes ago, ShotgunNinja said:

I had a quick look at some of leomike changes and there is interesting stuff there for sure, but also most changes are widespread and he changed the formatting style and naming conventions too. If they were in form of github pull requests and atomic it would have been easier to evaluate and eventually integrate them.

Sorry about that, I couldn't get Monodevelop to match your formatting and then thinking you were not coming back started moving things to the C# standard CamelCase as a way of learning what does what. If I have enough time I might try to redo my changes without changing any formatting so I could submit a pull request.

@Kerbos Are you using my build? Are you using RemoteTech? If so, that is expected, RemoteTech isn't supported for background processing.

@jlcarneiro Update did change some things in the scrubbers, but not for monitor/planner. I haven't had time to look into that.

Link to comment
Share on other sites

36 minutes ago, ShotgunNinja said:

@Kerbos I don't see any of the problems you report. Please try if the problems are present in the official DLL and let me know.

Just tried the last version, 1.0.3, and it's working again, dunno why it happen, but if I let a satellite dark on 1% energy it would never deplete, not happening now so whatever it was it's fixed (also my save games are kind of a mess due adding/deleting mods).

My realism profile still works too, but I can't really tell if food is being consumed.

 

7 minutes ago, leomike said:

@Kerbos Are you using my build? Are you using RemoteTech? If so, that is expected, RemoteTech isn't supported for background processing.

Yup, also using RT2, but now the consumption is going down as expected, I wish I didn't had to use remotetech but it has really cool looking antennas and the low resistance to reentry or just moving at match 1 rip them off, adds a layer of difficulty that I enjoy :P

Edited by Kerbos
Link to comment
Share on other sites

@leomike Its okay :) I will take a better look, it seem a lot of work went into it.

BTW in next version I modified heavily the cache system: now it is a FIFO eviction cache, and only 1 vessel is evicted every simulation step. The resource cache instead was rewritten and now is a layer that manage two caches: a 'foreground' (for loaded vessels) and a 'background' one (for unloaded vessels). The foreground one work pretty much like Cache.Resource* right now, the background one instead is also a FIFO eviction cache and 1 vessel/resource pair is evicted every simulation step. It does avoid accessing the KSP serialization data structure for consuming resources, instead relying on 'synchronizing back' with it at eviction time.

Right now it work like a charm and should practically decouple all environment/resource calculations from the number of vessels.

Link to comment
Share on other sites

@ShotgunNinja I can take a look at making my changes pull-compatible if I have time, but I don't want to duplicate the work if you are already working on this. Your approach seems similar to what I ended up doing except I only sync back on KSP restart or when a vessel is loaded/unloaded. You probably want to look at my Background.Processor class, that's the best solution I found to handle the EC issue (just capping at the end posed problems based on the order in which the parts were cycled through). Another thing I added is cache a list of all modules that support background processing for each vessel, this also disconnects the processing from the number of "random" parts (although now that I think about it a later change might have partially broken that... will need to look into this).

Link to comment
Share on other sites

@leomike I had a very quick look at the Processor, but is really interesting. One of the reason i implemented this new cache is that it may allow me to let the resource amount 'overflow/underflow' and then get clamped at the end of the background simulation step, to try to solve that high timewarp inconsistency (pretty much the solution you proposed a couple months ago). However, I realize that a lot of subtle problems can emerge if I do it that way, like: how do you evaluate if a resource is available for lets say a converter if the amount can underflow? And so your processor may be the solution for that. It basically is a 'deferred consumption/production', if I got it right.

Link to comment
Share on other sites

@ShotgunNinja, @leomike I have no idea how anything of that works, but just tested both kerbalism.dll on 1.0.3 and both of them work as intended on EC background consumption, with or without RemoteTech, but with RT2 the consumption seems a bit broken, like it's not taking into account the warp, as a result if u put a satellite full energy and timewarp the EC rate goes down at the same rate as normal time, but that happens with RT2 antennas, gotta test with stock antennas or something else

Link to comment
Share on other sites

@ShotgunNinja That was the only solution to that problem I could find. I had to many the assumption that only the EC is affected by the warp problem (which should really be the case most of the time). This also supports scaling down any production that uses EC (eg: drill, converter) and scaling up EC production based on need (eg: fuel cell).

@Kerbos Not sure if that could be an issue with RT2, from what you are saying it sounds like they are already doing some minimal background simulation (which surprises me as I have never heard of it before).

Link to comment
Share on other sites

30 minutes ago, leomike said:

@Kerbos Not sure if that could be an issue with RT2, from what you are saying it sounds like they are already doing some minimal background simulation (which surprises me as I have never heard of it before).

I've just found out what it was, somehow kerbalism was taking priority nullifying RT2 but leaving every functionality intact (reinstalled 1.0.3, this time deleting everything and not just overwriting), so now I don't have a background EC consumption... and it feels pretty much like cheating myself so I'm giving up on RT2 which brings me to a single question for @ShotgunNinja

The relay option isn't a simplified version on how antennas work? I mean by using relay I would only need 1 single antenna per satellite on geosync orbits right?

Almost forgot, removing RT2 also removed every ship I had on my saved game because of nonexistent parts, so how could I manually replace those RT2 antennas with yours?

Edited by Kerbos
Link to comment
Share on other sites

Hi I am having an issue I suppose and I can't find the solution here.

With Kerbalism installed, I can't see any antenna range. If I am not mistaken, it is supposed to show a range somewhere

 

Edit: also, probes don't require a direct line of sight to be controlled. Are they supposed to loose control when they are on the dark side of Kerbin?

Edit again: my capsule is not consuming any electricity or food. Actually the only food I can read is the extra container I am carrying, but the readings keeps staying at the same level even at full time speed acceleration

 

Screenshot of the antenna

 

Mod list

Spoiler

KSP: 1.1.3 (Win32) - Unity: 5.2.4f1 - OS: Windows 10  (10.0.0) 64bit
Filter Extensions - 2.6
Toolbar - 1.7.12
Ambient Light Adjustment - 2.5.8.5
B9 Part Switch - 1.4.3
CactEye 2 - 1.1.3.4
Community Resource Pack - 0.5.4
Connected Living Space - 1.2.2
Contract Configurator - 1.14
CC-CP-SCANSat - 0.6.0.1
Contract Pack: Clever Sats - 1.1.0.1
Contract Pack: Field Research - 1.1.7
Rover Missions - 0.1.4
Contract Pack: Unmanned Contracts - 0.3.20
Crowd Sourced Science - 3.0.2
CustomBarnKit - 1.1.9
Deadly Reentry - 7.4.7
DMagic Orbital Science - 1.3.0.2
Contract Parser - 1.0.4
Contracts Window Plus - 1.0.6.4
Progress Parser - 1.0.5
Ferram Aerospace Research - 0.15.7.2
Interstellar Fuel Switch - 2.1
RasterPropMonitor - 0.27
Kerbal Attachment System - 0.5.9
Kerbal Engineer Redux - 1.1.1
Kerbal Joint Reinforcement - 3.2
Kerbal Inventory System - 1.2.12
KSP-AVC Plugin - 1.1.6.1
Infernal Robots - 2.0.5
ModularFlightIntegrator - 1.1.6
NearFutureConstruction - 0.6.4
NearFutureElectrical - 0.7.5
NearFuturePropulsion - 0.7.3
NearFutureSolar - 0.6.2
NearFutureSpacecraft - 0.5.1
SCANsat - 1.1.6.3
SETI-Contracts - 0.9.7.1
Ship Manifest - 5.1.1.2
Spacetux - 0.3.10.1
TAC Fuel Balancer - 2.8
TarsierSpaceTechnology - 6.4
Kerbal Alarm Clock - 3.7.1
Alternate Resource Panel - 2.8.1
Transfer Window Planner - 1.5.1
TweakScale - 2.2.13
Unmanned before Manned - 1.0.9.4
VenStockRevamp - 1.9.2
KSP Interstellar Extended - 1.9.6

 

Edited by Bersagliere81
Added question
Link to comment
Share on other sites

3 minutes ago, Bersagliere81 said:

With Kerbalism installed, I can't see any antenna range. If I am not mistaken, it is supposed to show a range somewhere

Yeah I've noticed that too, but right clicking on the antenna while building the ship shows the range, but it would be nice to see it on the description & data thing when you hover ur mouse over

Link to comment
Share on other sites

2 hours ago, ShotgunNinja said:

@jlcarneiro I am unable to reproduce your issue. What DLL are you using? Try the official one, and to be sure launch a new vessel and let me know.

@ShotgunNinja, I tested with your 1.0.3 dll and I think I got the same results:

Let me make it clear: I think either calculation is valid, my problem is that we are getting BOTH at the same time (one in the Planner and the other "in the field")... :(

Link to comment
Share on other sites

I'm having an issue with the relay system - I have three satellites in orbit of Kerbin with enough signal power to cover the entire solar system, and I have a satellite orbiting Polta (a moon of Urlum, a planet from OPM) that's working properly. Yet when I try to land a rover on Polta - with the orbiting satellite within range and with relay enabled - when I decouple the transfer stage with the stronger antenna on it, leaving the smaller antenna that's on the rover itself, I lose connection. The antenna is more than strong enough to reach the orbiting satellite, but it seems like the relay isn't working for some reason.

Is anyone else having this issue? If I need to post any screenshots or save files, I'll do that.

Link to comment
Share on other sites

2 minutes ago, yorshee said:

I'm having an issue with the relay system - I have three satellites in orbit of Kerbin with enough signal power to cover the entire solar system, and I have a satellite orbiting Polta (a moon of Urlum, a planet from OPM) that's working properly. Yet when I try to land a rover on Polta - with the orbiting satellite within range and with relay enabled - when I decouple the transfer stage with the stronger antenna on it, leaving the smaller antenna that's on the rover itself, I lose connection. The antenna is more than strong enough to reach the orbiting satellite, but it seems like the relay isn't working for some reason.

Is anyone else having this issue? If I need to post any screenshots or save files, I'll do that.

I had the same issue, I use the standard solar system but when decoupling the lander the relays act like they have no signal. When I do know is check relay via the link line and then immediately switch to the lander and continue. Hope that helps.

Link to comment
Share on other sites

2 hours ago, Kerbos said:

Yeah I've noticed that too, but right clicking on the antenna while building the ship shows the range, but it would be nice to see it on the description & data thing when you hover ur mouse over

Actually no, at least for me it's not working. Even food and electricity seem to be messed up. I have no idea if it is conflicting with any of my mods, but I don't have TAC-LS or RT installed

Link to comment
Share on other sites

4 hours ago, ShotgunNinja said:

@leomike so that the Dispose() method is called automatically at scope exit (function return, exceptions, etc). Alternatively you just use Profiler.Start()/Stop() directly, but then you have to call Stop() at any potential scope exit manually.

I figured I wasn't supposed to call the Dispose function but for some reason the .Dispose seemed to never be called. I would see the entries but all had 0 calls/0 ms (which from looking at it was because the entries are created on creation but the values updated on Dispose). Didn't want to bother figuring out why so I just decided to dispose of them myself.

Link to comment
Share on other sites

4 minutes ago, yorshee said:

The lights are at 0%, they need to be activated for plants to grow iirc.

Nope, there is daylight also the greenhouse part coming with kerbalism is working

 

EDIT: indeed you are right, the KK parts works only with lights on , is this intended @Nils277 and @ShotgunNinja ?

Edited by brusura
Link to comment
Share on other sites

Just now, brusura said:

Nope, there is daylight also the greenhouse part coming with kerbalism is working

Ah, I see. The Planetary Base Inc. parts aren't very well balanced at all (i.e. the oxygen containers only have 200 units of oxygen in them), I think that may have something to do with it. I haven't used the Planetary Base Inc. greenhouse yet but the .cfg file probably makes it so nothing grows at all with 0% artificial light.

Link to comment
Share on other sites

42 minutes ago, Bersagliere81 said:

Actually no, at least for me it's not working. Even food and electricity seem to be messed up. I have no idea if it is conflicting with any of my mods, but I don't have TAC-LS or RT installed

tvIGIla.png

On the other hand, manage to migrate a few of my satellites from RT2 to kerbalism system (pic Nº 3) and I'm not really obsessed with details but this geosat is missing something, can't figure what :huh:. I'll leave it for Jeb and the crew to get this working.

 

Link to comment
Share on other sites

@ShotgunNinja and @leomike, I did some tests and I think I finally got some data that can help you debug Kerbalism on the O2 resource duration.

I started a new sandbox savegame and built a simple ship (only a mk1 and a mk2 landing cans). It had 15000 units of O2, like Luna 4 my craft that had problems. I put it in orbit (through KCT simulation) and its O2 resource consumption was consistent with the Planner. So far, so good...

But, when I warped a little (4x), its O2 resource consumption quickly oscilated (from 24d to 7d, 9d and again to 23d and something). I think the problem is related to recycling and resource calculation during warp! Maybe something like what happens do EC during warp...

I can't record a movie, but I think you could simulate it easily, just put a craft in orbit, open its details panel and warp a little bit... :wink:

EDIT: I think I only noticed the problem when in orbit of Mun, because I warped to the SOI change...

Edited by jlcarneiro
Link to comment
Share on other sites

Just now, leomike said:

@jlcarneiro That's something I would expect with discrete resource consumption but not continuous... Very strange. Your times don't seem to line up with wwhat I remember of the default profile, do you use a different one? 

My times? Don't quite get it... The numbers I said (7d, 8d, 23d and something)? They change VERY quickly, I think I saw these numbers, but they might be a little different. What I want to emphasize is that when drop out of warp the O2 numbers change and quickly return to something near the original value (like it was calculating the depletion)... Sometimes the difference between before the warp and after are larger...

Do you want the craft file? It's VERY simple, just two pods connected and for small (black) food containers...

Link to comment
Share on other sites

@jlcarneiro i was referring to the depletion times, not sure how it gets 24 days with 50% scrubbers but I might just be wrong. I'll try to take a look later this week but might take a few days to get to it. I'm pretty sure this is related to the know issue with the depletion time calculations, shouldn't impact actual survival times.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...