Zomis / FactorioMods

Various mods for the game Factorio
https://mods.factorio.com/mods/zomis
MIT License
15 stars 7 forks source link

What is it Missing UPS hit... #24

Closed abordoli closed 6 years ago

abordoli commented 6 years ago

So all things being equal, I tested the new "What is it Missing" mod an noticed that in a fresh world I was hardly running at even 10 UPS. I did the debug option on time usage and saw the mod utilizing close to 40.000/0.000/0.000. I removed it and everything was back to a normal 60 UPS.

Zomis commented 6 years ago

I have a suspicion that the more machines you put on the map the better the speed will be. Although I have to investigate this. This is because I had to write a workaround because of this: https://forums.factorio.com/viewtopic.php?f=6&t=50485

What happens is that every tick the mod scans the next machine in a list to see if the recipe has changed, if this list is empty it scans the entire map for all machine or furnace entities. So what happens at the start is that it every tick scans for all machines on the map, which is a quite costly operation.

I can try to optimize this by putting a limit to how often the map can be scanned, so that it is scanned say every minute or so, I think this should drastically improve performance.

Please try the mod on an old map with a lot of machines and see what the performance is then.

Zomis commented 6 years ago

I've compared on my computer and checked the performance of a new map vs. a quite big map with Bob's Mods. On the empty map it says 1.159/0.000/0.000 for my mod, and on an old map it's around 0.304/0.000/0.000

I have never seen it at anything higher than 1.500 though.

Can you share more information about your system? Operating System, CPU, memory, etc? What Factorio version are you running? If possible, can you send me a game save of the map where it went to 40.000/0.000/0.000 ? A screenshot (with game zoomed out as much as you can) could also be helpful.

I will try to optimize the performance of this mod for smaller maps.

abordoli commented 6 years ago

Yeah, I'll give you a snapshot. The save game you won't want as I have a very stable set, but large number of mods (approved by three of some of the game's top modders: my friends Nexela, Earendel and Wormmus for conflicts and CPU drains, etc.)

My system is actually a $185 Netbook: Aspire one 1-431 (x64-based PC) Interl Celeron CPU N3050 @1.60GHz, 1601 Mhz, 2 Cores, ... Windows 10.0.10240 Build 10240, pumped up with 104.5GB virtual memory (4.5 GB on the main drive 32Gb total (and 100GB (10%) of my external 1TB drive.) and configured for maximum performance with executed programs taking priority. Hardly any background, but the bare minimum running.

I'm gonna put the mod back on and take a screen shot of that time usage...brb

Always running the very latest version: 0.15.31

abordoli commented 6 years ago

https://cdn.discordapp.com/attachments/324634192732356609/340263373344342022/unknown.png

abordoli commented 6 years ago

So slightly better there:

image

Caught it almost at 40.000 (over 38.000 as I'm watching), but difficult to get a snap as its peaking.

Now caught it at 43.000+

49.000+

Basically dragging my UPS on a fresh world to sub 10 UPS.

image

Seems to go higher and higher the longer I sit and do nothing but watch it....

abordoli commented 6 years ago

I take it off, back to running at full-throttle 60FPS/60UPS.

abordoli commented 6 years ago

Tried loading up an mega-base 60+ rocket launch game and it crashed to desktop. Then again, I have a different set of mods now then I did when I ended that one.

abordoli commented 6 years ago

image

Here it is on a game that is in the stage where it's a decent sized factory but quite yet mid-game.

Zomis commented 6 years ago

Can you try altering your sets of mods? Try removing some mods until what-is-missing is not causing the game to slow down too much. Alternatively, disable all mods except what-is-missing and see what the performance is then.

My theory is that some other mod is doing something which causes what-is-missing to slow down, and this is my way of pinpointing the issue.

As long as all the mods you are using is available on the mod portal, I'm still interested in getting a gamesave.

abordoli commented 6 years ago

Yeah, I was thinking of toggling them all off except for what-is-missing... I'll work on it.

abordoli commented 6 years ago

https://cdn.discordapp.com/attachments/324634192732356609/340430861054902272/unknown.png

So that's a no mod game except for what-is-missing...

abordoli commented 6 years ago

My preference is to try it later in a game for like the rocket stage and see if others experience/report the same.

Zomis commented 6 years ago

Yes, please try an end-game with only the what-is-missing mod. As previously mentioned, if you have no or very few machines, it will perform a costly operation every n ticks, where n is the number of machines you have + 1. So with 0 machines, it will be every tick. With 60 machines it will be about once per second.

At least we can see that when you run what-is-missing alone the speed is improved (still much worse speed than what I experience, but still). So there is some mod which is causing something in what-is-missing to be more expensive.

Does any of the mods add more surfaces or create things on the map far away, or somehow make additional areas of the map load? If so I would start with those.

abordoli commented 6 years ago

I have removed a TON of mods (prepping for MP play) and may test this out again sooner than later.

I can't praise you enough for "Visual Signals". I know we've talked about making it even better in the other thread, but I came up with even more ideas that could really take it to the next level and then some.

What is your preferred method of live-chatting?

Zomis commented 6 years ago

Let me know how to find you on Discord and I will add you there.

abordoli commented 6 years ago

I have a Discord server/community (of about 9 Factoriolites), but we can chat one-on-one or in group discussions as you see fit.

You ought to find me under: "Bordo Burner Inserter" . I'll keep an eye out for a friend add.

@Antony [Bordo - Burner Inserter]#5757

Zomis commented 6 years ago

Sorry, haven't been able to add you. Can you add Zomis#7085 ?

abordoli commented 6 years ago

Discord Friend Request sent. Took me a while to figure it out....lol.

Zomis commented 6 years ago

The performance has been increased in the latest version of What is Missing. Please let me know if you still experience performance issues.