[1.4] Moody (v2.6.0) A colonist mood dashboard

Started by GiantSpaceHamster, December 26, 2016, 10:52:52 PM

Previous topic - Next topic

[deleted]

[deleted]
0 (0%)
[deleted]
0 (0%)
[deleted]
0 (0%)
[deleted]
0 (0%)
[deleted]
0 (0%)
[deleted]
0 (0%)

Total Members Voted: 0

Harry_Dicks

Quote from: GiantSpaceHamster on January 03, 2018, 08:06:24 PM
Quote
Hey...I'm just gonna call you "Harry"...thanks for the feedback!

Moody only performs calculations for the view that is currently displayed. If Moody is minimized or hidden then no data is tracked and there shouldn't be any performance impact at all. If you want to check if Moody is impacting your performance just compare performance between minimized and restored states. Some views require a bit more processing to gather the data so some views may also affect performance differently. Similarly, if you are viewing colonists, then animals and prisoners are not recalculated. Having tons of animals should not impact performance if you're not in animal mode (same for colonists and prisoners).

Since we're on the topic, Moody also only recalculates 10% of the colonists per tick. Since at normal speed there are 60 ticks/second all colonists will still get updated at least 6 times per second (more at faster speeds). Also note that playing at a faster game speed will exaggerate any performance impact since the calculations are done on a per-tick basis, so faster ticks means more processing per unit of time needed.

Monitoring performance for all mods would likely have to be implemented in the base game, but tbh I haven't given it much thought.

EDIT: Now that I think about it, maybe I should consider throttling recalculations more when the game speed is higher. That might help performance for larger heavily modded games at faster speeds at least.

Thanks for the quick reply. That is great to know that Moody isn't recalculating that often. I also think that would be a great idea, throttling calculations at a higher speed. If only you could get everyone to do it!

Oh, and I'm so glad you've reminded me of what I was thinking about the other night. Do you think it would be possible for someone to make a mod that had a global tick rate increase/decrease slider? For example, make everything tick half as often? I understand things could seem laggy or a bit off, but could you not essentially double your performance with everything taking twice as long between calculations/updates? Am I a complete retard? It would be great though if you could, so that people like me with limited specs could actually play the game at a speed other than 0 and 1. Even if it made the game not as responsive, I could at least sit back and watch things go by at 2x properly.

GiantSpaceHamster

Quote from: Harry_Dicks on January 03, 2018, 08:19:53 PM
Thanks for the quick reply. That is great to know that Moody isn't recalculating that often. I also think that would be a great idea, throttling calculations at a higher speed. If only you could get everyone to do it!

Oh, and I'm so glad you've reminded me of what I was thinking about the other night. Do you think it would be possible for someone to make a mod that had a global tick rate increase/decrease slider? For example, make everything tick half as often? I understand things could seem laggy or a bit off, but could you not essentially double your performance with everything taking twice as long between calculations/updates? Am I a complete retard? It would be great though if you could, so that people like me with limited specs could actually play the game at a speed other than 0 and 1. Even if it made the game not as responsive, I could at least sit back and watch things go by at 2x properly.

So basically you want things to progress at the same pace, but calculate twice as much half as often (or at some other scaled rate)? That's an interesting idea. I'm not sure it would be wise (or stable) though. It would require major replacement of a huge swath of base game code via method redirection and might mean missed events and state transitions. I definitely wouldn't recommend it. I would recommend instead reporting performance details to Tynan if the base game itself is not as performant as you would like, and to mod creators if you can identify individual mods with major performance problems.

Harry_Dicks

I'm not even sure if I am explaining it right. But I was thinking about the mod Rot Tick Fix. "Lowers the temperature check interval for rotting items." is the description for it. Could we not do that for many of the other resource intensive things? Say like pathfinding, could there not be a mod that changes it so when an object is going from A to B, it only recalculates it's pathfinding while on it's way half as often, or make the rot tick interval even longer, or do temperature checks half as often, update moods half as often, check for whatever half as often, etc. Maybe I can better illuminate my idea with that. I'm not a programmer or anything at all though, but it was just something I was pondering the other day. Thinking on it more and I'm starting to doubt myself, though. Like pathfinding, maybe it is only calculated once, and only recalculated again if there is an interference.

But hypothetically, if something like that was possible, I was thinking on a more global/macro level. Just a universal slider or something like that. Make everything possible tick half as often, or however often you want based on whatever arbitrary limit there is.

GiantSpaceHamster

I believe that mod is overriding base game code and that approach would have to be done individually for everything in the game that can "tick". It would be a lot of work and a maintenance nightmare every time a new version comes out.

But to be fair I haven't looked at the code for that mod and there might be something I am unaware of to make it easier. You might want to ask in the mod forum.

Harry_Dicks

GiantSpaceHamster, I was curious, if you could add another "tab" onto Moody (like you have Summary, Thoughts, Temp, etc.) that could be called just a "Custom" tab. That you could have whatever condition you wanted in there, just like Numbers. Numbers is a mod almost just like yours, but is and entire page you open up, and I don't want to do that every time, and this is why Moody could be even more perfect (and I always recommend Moody over Colonist Bar too! :P )

Ok in Number, you can add any stat, skill, need, capacity, or other. The most beautiful thing about this is, you can for example see all of everyone's Bladder needs from Dubs Bad Hygiene, or you can see animals Blood for feeding your vampires from Rim of Madness. You can also toggle the views between not only Colonists, Prisoners, and Animals, but also Guests, Enemies, Wild Animals, Corpses, and Animal Corpses.

I think this would be great if you had a "Custom" tab in Moody to add whatever you wanted though. Whether it be a Needs bar, or to see Health % or anything that the player wants to see. I hate to keep mentioning Numbers, but really just like how they have it, you can pick from any of the stats categories you want, that way you get anything new that might be added by mods and you wouldn't have to go back in yourself and add it. I've attached some screenshots to show you what I mean. I understand if this is outside the scope of your project, but I thought it would be a good suggestion, if you plan on expanding it further. :D Thanks!




GiantSpaceHamster

A customizable view has been in the back of my mind for a while now but it's a huge overhaul to refactor to support that, so I'm just not sure it will happen. Maybe some day.

Harry_Dicks

Quote from: GiantSpaceHamster on January 15, 2018, 01:26:09 PM
A customizable view has been in the back of my mind for a while now but it's a huge overhaul to refactor to support that, so I'm just not sure it will happen. Maybe some day.

Alrighty, that's both acceptable and disappointing at the same time, though!  :'( ;D I primarily want it for Rim of Madness vampire's blood and TMagic for Stamina/Mana, and maybe Hygiene/Bladder for Dubs Bad Hygiene. Because those are all added from mods, no one would ever probably have a display for it, unless they let you choose your own things like Numbers :-\ Why can't we just copy Numbers from a big window, into a moveable, scalable window widget thing? That's not what Moody essentially is, with some modifications, no? I'm not a programmer, but it's just how it comes across to me. And of course I'm not advocating stealing someone's code. ::)

GiantSpaceHamster

Just in case you weren't aware, you can change which need is displayed on the first view in Moody by right clicking the column header and selecting from the dropdown. That doesn't address your request to be able to see more than one at once, but maybe it will help a bit.

Harry_Dicks

Quote from: GiantSpaceHamster on January 15, 2018, 02:09:12 PM
Just in case you weren't aware, you can change which need is displayed on the first view in Moody by right clicking the column header and selecting from the dropdown. That doesn't address your request to be able to see more than one at once, but maybe it will help a bit.

Oh really? I didn't remember that. So I could display Mana, or Blood? Just one at a time? If that's the case, just give use a couple more slots like that! ;D

mmance

I have two issues:

1) The link you provided to 2.2.2 links to a zip for 2.2.2 but the version and changelog indicate it may be 2.2.1.  I just want to make sure I am on the lastest.

2) When using RimMagic, you can raise undead to be colonist.  The undead give me visual errors when I am on the summary or thought tab with this error in the log:

QuoteNullReferenceException: Object reference not set to an instance of an object
at WAMH_Code.ThoughtWorker_WAMH.CurrentStateInternal (Verse.Pawn) <0x0014e>
at RimWorld.ThoughtWorker.CurrentState (Verse.Pawn) <0x0002b>
at (wrapper dynamic-method) RimWorld.SituationalThoughtHandler.TryCreateThought_Patch1 (object,RimWorld.ThoughtDef) <0x000a8>
at RimWorld.SituationalThoughtHandler.CheckRecalculateMoodThoughts () <0x00185>
at RimWorld.SituationalThoughtHandler.AppendMoodThoughts (System.Collections.Generic.List`1<RimWorld.Thought>) <0x0004d>
at RimWorld.ThoughtHandler.GetAllMoodThoughts (System.Collections.Generic.List`1<RimWorld.Thought>) <0x000ce>
at RimWorld.ThoughtHandler.GetDistinctMoodThoughtGroups (System.Collections.Generic.List`1<RimWorld.Thought>) <0x0002c>
at RimWorld.ThoughtHandler.TotalMoodOffset () <0x0002c>
at RimWorld.Need_Mood.get_CurInstantLevel () <0x00021>
at RimWorld.Need.get_CurInstantLevelPercentage () <0x00016>
at Moody.DataCache.UpdateMood (Verse.Pawn) <0x00184>
at Moody.DataCache.Recalculate (Verse.Pawn) <0x0013a>
at Moody.DataCache.UpdateCache (bool) <0x00348>
at Moody.MoodyWindow.WindowUpdate () <0x00012>
at Verse.WindowStack.WindowsUpdate () <0x00050>
at Verse.UIRoot.UIRootUpdate () <0x0003c>
at RimWorld.UIRoot_Play.UIRootUpdate () <0x00024>
at (wrapper dynamic-method) Verse.Root.Update_Patch1 (object) <0x0008d>
at Verse.Root_Play.Update () <0x00024>


(Filename:  Line: -1)

Thank you, your mod is awesome btw.

Harry_Dicks

#145
I really hope that in some future update for Moody that it is made to be similar to Numbers, in that the player can just choose among the list of everything possible to view. That way any new things added in by mods, for example Dubs Bad Hygiene adds in the hygiene and bladder bars, then it could offer these as options to view to the player. With Numbers, you can still add these in to see them, or blood from vampires, whatever.

It would be really awesome if Moody would just pull from all of the lists that the game has, and let the player decide, based upon what they have loaded and need to see because of whatever mod configuration they have. Honestly, I don't think the author would ever be able to make just one configuration, or even enough different presets to choose from, that would satisfy everyone. He would never be able to keep up with all of the new things added in from mods either, or at least I wouldn't envy the position of one doing such things.

Although, I am not sure if that is even the direction that the author wants to take Moody. So of course I know this is only my rambling opinion, but I can't help but imagine how much more perfect this mod could be.

Anyway, I have been wondering this for some time, and now I have seen others post about it today, so I wanted to get one final confirmation. I would like to know if Moody is actually causing any CPU load while it is minimized? I understand there will always be a small amount to have the program running, but I am curious, if Moody is "minimized", does that mean it is no longer performing any calculations? As in, it isn't thinking about all of the temperatures of pawns, or categorizing the thought groups, or any of the other things that Moody does?

I've heard responses from both ends. Some saying that the mod does absolutely nothing while it is minimized. And I've had others say that even if the had Moody minimized, it brought their FPS from 144+ to 90ish. When the only action they performed was turning Moody off, then their FPS resumed being over 144.

Would it be possible, please, if the author, or anyone more knowledgeable on the subject could please chime in and elaborate on this matter? Another question that sort of stems from that: do other mods behave in the same way, in that if they are minimized they will not be performing calculations? Or is this more of a question that depends entirely on how the mod was written? I guess I am more wondering about how some mods idle, and if they do, how much CPU load they are adding in. Reason being that I am using an older PC, so every little bit of processor juice that I can save counts ::)

GiantSpaceHamster

Moody performs no calculations while minimized or hidden. Only data for the active view is calculated so each view may have different performance implications.

mmance

Can I turn off moody for specific colonist?

GiantSpaceHamster

Quote from: mmance on March 04, 2018, 02:27:35 PM
I have two issues:

1) The link you provided to 2.2.2 links to a zip for 2.2.2 but the version and changelog indicate it may be 2.2.1.  I just want to make sure I am on the lastest.

2) When using RimMagic, you can raise undead to be colonist.  The undead give me visual errors when I am on the summary or thought tab with this error in the log:

QuoteNullReferenceException: Object reference not set to an instance of an object
...

Thank you, your mod is awesome btw.

1) Thank you for the heads-up, I'll look into it.

2) Looks like RimWorld is throwing an error when I try to grab one of the need values, likely because the undead doesn't have that need. I'll look into checking for its existence before grabbing the value to avoid this error.

QuoteCan I turn off moody for specific colonist?
No, sorry

GiantSpaceHamster

Quote
I really hope that in some future update for Moody that it is made to be similar to Numbers, in that the player can just choose among the list of everything possible to view. That way any new things added in by mods, for example Dubs Bad Hygiene adds in the hygiene and bladder bars, then it could offer these as options to view to the player. With Numbers, you can still add these in to see them, or blood from vampires, whatever.

If you right click on the need column in the summary view you can switch needs. Custom needs added by mods should be listed here. If the stuff you're talking about aren't needs or thoughts or covered under an existing mechanism then I'm not sure what you want exactly.