Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0 support, circuit network exporter #41

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mvolfik
Copy link

@mvolfik mvolfik commented Oct 25, 2024

fixes #29
fixes #40

this will need some cleanup before merging:

  • document the added circuit network support: constant combinator acts as an "exporter" - only networks that are connected to some constant combinator will be in the metrics
  • update the grafana dashboards for the changed labels (if it is used, I didn't check yet)
    • I would also prefer to rename some weird names, like input/output to production/consumption | kills/losses etc
  • revert the changes made to info.json

However, if anyone wants to play with this dirty patch on 2.0/Space Age, here you go:
graftorio2-mvolfik_0.0.1.zip d6a3ac8
graftorio2-mvolfik_0.0.1.zip fixed build, no code changes in the repo

Note that this is a "new" mod, not a version of graftorio(2). You will need to remove the original graftorio(2) mod.

@kalebr
Copy link

kalebr commented Oct 25, 2024

Thanks for the patch, but when attempting to run this using a factorio docker server, I get this error in the logs.

1.735 Error ServerMultiplayerManager.cpp:84: MultiplayerManager failed: "graftorio2-mvolfik/control.lua:1: module prometheus/prometheus not found; no such file graftorio2-mvolfik/prometheus/prometheus.lua no such file graftorio2-mvolfik/prometheus/prometheus.lua no such file core/lualib/prometheus/prometheus.lua
stack traceback:
[C]: in function 'require'
graftorio2-mvolfik/control.lua:1: in main chunk"
1.735 Info ServerMultiplayerManager.cpp:803: updateTick(18446744073709551615) changing state from(CreatingGame) to(InitializationFailed)
1.735 Info CommandLineMultiplayer.cpp:211: Exit point.
1.740 Info ServerMultiplayerManager.cpp:146: Quitting multiplayer connection.
1.740 Info ServerMultiplayerManager.cpp:803: updateTick(18446744073709551615) changing state from(InitializationFailed) to(Closed)
1.803 Info UDPSocket.cpp:233: Closing socket

@mvolfik
Copy link
Author

mvolfik commented Oct 25, 2024

@kalebr dang, I ran the wrong build command from bash history, and didn't even test the final build 🤦‍♂️ added fixed version above

@kalebr
Copy link

kalebr commented Oct 25, 2024

Thanks, that fixed the server starting up. But now, when joining, I get this message.

Screenshot 2024-10-25 110958

Edit: Nevermind. Restarted server fixed it.

@victornor
Copy link

victornor commented Oct 26, 2024

Thanks, that fixed the server starting up. But now, when joining, I get this message.

Screenshot 2024-10-25 110958

Edit: Nevermind. Restarted server fixed it.

I get the same error. Nothing i do allows me to connect.

Edit: Removing the following two lines from control.lua solves the problem.
script.on_event(defines.events.on_space_platform_built_entity, on_circuit_network_build)
script.on_event(defines.events.on_space_platform_mined_entity, on_circuit_network_destroy)

@remijouannet remijouannet self-assigned this Oct 27, 2024
@mvolfik
Copy link
Author

mvolfik commented Oct 29, 2024

@kalebr i think we also ran into something with "handlers are not identical" when starting our playthrough - I think the issue was that the savefile was created with the old version of the mod (or maybe no mod whatsoever). The solution was creating the map again, with the mod loaded (bad news, if your map is already in progress :( ). The registrations to on_space_platform_built/mined_entity are not the only handlers new in the circuit network patch, though, it's a bit weird that only these two would cause issues

@remijouannet I see you self-assigned this, the circuit network feature should be relatively simple to remove, if you don't like it and only want the 2.0 patch. What it does (or at least should do): export every network connected to a constant combinator, i.e. it makes constant combinator act as the "prometheus combinator" that I've seen in some other PR. Unfortunately, I'm a bit tight on time with my university schedule and other liabilities, so honestly I would like to avoid any further work on this (because it means starting factorio to test any changes, and y'all know what can happen when you open Factorio). You can do whatever with my code contributed here. Thanks a lot for all your work put into maintaining this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it will be ported for Factorio 2.0 + DLC Space age ? Exporting signals from circuit networks
4 participants