ccbrown / factorystatsd

This is a Factorio mod for next level reliability engineering. Build dashboards for your factory in Datadog or get woken up by PagerDuty when incidents occur!
https://mods.factorio.com/mod/factorystatsd
MIT License
13 stars 3 forks source link

Surface names #7

Open AstraLuma opened 2 years ago

AstraLuma commented 2 years ago

As a follow-up to #6, I want to discuss what is a good way to include surface names?

I'm guessing the utility of it will vary by modpack. Eg, super great for space exploration, maybe not so great for factorissimo.

But at least for our use case, where we're writing a custom collector and playing space exploration, the name would be pretty nice to have.

@ccbrown, do you have opinions on this?

agmlego commented 2 years ago

I wonder if just including that into the factorystatsd-game-data.json file would be sufficient?

ccbrown commented 2 years ago

The game-data file is only written once when you open up the game. It wouldn't be able to handle surfaces created or changed during gameplay.

I would probably just add data for surfaces that have active combinators to the samples JSON file. Maybe something like this:

{
    "surfaces": [
        {
            "index": 1,
            "name": "nauvis"
        }
    ],
    "entities": [
        {
            "unit_number": 7,
            "surface_index": 1,
            "settings": {
                "name": "",
                "tags": "",
                "absent_signals": "ignore"
            }
        }
    ],
    "ticks": 1135200
}
agmlego commented 2 years ago

That would work great!