Open alexbarrett opened 2 years ago
Thank you for the report! ๐ฐ
My mod just:
I forget the logic when new chunks get added, but I'd suspect it is very similar.
The mod doesn't try to do any math related to amounts or efficiency, it just reports what the Factorio Mod API reports and adds them.
Is the mod always over-reporting? ๐ค Do you know if it only happens on starting chunks or newly generated chunks? ๐ถ How do the numbers reported by the base Factorio map compare? Do you have a link to your mod/source-code that does the ore counting?
And thanks again for collecting these details! ๐งก
Is the mod always over-reporting? ๐ค
Yes, from what I have seen it is always correct or over-reporting. I've never seen it under-report.
Do you know if it only happens on starting chunks or newly generated chunks? ๐ถ
Most of these screenshots were taken from the same map. I manually ran around checking many resource patches. I don't recall if the incorrect stone patch was a starting chunk or not, but the oil fields are usually incorrect no matter where they are.
How do the numbers reported by the base Factorio map compare?
The number shown by base Factorio on the map always matches the one shown as "Nearby Resources" in the screenshot (rounded down). I checked them all to make sure my mod was working.
Do you have a link to your mod/source-code that does the ore counting?
It's not published anywhere because I only made it to learn how the Factorio modding API works. I have pasted it as a Gist for you so you can see it: https://gist.github.com/alexbarrett/4bc8c4d1cf271861357af87ae3ccfba1. Lines 51-69 is where it sums the total.
Would it be possible the chunks are generating with the amounts my mod says on the first tick, but later in that tick or the next one, some of the resources are removed via trees, cliffs, spawners, other terrain generation, etc.? ๐ค
I noticed some incorrect totals for some markers created by this mod so I did some testing to investigate. My findings were:
I made a small mod to count resources in a large radius (32) around the player, and compared them to the amount shown in the markers created by this mod. Here are the screenshots:
Examples of incorrectly totaled oil fields
Marker shows 2.7M, real total is 1.3M
Marker shows 6.9M, real total is 5.9M
Marker shows 3.9M, real total is 3.6M
Marker shows 10.4M, real total is 9.7M
Marker shows 7.6M, real total is 6.7M
Examples of correctly totaled oil fields
Marker correctly shows 864k
Marker correctly shows 2.6M
Example of an incorrectly totaled stone patch