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!
< >
Viser 1-15 af 15 kommentarer
battlemage64  [udvikler] 16. okt. 2019 kl. 16:19 
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  [udvikler] 16. okt. 2019 kl. 16:26 
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 kl. 15:27 
Oprindeligt skrevet af 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  [udvikler] 28. apr. 2020 kl. 15:48 
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 kl. 17:26 
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  [udvikler] 28. apr. 2020 kl. 17:30 
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  [udvikler] 1. maj 2020 kl. 6:40 
Thank you! I hope so.
keepercraft 16. maj 2020 kl. 12:49 
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
Sidst redigeret af keepercraft; 16. maj 2020 kl. 13:20
battlemage64  [udvikler] 19. maj 2020 kl. 12:26 
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. maj 2020 kl. 14:33 
@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:
Sidst redigeret af keepercraft; 19. maj 2020 kl. 15:36
battlemage64  [udvikler] 19. maj 2020 kl. 15:31 
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. juni 2020 kl. 15:14 
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  [udvikler] 5. juni 2020 kl. 15:38 
It should be fixed now. (If it isn’t, let me know!!!)
Think3r 6. juni 2020 kl. 9:45 
Thanks for letting me know, but I can't test it, now.
< >
Viser 1-15 af 15 kommentarer
Per side: 1530 50