Reading contents of space platform hub is wonky - Schmitt trigger doesn't work

Bugs that are actually features.
Eddie the Jedi
Inserter
Inserter
Posts: 22
Joined: Wed Jun 29, 2016 2:51 am
Contact:

Reading contents of space platform hub is wonky - Schmitt trigger doesn't work

Post by Eddie the Jedi »

I set up a Schmitt trigger on my space science platform to regulate the assemblers. The assemblers should be deactivated when there's lots of space science packs and not reactivated until they run low. What happens instead is that, when the number of space science packs in the hub reaches the high mark, the whole thing starts oscillating on/off every tick.

I copy/pasted the two combinators that comprise the trigger (with their connections) to another place on the same space platform, and connected a constant combinator and a lamp to the copy. It works just like a Schmitt trigger should. But when I connect the space platform hub to the copy, the copy does the same bizarre oscillation.

I can only guess that the "read contents" function of the space platform hub outputs signals differently somehow, compared to constant combinators/chests/storage/tanks/everything else in the game. Surely this can't be the intended behavior?

Here's a picture of the original Schmitt trigger in situ. I could put together a blueprint but this should be enough to reproduce the issue, it's a widely used design:
Image

And a picture of the copy:
Image
eugenekay
Fast Inserter
Fast Inserter
Posts: 165
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Reading contents of space platform hub is wonky - Schmitt trigger doesn't work

Post by eugenekay »

Factorio is not a true-to-life Electrical Engineering Simuator. :-) You have not included a Blueprint string, so we cannot test your Setup or see the Combinator specifics.....


You can implement a Latch with a single combinator, by wiring the "Output" to the "Input", and adding some Conditions:
Screenshot 2024-12-15 223518.png
Screenshot 2024-12-15 223518.png (611.85 KiB) Viewed 588 times


This simple circuit is used to keep between 200 - 500 Magazines on the Belt.

Good luck!
Eddie the Jedi
Inserter
Inserter
Posts: 22
Joined: Wed Jun 29, 2016 2:51 am
Contact:

Re: Reading contents of space platform hub is wonky - Schmitt trigger doesn't work

Post by Eddie the Jedi »

The same arrangement of combinators that works as a Schmitt trigger should when the input is a constant combinator, does not work when reading the hub's contents. That is what I'm reporting as a bug. I'm not asking how to make a nicer Schmitt trigger.
Muche
Filter Inserter
Filter Inserter
Posts: 704
Joined: Fri Jun 02, 2017 6:20 pm
Contact:

Re: Reading contents of space platform hub is wonky - Schmitt trigger doesn't work

Post by Muche »

I tried to reproduce it on v2.0.25 (using this Schmitt trigger implementation), and did not manage it; output was stable when connected to a constant combinator or a hub.
But the hub contents was stable, I was not requesting it on the planet or anything.

Could you try to go into editor mode and stepping it tick by tick and evaluating wires signals?
eugenekay
Fast Inserter
Fast Inserter
Posts: 165
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Reading contents of space platform hub is wonky - Schmitt trigger doesn't work

Post by eugenekay »

eugenekay wrote: Mon Dec 16, 2024 3:38 amYou have not included a Blueprint string, so we cannot test your Setup or see the Combinator specifics.....
Reading the Contents of a Space Platform Hub (and refilling with Science Packs as-needed) works just fine here (exact same Combinator setup):
Screenshot 2024-12-15 231103.png
Screenshot 2024-12-15 231103.png (1.43 MiB) Viewed 570 times
Eddie the Jedi
Inserter
Inserter
Posts: 22
Joined: Wed Jun 29, 2016 2:51 am
Contact:

Re: Reading contents of space platform hub is wonky - Schmitt trigger doesn't work

Post by Eddie the Jedi »

Alright, I've found something. My two-combinator latch goes wonky when its input is the space platform hub contents, only if the space platform is also configured to transition from a non-unloading to an unloading state at the same high mark. eugenekay's one-combinator latch works fine, and my latch also works when I have the space platform transitioning to unload based on the latch's output signal instead of the cargo count.

I still think this is a bug, because I don't see any way for my latch to go into an oscillating state like it does, unless the space platform hub becomes... uncomputable??... for a tick during the state transition. I'll try running it in editor mode to see what happens.

Here's a blueprint if anyone wants to test:
Eddie the Jedi
Inserter
Inserter
Posts: 22
Joined: Wed Jun 29, 2016 2:51 am
Contact:

Re: Reading contents of space platform hub is wonky - Schmitt trigger doesn't work

Post by Eddie the Jedi »

In editor mode, I can see that on the tick when the input of the decider combinator in my Schmitt trigger is 200, the science pack count is not 1000 (which would produce that result) but much lower, because the space platform has already transitioned to the unload state and decremented its cargo count by the amount to be unloaded. This leads to the oscillating behavior.

This seems like a bug, in that the unload happens in the same tick as the transition, but is not reflected on the circuit network output for that tick. However, fixing this bug by correctly reporting the cargo count, when the unload happens in the same tick, wouldn't help my use case, because my two-combinator Schmitt trigger (EDIT: or a one-combinator latch, come to think of it) will never stop production.

What I need for this whole setup to work properly for me is for the cargo unload to happen at least one tick after the science pack count reaches the high mark. I found I can make this happen by having the space platform transition to another non-unloading state for zero seconds before unloading.
eugenekay
Fast Inserter
Fast Inserter
Posts: 165
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Reading contents of space platform hub is wonky - Schmitt trigger doesn't work

Post by eugenekay »

Eddie the Jedi wrote: Mon Dec 16, 2024 7:35 amThis seems like a bug, in that the unload happens in the same tick as the transition, but is not reflected on the circuit network output for that tick
How would this work? If the Circuit Network has finished calculations for a given Tick, and the Unload logic has processed, then how would the Circuit Network re-calculate before the next Tick?

This is why Factorio is “not an electrical engineering simulator”. It’s a tick based game, and deadlocked or infinitely oscillating circuits happen all the time.

What if you try adjusting your Setpoints such that “extra” Science packs are stockpiled, more than what is being Requested by the Landing Pad? Assuming that the point of this circuit is to reduce the rate at which Drop Pods that are sent, please be aware that Release 2.0.25 (currently marked experimental) includes a change to address this.
Muche
Filter Inserter
Filter Inserter
Posts: 704
Joined: Fri Jun 02, 2017 6:20 pm
Contact:

Re: Reading contents of space platform hub is wonky - Schmitt trigger doesn't work

Post by Muche »

I've stepped through it as well and platform hub contents reporting works fine.
Yes, it transitions from not unloading into unloading state and launches cargo in the same tick, but that is not the issue here.

The issue is it reports as having cargo of 1000 for one tick only, the next tick it has, e.g. 990, and used Schmitt trigger implementation doesn't seem to handle one-tick inputs correctly.

Not a bug.
Eddie the Jedi
Inserter
Inserter
Posts: 22
Joined: Wed Jun 29, 2016 2:51 am
Contact:

Re: Reading contents of space platform hub is wonky - Schmitt trigger doesn't work

Post by Eddie the Jedi »

The behavior of my Schmitt trigger is definitely not a bug (BTW thanks for the helpful tips on that), but the behavior of the space platform hub on the circuit network definitely is. Here are two screenshots from the tick when space science packs are inserted into the hub:
after-1-hub.jpg
after-1-hub.jpg (1.68 MiB) Viewed 390 times
after-2-pole.jpg
after-2-pole.jpg (1.63 MiB) Viewed 390 times
And from the tick immediately before that one:
before-1-hub.jpg
before-1-hub.jpg (1.68 MiB) Viewed 390 times
before-2-pole.jpg
before-2-pole.jpg (1.63 MiB) Viewed 390 times
The hub outputs a value of 1000 space science packs when it has only 592 after unloading. There was no tick in which the hub actually had 1000 science packs, because the unload happened during the same tick as the insertion.

@eugenekay: Once again I'm grateful for your combinator tips, but before you tell me again that I'm expecting too much from the game, I'd ask that you carefully read every entry in the 1.1 release changelogs here: https://wiki.factorio.com/Version_history/1.1.0. Then come back here and tell me why it should be beneath Wube to fix this bug. 8-)
Muche
Filter Inserter
Filter Inserter
Posts: 704
Joined: Fri Jun 02, 2017 6:20 pm
Contact:

Re: Reading contents of space platform hub is wonky - Schmitt trigger doesn't work

Post by Muche »

I don't see any issues in your screenshots.

There are 991 packs in the hub, 991 reported on the wire.
Inserters put in 9. There are now 1000 in the hub. Platform immediately transitions into unloading state and launches 408 packs down. Reports 1000 on the wire.
Yes, you can't see the 1000 in the hub, they have been already launched.

The most important tick is the next one. I would guess that the hub would report 592 on the wire in this one.
This is the situation your Schmitt does not handle - one tick the measured amount is higher than the upper limit, the next one is in the middle region.
As there is one tick propagation delay, combinators decide upon conflicting information and keep switching between the two states.
eugenekay
Fast Inserter
Fast Inserter
Posts: 165
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: Reading contents of space platform hub is wonky - Schmitt trigger doesn't work

Post by eugenekay »

[Koub] Removed by request of the author.
Locked

Return to “Not a bug”