Cities: Skylines

Cities: Skylines

Simulation Speed Benchmark
35 Comments
umbrellers 2 May, 2021 @ 9:09pm 
An error has occured in mod's OnAfterSimulationFrame method.
System.NullReferenceException: Object reference not set to an instance of an object
at ColossalFramework.UI.UIDynamicFont+DynamicFontRenderer.Obtain (ColossalFramework.UI.UIDynamicFont font) [0x00000] in <filename unknown>:0
at ColossalFramework.UI.UIDynamicFont.ObtainRenderer () [0x00000] in <filename unknown>:0
at ColossalFramework.UI.UILabel.ObtainRenderer () [0x00000] in <filename unknown>:0
at ColossalFramework.UI.UILabel.Invalidate () [0x00000] in <filename unknown>:0
at ColossalFramework.UI.UILabel.OnTextChanged () [0x00000] in <filename unknown>:0
at ColossalFramework.UI.UILabel.set_text (System.String value) [0x00000] in <filename unknown>:0
at SimulationSpeedBenchmark.Threading.OnAfterSimulationFrame () [0x00000] in <filename unknown>:0
at HealkitMod.Patches.ThreadingWrapperOnAfterSimulationFramePatch.Prefix (System.Collections.Generic.List`1 ___m_ThreadingExtensions) [0x00000] in <filename unknown>:0
umbrellers 2 May, 2021 @ 9:09pm 
I suspect this mod has a little bug.

I played with only two mods enabled: Simulation Speed Benchmark + Extended Error Reporting, and got an error. So probably it isn't a mod compatibility issue.
I don't have a GPU and use the Intel graphics card, so this might be the cause.

The difficulty is reproducibility. This error occurs very randomly. After the error happens, sometimes I can continue the game by closing the popup, but sometimes the same popup reappears immediately and can't go back to the game forever.
IMO the bug is not so crucial, because the error happens very rarely (1/hour) and does not break the save.

I will paste the error message to the next post.
Overhatted  [author] 29 Jun, 2020 @ 1:34pm 
@stmSantana Thank you. It's unlikely to be broken, it's most likely incompatibilities between mods that are very hard to debug. Also, this mod gives you the time the game takes to process one simulation frame, it doesn't have anything to do with the graphics frame rate. It seems to me that Monitor It! doesn't give that value so it's not like you can replace this mod with Monitor It!.
stmSantana 27 Jun, 2020 @ 10:37pm 
@KitaNishi
This is no error for me.
https://imgur.com/Fpj4Miv
Maybe this conflicts with other mods? It shouldn't be called "broken".

And Monitor it mod only displays the frame rate and memory usage, That is not for benchmarking.
kitanishi 25 Jun, 2020 @ 7:13am 
AllegedlyLuca 7 Aug, 2019 @ 1:02pm 
Mod causes random "Object reference not set to an instance of an object" errors sporadically. Otherwise, works really well and I like it.
Rena 7 May, 2019 @ 10:23am 
This seems to cause some glitch for me. Occasionally the money disappears from the statusbar, and I get random errors popping up more and more frequently until I have to save and quit. Only happened when I had this mod enabled.
ZAIRED 12 Jan, 2019 @ 12:40pm 
This tool is great! I can know when some citizen are getting stucked somewhere I can see that the number is boosting up suddenly! Thanks a lot!
Overhatted  [author] 13 May, 2018 @ 10:44am 
@Aminushki Lower is better
Aminushki 13 May, 2018 @ 8:25am 
lower is better? or is it the other way around?
Aurion 7 May, 2018 @ 6:53pm 
Is there a way to output this to a file to compare the average? With the mod Rush Hour, the simulation speed at night is very different from 7am.
klikar 20 Dec, 2017 @ 2:18pm 
Intel i7 8700k@4,9 was able to reach around 13 ms simulation frame time speed on downloaded saved game of Rockfield-655k citizens from steam workshop. So faster 6 cores are better in this game than slower 8 cores.
klikar 9 Nov, 2017 @ 3:10am 
Thank you very much for this mod. I enjoyed testing performance of my ryzen 7 1700@3,9 with help of this tool. I was able to reach around 18ms simulation frame time speed on downloaded saved game of Rockfield-655k citizens from steam workshop.
Blackdragonbird 6 Jun, 2017 @ 6:33pm 
@egi, strange, for me not. I'm not using any mod that changes the game mechanics. But no problem.

=)
egi 3 Jun, 2017 @ 1:58pm 
@Blackdragonbird for me it does
Blackdragonbird 27 May, 2017 @ 7:14am 
@[GOF] Overhatted Leet, seems to be not working with 1.7 version of the game. Can't see any any number in the top left.
Blackdragonbird 28 Apr, 2017 @ 6:51am 
@vokepasa21, Install MSI Afterbunrer and put it to show your VRAM usage in the screen, if it go over 3500MB of VRAM you are going to use the slow 500MB of the GTX970, and them, you can get stuttering.
egi 25 Apr, 2017 @ 11:04am 
awesome, thx!
now we need only a way to split the values for the default game and all the different mods :)
benzoll 24 Apr, 2017 @ 7:16pm 
City= 125k cims. Mods/assets= 100. i7, gtx970, 16gb RAM.
Benchmark:
-day= 9.1
-night= 8.6
Boghood 23 Apr, 2017 @ 1:30am 
First of all, thanks for this mod, I'll try this asap :)

@vokepasa21 I also have the GTX 970 and I think my framerate sucks. If you have some clue whether it's actually the GPU, could you let me know? Cheers :chirp:
AntonioBernal 22 Apr, 2017 @ 3:47am 
[GOF] Overhatted Leet Further testing is showing inclusive results for me...so I'm a bit confused. I don't want to flood your mod's thread any more so I'm friending you to send you a private message if you don't mind helping me out to try to figure out what is indeed causing my performance problem. Thanks!
Overhatted  [author] 21 Apr, 2017 @ 3:32pm 
@vokepasa21 RAM usage is not the same regardeless of the size of the city. If you have a larger city it has to store more vehicles, more buildings and everything else. But yes, with 32GB capacity shouldn't be a problem but it can still be a problem with your RAM speed. This is very unlikely since you recently bought new RAM and the problem persisted.
But to really make sure it's VRAM try lowering the graphical settings in your big city and see of the problem persists. It should go away because by lowering your graphical settings you will be using lower quality, and thus smaller in MB, graphical objects so everything will fit into your high speed VRAM (and not in the slower VRAM of the 970 or in system memory) and thus your graphics card will be able to access it faster.
AntonioBernal 21 Apr, 2017 @ 3:11pm 
@[GOF] Overhatted Leet Will do...! But I don't think RAM is the problem. I was previously on 16 GB RAM when the stuttering appeared on this savegame...only after the city started becoming big enough I guess. As far as I understand, RAM usage is the same regardles of the size of the city isn't it?Anyway with 32 GB RAM that particular stuttering is exactly the same (I can feel the general improvement though) now I have monitored it and it usually sits below the 80 % mark.

If you have any ideas for me to test to make sure VRAM is the problem let me know. Appreciate your help!
Overhatted  [author] 21 Apr, 2017 @ 2:03pm 
@vokepasa21 Before forking out on a new card make sure it's not the regular RAM
AntonioBernal 21 Apr, 2017 @ 12:31pm 
@[GOF] Overhatted Leet Yes I've just tested what you suggested and I have no stuttering when loading a small city with the same amount of assets loaded in memory...so I do think it's the VRAM indeed. I can't believe I'm considering forking out on a new card to continue this city but hmmm...it's tempting... you've helped me identify my performance issues (I hope) so thanks!
Overhatted  [author] 21 Apr, 2017 @ 11:00am 
@vokepasa21 Not having 100% usage isn't necessarily good. It means you are not using your hardware to it's full potencial. And yes, not enought RAM or V-RAM can cause stuttering. The best way I can think of to see if it has to do with V-RAM is to create a new game with all the assets disabled and see if the stuttering continues.
AntonioBernal 20 Apr, 2017 @ 11:11pm 
@[GOF] Overhatted Leet Thank you for your answer! CPU and GPU usage are both looking healthy and not near 100 % so I don't think my issues are CPU related. Besides the stuttering keeps happening when simulation is paused indeed as you mentioned.

I'm running a i7-4790K with 32 GB ram on a GTX 970. I have recently bought more RAM thinking this was the issue, and it has made some difference in loading times and general performance but the stuttering is still there. The only thing I see constantly at max usage is the VRAM, and the 970 is known to have issues when using the last 500Mb of the VRAM. The stuttering happens every 10 seconds more or less and it's always very short, just one second, but it's annoying, because between hiccups the performance is very smooth. Time to save for a 8gb graphics card? :S

Thanks for your help with this mod and your answer!
Overhatted  [author] 20 Apr, 2017 @ 2:16pm 
@vokepasa21 13.5ms means your computer can do at most 74 simulation frames per second. Which means is between 1x and 2x velocity.

Stuttering shouldn't have much to do with the time the simulation takes. I am not an expert in this so don't quote me on this but the graphics and the simulation are done in different threads so unless your cpu has too few cores they shoudn't interfere much with each other. To make sure that they don't interfere simply pause the simulation and see if the stuttering continues.

To see which one (the cpu or the gpu) is bottlenecking your system open GPU-Z or other utility and see if your GPU usage. If it's below 100% your cpu is bottlenecking.
AntonioBernal 20 Apr, 2017 @ 12:41pm 
So I'm on average 13.5. Is that "good"? I think I understand what this mod measures but I'm not sure what it means in terms of performance. I'm experiencing slight but constant stuttering issues running a mod/asset heavy city so I'm trying to find what is bottlenecking...don't think it's the CPU in my case, but a very useful mod! Thanks!
FourteenChief 19 Apr, 2017 @ 2:29pm 
My question was wrong...a measurement of mods impact on the cpu was what I looked for. English aint my native language. My bad, thx for the correction. Gonna try it out later on. Good idea and well done.
Overhatted  [author] 19 Apr, 2017 @ 2:09pm 
@RafaMarioFan No. This mod just starts a timer at the start of a simulation frame and stops it at the end. Then it show the average time it took to calculate each of the last 1000 frames.

@FourteenChief No, a frame is a simulation tick. It's how the game calculates everything. (https://gamedev.stackexchange.com/questions/81608/what-is-a-tick-in-the-context-of-game-development) . This mod just measures the time it takes for your computer to calculate each frame. The smaller the number, the less time your computer takes to compute each tick. I did this mod basically so people can measure the impact each mod has on the simulation time.
SogDexFogDucker 19 Apr, 2017 @ 1:40pm 
using the lowest quality image is fantastic.
FourteenChief 19 Apr, 2017 @ 1:29pm 
I don´t know much about computers so I use afterburner to overlook my cpu-load, gpu-load and other stuff.

Do mods affect the amount of "frames"? If that´s the case this mod will be very useful I guess.
Rafario 19 Apr, 2017 @ 11:54am 
Wait, your mod shows the performance based on day/night cycle??

Because I use rush hour.
ZobrAZ 19 Apr, 2017 @ 6:17am 
Game week = 4096 frames? Useful information, didnt know that. Thx! :)