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

Detector tube stuck in ON state on game exit. #65

Open
Alatarius opened this issue Apr 30, 2023 · 14 comments
Open

Detector tube stuck in ON state on game exit. #65

Alatarius opened this issue Apr 30, 2023 · 14 comments
Labels
bug Something isn't working

Comments

@Alatarius
Copy link

Alatarius commented Apr 30, 2023

I thought is was mesecons issue that their wires weren't conducting. When I'm in creative mode, everything works fine but when I go to regular mode everything stops conducting.

mesecons responded with: "It doesn’t stop conducting. A detector pipe is stuck in the “on” state, jamming the wire effectively (Mesecon devices act on off→on transition typically which can’t happen if the wire is constantly on). And it doesn’t depend on creative mode, it gets stuck if it is on when you exit the game. Report to pipeworks.

creative mode: https://drive.google.com/file/d/1GCf9V3lWBIx2eyI0z8xBqISHziSIJmJC/view?usp=share_link
regular mode: https://drive.google.com/file/d/1_YVn_vsLVFYp-1UIUWACOWqZOgRJPZbR/view?usp=share_link

[edit]
I am using the current version of pipeworks as of this writing
playing minetest_game on current version (5.7.0)

mods installed are digilines, mesecons and pipeworks

@Alatarius Alatarius changed the title Detector tube stuck in ON state. Detector tube stuck in ON state on game exit. Apr 30, 2023
@S-S-X
Copy link
Member

S-S-X commented Apr 30, 2023

I am using the current version of pipeworks as of this writing

Current version as in latest from ContentDB? https://content.minetest.net/packages/mt-mods/pipeworks/
Or latest from master branch of this repository? bd5a423

Seems like ContentDB version is bit old already, I guess we should update it anyway, seems like it is db6d1bd
And how much been changed since then? A lot: https://github.com/mt-mods/pipeworks/compare/db6d1bd..master

@Alatarius
Copy link
Author

Alatarius commented Apr 30, 2023

Yes, that's the one. [edit 2] I just installed the pipeworks from ContentDB yeterday.

[edit]
I'm just an end user and know nothing about code. There were so many files and bits of code my brain just exploded. lol, is there a simple file I can just install?

@S-S-X
Copy link
Member

S-S-X commented Apr 30, 2023

Yes, that's the one.

So ContentDB? I mean installed directly through Minetest content tab, not downloaded from GitHub?

is there a simple file I can just install?

For simple file, yes you can try to install latest from GitHub but I think we should anyway make new release to ContentDB too.

If you want to try and download latest version from github you can use this link: https://github.com/mt-mods/pipeworks/archive/refs/heads/master.zip

Then unzip that package into your minetest mods directory replacing existing pipeworks directory there (you have to move old pipeworks directory out or just delete it first).

After you've done there should be similar files in minetest/mods/pipeworks what there were before replacing it with latest version from GitHub.

Reminder, you can do that but you do not have to do that

We'll try to make new release soon so if you want to wait a bit then updated version will be soon available through Minetest content tab.

@Alatarius
Copy link
Author

I downloaded it through the content tab on mt originally and I just installed the version you linked above and I still have the same issue.

@S-S-X
Copy link
Member

S-S-X commented Apr 30, 2023

Mesecons and Digilines seem to be fairly recent versions on ContentDB, only Pipeworks was very old version there.

I guess we have to test this bit more but can you confirm it gets stuck in on-state even if there's no mesecons wires or mesecons devices connected to detector tube when you leave game?
I mean if you have only regular tubes and mesecon tube but no other active devices connected.

@S-S-X S-S-X added the bug Something isn't working label Apr 30, 2023
@S-S-X
Copy link
Member

S-S-X commented Apr 30, 2023

@Alatarius
Copy link
Author

Alatarius commented Apr 30, 2023

I have the detector tube connected to the stack/item injectors when I exit. I built an automated furnace system for ores and foods

[edit] The detector tubes are connected with the mesecon wires so that it will continually pass a signal to the injectors to perpetually run.

[edit 2] I attached an image so you can see the setup
smelter

@numberZero
Copy link

numberZero commented Apr 30, 2023

can you confirm it gets stuck in on-state even if there's no mesecons wires or mesecons devices connected to detector tube when you leave game?

I can. It does. On latest master (bd5a423) too (with mesecons [release=17623] and digilines [release=16482] from ContentDB if that matters).
screenshot_20230501_005353

@S-S-X
Copy link
Member

S-S-X commented Apr 30, 2023

Checked code and cause seems pretty clear: it is just that detector uses mintest.after to update states and there's nothing restoring state, item_exit isn't actually real event handler but just a thing queued with mintest.after.

So I guess have to add some way to reset state after server restart, best would probably be actual events for item movement.
Other options from top of my head would be actually tracking timers and continue after restart.
Or rather dirty LBM reset but LBM would not be complete solution because it is actually one-shot-ABM and gets triggered for block activation instead of block loading but probably "good enough".

@numberZero
Copy link

detector uses mintest.after to update states

Maybe use Mesecons actionqueue instead? It has public API IIRC.

actual events for item movement.

Maybe, or maybe not. That may get pretty hairy as there may be many items in the tube simultaneously.

@S-S-X
Copy link
Member

S-S-X commented May 1, 2023

Maybe use Mesecons actionqueue instead? It has public API IIRC.

Thanks, I guess this is probably best option if it easily allows similar rate limiting what now happens with stack counters + timer.

@wsor4035
Copy link
Contributor

wsor4035 commented May 1, 2023

if this can be done without a hard dependency on mesecons that would be preferable

@S-S-X
Copy link
Member

S-S-X commented May 1, 2023

if this can be done without a hard dependency on mesecons that would be preferable

Yes seems it is. Actually seems like even simpler than current method (from user's perspective) and seems it can easily be fully contained within tube definition (which is only registered if mesecons is available). Basically just single fire and forget API call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants
@numberZero @wsor4035 @S-S-X @Alatarius and others