RimWorld

RimWorld

Ore Overlay
48 Comments
Gravenwitch 5 hours ago 
I can confirm another scenario with extreme lag coming from this mod when the overlay is active. Under certain rare circumstances this mod causes drops to under 1 fps, with 1000ms delays / second showing up w/ dubs performance analyzer. I believe occurs when deep drilling is taking place, or when an anomaly pit gate opens. I recommend you add some code preventing the overlay from updating more than once per real-time second to catch edge cases like this.

I will get back to you if I can 100% confirm what action causes this. Sorry to keep bothering you about this, I appreciate your work!
Gravenwitch 19 Jul @ 10:37pm 
Lag seems to be significantly improved! I am still seeing very regular calls to regenerate mesh and am still seeing some outsized performance impact (like -20 fps on average) but it is nowhere near as debilitating to leave the overlay on compared to pre-patch
MrXarous 17 Jul @ 4:21pm 
in Odyssey when going to a new map via gravship I get this NRE:

Exception in UIRootUpdate: System.NullReferenceException: Object reference not set to an instance of an object
[Ref 7EEB6D2]
at OreOverlay.HarmoneyPatchUpdate.Postfix (Verse.DeepResourceGrid __instance) [0x00005] in <b41d1804311846b99587e50f8ffc3cde>:0
at RimWorld.MapInterface.MapInterfaceUpdate () [0x00279] in <981a33edf24d499488b0f820d94638e1>:0
- POSTFIX Spacemoth.OreOverlay: Void OreOverlay.HarmoneyPatchUpdate:Postfix(DeepResourceGrid __instance)
at RimWorld.UIRoot_Play.UIRootUpdate () [0x00015] in <981a33edf24d499488b0f820d94638e1>:0
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch1 (string)
RimWorld.UIRoot_Play:UIRootUpdate ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Root.Update_Patch1 (Verse.Root)
Verse.Root_Play:Update ()
Space Moth  [author] 17 Jul @ 6:36am 
I've just dropped an update that should hopefully vastly decrease the lag on maps.
Now on startup and after a major refresh the mod will make a list of all the known ores regardless if they are shown or not.
Each time the overlay refreshes only these known ores are checked for update instead of every cell on the map.

This should hopefully fix the issue. Only time it might not work right is if a meteor crashes with ore, but turning the overlay off and on again should prompt an update.

I am glad the mod helps! I always found it frustrating having to slowly check along the cliffsides or stripmine to find ores so a nice high contrast way to find them made sense to me.
Gravenwitch 16 Jul @ 7:45pm 
I suggest you only update the overlay when mining has occurred recently, or other building destruction occurs. You can still update it manually when the overlay is opened, or every long time (> a few minutes) to catch edge cases of new ores appearing.

I am working on a more permanent fix, and can get back to you if I succeed. I can provide some (scuffed) ways to detect mining if you need one, but you are more experienced in Rimworld modding than I am and I was pushy enough already.

I greatly enjoy the mod! It really helps the mad mining rush when hitting a new map w/ the gravship start.
Space Moth  [author] 15 Jul @ 12:15am 
@Gravenwitch Thank you for the information here, I admit I am a little at a loss on how best to fix it but I will work on it again soon. I have noticed keeping the game paused with the overlay active stops the lag and stutters, so the RegenerateMesh being the source makes sense.
Gravenwitch 14 Jul @ 4:41pm 
I tested on a brand new save with only this mod and dub's performance analyzer. The issue is less serious but still present. At the beginning of the save there was no performance impact with the overlay on, but when constructing buildings (walls, benches, beds, etc) the mini-freezes return, though are much shorter on an equivalent number of walls. ~300 walls with heavily modded rimworld resulted in 600ms delays once a second, in vanilla it resulted in 150ms delays once a second. It specifically seems only affected by player made buildings, with walls affecting it much more than other buildings. Floors do not affect it at all. I did a second start on a crater map that was 80% mountain and performance was identical to open plains.

The specific source of the lag is RegenerateMesh from CellBoolDrawerUpdate in OreGridDraw, though your implementation doesn't look different from similar UI elements when I checked, so I am not sure why it is so heavily affected by this.
Gravenwitch 14 Jul @ 2:41pm 
Heads up, I am experiencing microfreezes every second or two (framerate goes from 90 to ~30 and everything pauses for a 16th of a second, more serious when moving the camera) when the overlay is active. Dubs performance analyzer shows OreOverlay.HarmoneyPatchUpdate:Postfix as being responsible for ~600ms delays once a second.

This only occurs when the overlay is active. I am not using any mods that add new ores, but will try and test on an entirely clean save later and get back to you.
Raserball 23 Apr, 2024 @ 3:39pm 
The log told me, that I need the Harmony Mod. Didn't had that one and there was no mentioning in the mod description. Maybe you can add that?
It's now running and working great! Thanks for the response!
Space Moth  [author] 23 Apr, 2024 @ 6:17am 
@Raserball Can you send me the log? I tried enabling steam deck mode in debug but was not able to reproduce the issue.
Raserball 21 Apr, 2024 @ 4:27am 
I get an error message everytime I try to enable the mod in the mod manager. The game trys to restart and then I get this error message:

Recovered from incompatible or corrupted mods errors
It seems that some of the active mods were causing errors.
They were incompatible with each other, designed for a different version of RimWorld, or
corrupted.
All mods have been disabled and can be activated again in the mods dialog.

RimWorld Version 1.5.4069

I running the game on the SteamDeck, maybe that's the problem idk.
Sir. Gameboy 21 Apr, 2024 @ 1:00am 
@Space Moth Legend, it works beautifully now, cheers! :Hearthian_Smile:
Space Moth  [author] 20 Apr, 2024 @ 8:11am 
@Sir. Gameboy Thank you, the issue should now be fixed for 1.5. I made a mistake porting the changes from 1.4! Please let me know if you find any issues.
Sir. Gameboy 20 Apr, 2024 @ 7:16am 
@Space Moth sure, here's the logs, running 1.5.4069 rev95: https://pastebin.com/mSDXNwd5
Space Moth  [author] 20 Apr, 2024 @ 2:33am 
@raserball @Sir. Gameboy What versions of Rimworld are you two running? Can you please link me error logs?
Raserball 19 Apr, 2024 @ 6:35pm 
This is the exact mod that I need to find the hidden ore inside mountains but it doesn't work. The game crashes when I try to activate the mod. Can someone fix that or tell me a different mod that does something similar?
Sir. Gameboy 19 Apr, 2024 @ 5:51am 
Still getting the same bug as others where going to this mod's settings window softlocks the game and I can't close it without task manager.
FireMonkeyLord 29 Mar, 2024 @ 12:36am 
Hello. Coloured Deep Resources is now being maintained by Sarg (link under compatibility goes to the old version) see updated link below.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3203269467&searchtext=
Space Moth  [author] 25 Mar, 2024 @ 7:06am 
@MadTech is this with the latest version of the mod? It should of received an update yesterday to fix this issue.
MadTech 25 Mar, 2024 @ 6:10am 
Experiencing a similar error as 'AerosAtar' when I click this mods settings and can't close/click any open panels. Only choice is to shutdownrestart RimWorld.
AerosAtar 22 Mar, 2024 @ 9:38pm 
The mod settings window is OnGUI() erroring when trying to write the file in 1.5Unstable.
kinngrimm 19 Nov, 2023 @ 9:28am 
having meanwhile tried out the mod, i see where i was wrong ^^. Rereading the discription also helped ^^. All scanable ressources are seen even without scanning them., therefor one can just keep your ressearches on the research task and ignore any scanning duties (work tab mod ftw) . It therefor seems to me i wrongly assumed that underground ressources would have been created due to the practise of scanning, instead i guess they are already created at map creation.

Also due to the color code, one does not need any particular filter to find a certain type of ressource, if something would be unclerar one just gives a loud color to that ressource and one sees it.
kinngrimm 18 Nov, 2023 @ 7:49am 
"Using the ground overlay you can also see the underground deposits without needing to select a drill or the scanner." I assume anything found by my ressearches over time using the ground scanner (long range scanner) is added to the presentation of the overlay.

what would be nice, if we could select within the overlay which ressource we want to see. Say we have the ground scanner running for some time and not all of which we found we needed at the time it was found. Yet later, due to ressearch certain ressources are needed again and we only want to see that on the map.
Nam 27 Sep, 2023 @ 7:43pm 
with alot of mods every few seconds with this overlay enabled I get tiny lag spikes, works just fine if I dont want to leave it on though.
Alexander Zagirov 3 Aug, 2023 @ 4:16pm 
Can you add compatibility with “ DDI - Deep Drill Indicator ”? Also, there is a slight oversight. Second overlay that shows minerals inside of mountains when you have a powered ground penetrating scanner actually shows defNames instead of labels.
Varjonyymi 10 May, 2023 @ 11:41am 
Thanks for making this mod, fills a very much missed niche.
I can't remember what the 1.3 mod was called, it provided a similiar overlay of above ground ores, but had an extending scanning range, so it took some time to reveal all mineral spawns.
Would it be possible/interesting to you too to add a scanning mode like that?
Ranensol 29 Apr, 2023 @ 5:09pm 
Thanks for your work on this mod, it was exactly what I was looking for.

Something that allows me to see whats on the map, at a 'cost' that makes sense within the game, without having hideous strip mining patterns all over the map :)
Space Moth  [author] 19 Apr, 2023 @ 8:59am 
Sorry about the delay in the latest update, but I am now reasonably confident that the Ore Overlay should be working lag free (or minimal at least) with improved stability and reliability.

Please let me know if you experience any issues in 1.4 after this update. I have not yet applied the changes to 1.3
Zanklev™ 30 Mar, 2023 @ 4:53pm 
I have a similar issue with it not working, however if I go into the mod options for it and toggle all three settings off then back on it will work again.
AnimateDream 19 Feb, 2023 @ 10:20am 
@Space Moth
I seem to be able to see ores deep under mountains by hovering over them from the start of a new game without a deep drill or scanner and I'm trying to figure out why.

Is this line incorrect? If you have a deep drill or mineral scanner selected the hover over is false, but stays true when neither are selected? I'm not sure how the mod is intended to work here.
https://github.com/TheSpaceMoth/SM_OreOverlay/blob/master/Source/OreOverlay/OreOverlay.cs#L256

Even so I don't get why line 262 wouldn't prevent the problem I'm having
Space Moth  [author] 18 Feb, 2023 @ 2:58am 
I've not yet been able to work out what is causing the lag issue sadly, but have noticed if you keep the game paused while using the overlay it seems to help the situation. Will keep investigating!
shane_357 18 Feb, 2023 @ 2:39am 
Lag is a serious problem. I've used it twice, and it is the No 1 thing eating up TPS since then (DPA). I even tried turning it off in the mod options, but it still kept going.
Dragonhead Gaming 9 Jan, 2023 @ 5:01am 
Scanned for ores and mined ores and neither one gets the mod to activate.
Stellar Harbour 12 Dec, 2022 @ 8:13am 
Seems like a cheats, can you make it researchable with having to place radar or something?
Lanthrudar 20 Nov, 2022 @ 4:21pm 
This stops working randomly as noted. One factor that may be worth checking is if it looks for an active ground scanner each time the overlay is toggled or just the first time. If it doesn't check for that each time then the mod is a bust because it will never show the items when the overlay is turned on or off. One thing I did notice was as soon as the scanner was powered off, for any reason, the overlay stopped working.
Thor 11 Nov, 2022 @ 5:09am 
Having some issues with Toggle Ore Overlay randomly not working. It works fine with I start the game. But after playing a while, no matter how often I toggle it on or off, nothing happens.

https://gist.github.com/44eb6c51772a05a70358a5b63c2250ff
Here's a Hugslib log for good measure.
Baccalon 9 Nov, 2022 @ 5:46am 
Thank you, this is amazing, I expecially appreciate all the extra small features :meephappy:
Lanthrudar 8 Nov, 2022 @ 10:35pm 
Ah, someone finally made a new version of this. Last time the GPS showed in-rock, above ground deposits and underground deposits was 1.0 game version. Sadly that mod was never updated.

As a request, would it be possible to have the scanning slowly expand and not instantly show everything? The earlier version of this idea had that and it seemed less OP since it took awhile to scan the entire map, and it had to be powered (can't remember if it had to be manned or that just sped up the radius) to work or show anything. For what it's worth it showed the above ground resources in one color and the underground with a different color.
Nes-AliTheAvali [GUC] 5 Nov, 2022 @ 4:14pm 
thx appreciate it
Space Moth  [author] 5 Nov, 2022 @ 5:48am 
I will look into the flickering issue, but I have updated the mod to properly support 1.3, please make sure you've got the latest version there! Thank you for the feedback.
Nes-AliTheAvali [GUC] 5 Nov, 2022 @ 2:47am 
as i continue playing i have noticed that the overlay will flicker sometimes
Nes-AliTheAvali [GUC] 5 Nov, 2022 @ 2:36am 
just checked and it does work but im unsure if there are any bugs
Space Moth  [author] 5 Nov, 2022 @ 1:32am 
A back port shouldn't be hard, I will take a look! I actually added handling for the VFE Power mod's Gas and Chemfuel deposits that were removed in 1.4
Nes-AliTheAvali [GUC] 5 Nov, 2022 @ 1:14am 
will this be back-ported to 1.3 if not do you think it will function in 1.3?
Kokorocodon 4 Nov, 2022 @ 4:04pm 
another "Why is this not in vanilla?" moment.
Space Moth  [author] 2 Nov, 2022 @ 9:01am 
@kem I've made an update that removes the debug and should fix that issue. You might need to run the game for a few seconds unpaused before the overlay shows correctly, and I'm looking to fix that.
Kem 2 Nov, 2022 @ 7:21am 
Hello I tried to use you mod but activating the overlay does nothing for me.

The Log shows a huge amount of DeepResourcesGridUpdate Refresh
an then says its stops logging to avoid Spam
Frektion 1 Nov, 2022 @ 6:25pm 
This seems like a cool QOL mod, gonna give it a try, thanks!