Giter VIP home page Giter VIP logo

Comments (12)

Pandemoneus avatar Pandemoneus commented on June 12, 2024 1

Resource (patch) detection and getting the bounding box are now in with #93.

from factorio-stdlib.

Afforess avatar Afforess commented on June 12, 2024

Definitely sounds like a useful feature. Go for it.

from factorio-stdlib.

Nexela avatar Nexela commented on June 12, 2024

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.

Choumiko avatar Choumiko commented on June 12, 2024

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.

Afforess avatar Afforess commented on June 12, 2024

YARM has a compatible license so if any code is reused there, we just need to attribute it in the file.

from factorio-stdlib.

Afforess avatar Afforess commented on June 12, 2024

Need any help @Pandemoneus? I've contributed a bit to YARM myself and it sounds like the others are interested too.

from factorio-stdlib.

Pandemoneus avatar Pandemoneus commented on June 12, 2024

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.

Pandemoneus avatar Pandemoneus commented on June 12, 2024

Alright, got the first version for resource scanning up: https://github.com/Pandemoneus/Factorio-Stdlib/blob/master/stdlib/resources/resources.lua

from factorio-stdlib.

Nexela avatar Nexela commented on June 12, 2024

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.

Nexela avatar Nexela commented on June 12, 2024

Also, if you do it as a pull request it becomes a lot easier to make review comments :)

from factorio-stdlib.

Pandemoneus avatar Pandemoneus commented on June 12, 2024

Alright. Under which circumstances can there be more than one resource on a tile? I took that code from YARM.

from factorio-stdlib.

Nexela avatar Nexela commented on June 12, 2024

Its rare but it does happen in vanilla, additionally mods can "stack" them

from factorio-stdlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.