Comments (12)
Resource (patch) detection and getting the bounding box are now in with #93.
from factorio-stdlib.
Definitely sounds like a useful feature. Go for it.
from factorio-stdlib.
I agree on it being usefull
Some things to think about.
What defines an ore patch, if there is a gap of XXX tiles is it still part of the same patch?
What if the patch is a combined patch with say coal/iron etc etc.
Probably the best fit for it would be stdlib/entity/resource.lua
I am currently (very slowly) writing a data stage Prototype module. As well as a player/force/surface event module
from factorio-stdlib.
What defines an ore patch, if there is a gap of XXX tiles is it still part of the same patch?
What if the patch is a combined patch with say coal/iron etc etc.
My definition of an ore patch: Connected in the 4 main directions + 4 diagonals, no gaps and one single ressource.
Can't remember a case where i'd see 2 copper patches close enough together to consider them 1 patch.
Probably worth checking out https://github.com/narc0tiq/YARM When i used it back in the days it always marked what i would have expected.
from factorio-stdlib.
YARM has a compatible license so if any code is reused there, we just need to attribute it in the file.
from factorio-stdlib.
Need any help @Pandemoneus? I've contributed a bit to YARM myself and it sounds like the others are interested too.
from factorio-stdlib.
Alright, haven't had time working on it yet, but I will start now. I've asked Rseding whether he could expose what they use for the Factorio minimap on ore patches, but he redirected me to one of his older mods, namely Landfill: https://mods.factorio.com/mods/Rseding91/Landfill
I'll see that I can get a first version up, I am sure there will be possible performance improvements.
from factorio-stdlib.
Alright, got the first version for resource scanning up: https://github.com/Pandemoneus/Factorio-Stdlib/blob/master/stdlib/resources/resources.lua
from factorio-stdlib.
return resource_at_tile[1] -- there should never be another resource at the exact same coordinates
There can be more than one resource on a tile,
from factorio-stdlib.
Also, if you do it as a pull request it becomes a lot easier to make review comments :)
from factorio-stdlib.
Alright. Under which circumstances can there be more than one resource on a tile? I took that code from YARM.
from factorio-stdlib.
Its rare but it does happen in vanilla, additionally mods can "stack" them
from factorio-stdlib.
Related Issues (20)
- Upgrade Readme and Wiki HOT 2
- To Do List
- Data.Util.Duplicate on normal/expensive recipes HOT 6
- Wiki with list of functions and their functionalities HOT 2
- Recipe:clear_ingredients error HOT 5
- Small errors found with trains/events HOT 6
- add_ingredient issue HOT 8
- 0.18 support? HOT 1
- remove_prereq nullifies prerequisites value of technology table.
- errors found with trains/events
- add_ingredient cant find items that are modules
- Event handler filter is ignored if more than one event ID is specified in `register`
- spidertron-remotes aren't checked as "items" so a recipe result (and more) may fail to find one HOT 1
- documentation broken HOT 2
- Event.register not passing pattern to function HOT 1
- Inconsistency of technology pack methods
- Gui events not working HOT 1
- String.contains doesn't work with strings that contain a hyphen.
- Question: Which tool can be used to interpret the code documentation in VSCode
- This does not look right: return (Area.size(Area)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from factorio-stdlib.