Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
I looked at the GitHub repo and read the Harmony_PawnRenderTree.cs file that was recently merged into main. The Prefix method is the call that is chewing up frame time. Specifically, the WornApparel.Find which seems to be running for every pawn on the map every frame.
I was thinking that a simple check ahead of the find, could see if the pawn is capable or wearing the Mousekin hood. If the pawn is not, the Prefix function could immediately exit and not spend time searching the pawn's worn apparel.
I was also thinking that you could probably cache a list of all pawns that have hoods and make sure to expire the cache every x number of seconds. I downloaded the source but was unable to get it to compile properly. I am not used to using the VFECore library and I don't think the Dll I am using is getting the patched versions of some of the base Rimworld libraries (it was complaining about overrides not existing on the base class of Page). I tried using the Discord link in the Readme file, but it looks like it is expired. So, I figured I would post here.
So what you're saying is that, `WornApparel.Find()` is still pretty computationally expensive.
What do you mean by "capable"?
AFAIK, the only way to determine if the hood render node needs to be added to the pawn, is to check whether the pawn is wearing an apparel that has the hood comp. The hood is no longer a separate def, nor is it a standalone piece of apparel.
I'm not sure how to cache this information in a sensible manner, without causing delays between when a player toggles a hood, and when the hood appears/disappeared.
I am using Publicized versions of the RimWorld base DLL.
I've updated the Discord link in the README, but there is also a working link on the Steam workshop description page.
What I meant about capable is that the prefix method is running on every pawn on the entire map every frame. I am sure there are some pawns that shouldn't be checked. I'm assuming ones that don't have mouse sized heads or ones that no longer have a head would need to be checked. I also don't know enough about RimWorld yet to know if it culls out pawns that aren't displayed (i.e. they are positioned off screen).
As for the version I am running - I assume (maybe incorrectly) that since you have already merged your branch into main that you pushed it out to the Steam workshop. I probably should have checked that first. XD
Yeah, when I push to master, that doesn't mean I release it to Steam right away - this is because I am concurrently working on various other improvements alongside a major feature update, and I felt it would be unwise to publish on Steam an early release with the WIP implementation.
I usually announce actual releases with a boilerplate message within the mod's main comments section, on Discord and the Ludeon forums. If you don't see any announcements about formal releases with version numbers, then it's not a real release ;)