Resource Map Label Marker

by kizrak

Creates resource map label markers when chunks get generated and charted. See resources through fog of war. Please review settings and consult details below before starting!! πŸš€ #icon #resources #map #reveal #label #markers #chunks #generated #chart #tag #map #ore #count #fog of war

Utilities
4 months ago
0.17 - 1.1
53.7K

i Raw res names in tags for mods' res only

3 years ago

It would be nice to have an option to not add the vanilla res tags names, but add all the other tags from res coming from mods.

Thank you for the mod, I like the looks a lot ^_^
Actually, I was evading your mod, as I had a lot of lag in the beginning. Could you add some information on the mod's main page so people would understand what it is caused by and that lowering the init scaning radius is the key? Maybe even change the default values a bit..
Btw, what are the down sides of using only 7-8 chunks as the radius?

3 years ago
(updated 3 years ago)

I've released 0.6.17 which has much more detailed mod setting tool-tip information. I've also updated the Mod Portal to contain more information about how the settings can negatively impact lag at beginning. πŸ˜€

The downside of only using 7-8 chunks as the starting radius is that you won't know at the start of your map if your resource distributions are any good, which some might consider cheating. βš–

I like to know what my resources are going to be at the start of a map so I set my chunk radius to generate to 80 to make me happy, but that number apparently destroys most other people's machines, so YMMV. 🧑

3 years ago
(updated 3 years ago)

I like to know what my resources are going to be at the start of a map so I set my chunk radius to generate to 80 to make me happy, but that number apparently destroys most other people's machines, so YMMV. 🧑

Oh, that is a curious use case.. I don't like the swiss cheese map by default so I set the radius to 7-8 and and turn off the highlighting. But again I still have not launched a rocket ^_^
I guess I'll ask a bit more about the multiplayer code in regard to your mod, if it's okay with you :)
My case is as follows: a mid-tier PC and a potato-notebook. My friend on the potato starts to explore the world and generates more chunks.
1) What load lies on the potato as a client, and what load on the PC when it comes to:
a) generating chunks?
b) doing the summation of the res by your mod?
As the PC has a stable 60 FPS; and the potato has 3-15 FPS with your mod on, and 25-40 without it.

3 years ago
(updated 3 years ago)

The server and all clients much perform all calculations, so the real limitation is the weakest machine. If you are using a headless server (which it does not sound like you are) you can subtract out the performance loss normal due to graphics but only for the headless server. But all of starting lag is ephemeral, after all the chunks are generated by the core engine, this mod transitions into a nearly UPS free mod. πŸ˜‡

Another way to look at it is, how long are you willing to put up with some lag? If you are okay with a half an hour of lag, you could probably go with a very big radius. But if you have a potato that runs 25-40 without my mod, I'd probably suggest against using anything above default of 7 or 8. Depending on how cheaty you want to be, you could pick some map settings AND record the seed and start a map with the powerful machine and a value of 80, and take a screenshot of the map, then restart an exact same map with the radius of 0 and just use the screenshot. FWIW this is often what I did personally before I wrote this mod (using console instead)... 😈

β„Ή Most of the lag it actually the core/base game generating chunks, whatever underlying math the base/core game uses is pretty hardcore. The mod's LUA code has nearly no impact on UPS. If you want to see for yourself, let me know and I can try to edit a snip of code you can use without any mods. You can just issue the LUA command to experience all the lag without the mod for comparison. Or if you know some LUA, you just need to set surface and radius variables and call surface.request_to_generate_chunks({0,0},radius), which is exact code the mod uses, and is where most of the lag comes from.

⭐Another work around is to have the most powerful machine start the map, and let it go through the map generation process before any clients connect, so they can skip all of the heavy calculations.

3 years ago
(updated 3 years ago)

That is about what I thought, world gen >> mod code. I like the screenshot idea ^_^
yep, not headless.. Oh, okay, potato has to go. I'm surprised that the game works like that and still keeps stuff in sync most of the time.

⭐ I guess all online players do the whole world gen in parallel. So doing it on the good PC and then saving or something would transfer the data. Probably a save is created and sent on the event of joining the server.

I used to toy around with LUA on the minecraft turtles mod. But I have little knowledge how to input my code into the game and output data from it. Is there a easy way?
And there is no need in the experiment, I believe you :)

After googling, it seems I can use these commands to generate more of the map and do a achievement restoration thing afterwards.
surface.request_to_generate_chunks({0,0},radius) - this on the other hand could be useful. I guess there is the console and
/c game.player.force.chart_all()

/c local radius=150
game.player.force.chart(game.player.surface, {{x = -radius, y = -radius}, {x = radius, y = radius}})

/c local radius=150
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})

3 years ago

2 cents: It's important to remember that Factorio is 'deterministic'. Which means that all systems (server and clients) must compute everything and do it identically. If any system fails to perform a calculation or the calculation does not match other systems, the result is a desync. The system is then ejected and forced to reconnect. When it reconnects, it pulls a save from the server and then starts queuing calculations and does the 'catch up' phase you've probably seen on the potato (especially in larger busier maps) where it works on those backlogs. Once you've caught up, you're back online in the game.

Therefore, if one system is better able to complete calculations, you can bypass those calculations on slower machines by getting that data resulting from said calculations via the save transmitted on join.

3 years ago

oh, thanks for the explanation :)

3 years ago

One more question. When you do make a R=80 chunks map. Does the game while loading eat up 10-12 Gb of RAM? I just did not expect this kind of a memory usage spike.

3 years ago
(updated 3 years ago)

As a test, I just loaded up the latest version of RMLM on the latest version of Factorio 1.0 with a brand new freeplay map. There was no significant jump in RAM usage while the chunks were computed (~50MB at most, averaging 700MB in total) but my FPS/UPS dropped to 6 for about 30 seconds. This may be dependent on your CPU/RAM/GPU. I have a pretty beefy system with the Ryzen 3950, 32GB of 3600Mhz RAM, and a GTX 975 with 4GB of NVRAM. Settings can also have an effect, I've cranked most of my settings to max however but Atlas and other texture settings may play a big effect depending on your NVRAM and RAM availability. If you want to post your save game somewhere, I can try to see if that has a significant effect on RAM.

3 years ago

As a test, I just loaded up the latest version of RMLM on the latest version of Factorio 1.0 with a brand new freeplay map. There was no significant jump in RAM usage while the chunks were computed (~50MB at most, averaging 700MB in total) but my FPS/UPS dropped to 6 for about 30 seconds. This may be dependent on your CPU/RAM/GPU. I have a pretty beefy system with the Ryzen 3950, 32GB of 3600Mhz RAM, and a GTX 975 with 4GB of NVRAM. Settings can also have an effect, I've cranked most of my settings to max however but Atlas and other texture settings may play a big effect depending on your NVRAM and RAM availability. If you want to post your save game somewhere, I can try to see if that has a significant effect on RAM.

Yep, I had the same. But then, after generating the huge map, save and exit. And the RAM spike is during loading a saved game..

3 years ago

When initially launching Factorio itself, RAM very briefly goes to 4.5GB before hitting the main screen and dropping back down to 330MB.
When loading a save (waited for the full r=80 chunks to load then saved) it goes ~330MB to ~830MB and stays there.
I tried a completely unrelated save (vanilla game from 0.18) with similar results, but up to 1.2 GB after r=80 was done.

3 years ago

Very interesting. Maybe the game just sees the 16 Gb RAM space and goes ham with a bigger save... But after some testing, I figure it's the mods.
I guess there is another metric to compare and normalize our results: my usual heavy moded small map save (r~25-35) is about 20Mb and the big save (r~80) is about 80Mb (both being the compressed zip files). A vanila big save (r~80) is about 30Mb.

Main menu: 400, 700 Mb RAM (no mods, a lot of mods)
Game Save Loading process (big save + a LOT of mods): 12Gb - peak, with a fast decline in the first min of game time to a stable 4.5Gb
Game Save Loading process (vanila big save): no peak, a stable 0.8Gb, as in your case..

New response