RimWorld

RimWorld

People Can Change
Performance issues
So, fellow programmer here and entirely aware how unhelpful this advice is; but reallllly not sure how to provide better feedback, as I'm not familiar with any C# debugging tools: there seems to b a pretty serious performance problem with this mod.

It's easy enough to reproduce, AFAICT: Install just this mod, and a TPS meter like TicksPerSecond; start a new colony, dev-mode in ten or so colonists, and then set speed-4. Without this mod, I see a full 900 TPS on my machine; as soon as I enable this mod, that halves to around 450-500.

The same applies to my actual colonies; I've had slow colonies midgame for a while now, and I finally spent the day binary-searching through my mod-list, trying to figure out which one slowed everything down the most ... I was expecting one of the hauling mods like PickUpAndHaul, While You're Up, Share The Load - but it turned out that just disabling People Can Change nearly doubles my TPS.

I'm not a modder, so maybe my intuition is off here; but I can't imagine that this should be a byproduct of this sort of mod? So I suspect some sort of bug, invoking the "should a person change" routine on every tick or something?

Hope this feedback is helpful! Fly safe!
< >
Showing 1-15 of 15 comments
battlemage64  [developer] 16 Oct, 2019 @ 4:19pm 
I didn't see this discussion until now (is there a way for me to be alerted about any time someone starts one?). I think that's because there's some code that runs every game tick (in O(n) time) that's slowing it down. I'll try to work on that. My computer isn't great, so I wouldn't have noticed a tick drop. I'll get working on that.
battlemage64  [developer] 16 Oct, 2019 @ 4:26pm 
Update: I tested it on my heavily modded midgame save, didn't get lower than 800 tps. See if the new update somehow fixed it, although I'm guessing it didn't... What machine do you have?
SubmarineMan 28 Apr, 2020 @ 3:27pm 
Originally posted by battlemage64:
Update: I tested it on my heavily modded midgame save, didn't get lower than 800 tps. See if the new update somehow fixed it, although I'm guessing it didn't... What machine do you have?

Well i've noticed you're using "onMap" tick which explain the huge performance impact almost doubling the frame time.

I would not do that, instead try patching different incidents or hijacking some other tick (Something less frequent to say the least) for your update.

I'm checking psychology for a possible integration.
battlemage64  [developer] 28 Apr, 2020 @ 3:48pm 
Thank you for the response. By a nice coincidence, actually, just yesterday I figured out a way to make the onTick code run much less often (and therefore not cause lag while still accomplishing the same purpose)! I'll add it with the next update.
SubmarineMan 28 Apr, 2020 @ 5:26pm 
Btw, try doing it by using the pawn log rather recording every event your self. I can help you with making a more deterministic change to a pawn's bio, even integrate some real AI if you want so for determining what a trait "mean", then matching its description meaning with the pawn experience.
battlemage64  [developer] 28 Apr, 2020 @ 5:30pm 
What "pawn log" do you mean? That could be useful. (I'm an amateur programmer and don't have much time to put into modding so I haven't studied the game's code as well as some have)
Heh, I'm still subscribed to this thread, even though I haven't played the game in ages — I just saw this, and wanted to say: hey, you're really cool for taking feedback well; and don't worry about being new to this. You'll pick it up quickly! <3
battlemage64  [developer] 1 May, 2020 @ 6:40am 
Thank you! I hope so.
keepercraft 16 May, 2020 @ 12:49pm 
I test my mod list performance, and this mod hit much on performance.
I try on hardest stres-test, and got like 4-6fps drop from 45fps.

test conditions :
tribal 5 colonist
max speed game
max view (camera+)
max map size
tropical climate
Last edited by keepercraft; 16 May, 2020 @ 1:20pm
battlemage64  [developer] 19 May, 2020 @ 12:26pm 
I just published an update that *should* reduce lag (emphasis on "should" -- I don't have enough time to playtest everything right now, and I play on Mac anyway, so I don't know how it'll compare to another machine). Let me know if the lag is still bad. I tested it with TicksPerSecond on a map with 50 pawns and it reduced the tick lag from ~400 TPS to ~50 (at 4x speed), so that's some improvement so far. Still working on making it better.
keepercraft 19 May, 2020 @ 2:33pm 
@battlemage64 Nice to hear that.
When i programing, i uses two conditions on multi-threaded/parallel app:
-you don't need to call your main method every tick;
-static stock (array memory) is always faster.
:steamhappy:
Last edited by keepercraft; 19 May, 2020 @ 3:36pm
battlemage64  [developer] 19 May, 2020 @ 3:31pm 
good advice

The reason it didn’t use either of those tips is because I made it like 2 years ago, before I I Ee what an array was or how to do anything other than every tick :) thank you!
Think3r 5 Jun, 2020 @ 3:14pm 
So, are the performance issues done, for now? If so, you might want to update the mod's entry in the slow mod list[docs.google.com].

Or do you still plan to realize keepercraft's suggestions?
battlemage64  [developer] 5 Jun, 2020 @ 3:38pm 
It should be fixed now. (If it isn’t, let me know!!!)
Think3r 6 Jun, 2020 @ 9:45am 
Thanks for letting me know, but I can't test it, now.
< >
Showing 1-15 of 15 comments
Per page: 1530 50