边缘世界 RimWorld

边缘世界 RimWorld

People Can Change
ELLIOTTCABLE on Discord 2019 年 9 月 20 日 上午 11:04
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!
< >
正在显示第 1 - 15 条,共 15 条留言
battlemage64  [开发者] 2019 年 10 月 16 日 下午 4: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  [开发者] 2019 年 10 月 16 日 下午 4: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 2020 年 4 月 28 日 下午 3:27 
引用自 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  [开发者] 2020 年 4 月 28 日 下午 3: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 2020 年 4 月 28 日 下午 5: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  [开发者] 2020 年 4 月 28 日 下午 5: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)
ELLIOTTCABLE on Discord 2020 年 4 月 30 日 下午 6:34 
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  [开发者] 2020 年 5 月 1 日 上午 6:40 
Thank you! I hope so.
keepercraft 2020 年 5 月 16 日 下午 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
最后由 keepercraft 编辑于; 2020 年 5 月 16 日 下午 1:20
battlemage64  [开发者] 2020 年 5 月 19 日 下午 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 2020 年 5 月 19 日 下午 2: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:
最后由 keepercraft 编辑于; 2020 年 5 月 19 日 下午 3:36
battlemage64  [开发者] 2020 年 5 月 19 日 下午 3: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 2020 年 6 月 5 日 下午 3: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  [开发者] 2020 年 6 月 5 日 下午 3:38 
It should be fixed now. (If it isn’t, let me know!!!)
Think3r 2020 年 6 月 6 日 上午 9:45 
Thanks for letting me know, but I can't test it, now.
< >
正在显示第 1 - 15 条,共 15 条留言
每页显示数: 1530 50