Moon Logic deprecated

by mk-fg

Adds Lua-programmable circuit network combinator. Based on Sandboxed LuaCombinator and LuaCombinator2 mods. Probably won't work in multiplayer games.

Content
2 years ago
1.0 - 1.1
4.97K
Circuit network

g [fixed] Arithmetic combinator

4 years ago

I kind of like the mod fCpu. But it uses spooky legacy assembler code.
Your mod on the other hand comes with a constant combinator instead of a arithmetic combinator. Wouldn't it be good to combine the best of both worlds?

4 years ago
(updated 4 years ago)

There was a separate arithmetic combinator in Sandboxed LuaCombinator mod, and I've actually removed it here because:

  • It looked exactly same as arithmetic combinator wrt icon/sprite, was confusing that way.
  • Didn't actually function like arithmetic combinator - no led indication, static icon on top, etc.
  • Larger 2x1 size.
  • Not sure what are the benefits of having separate inputs/outputs, when you can set/negate/convert/encode any signals in lua easily.
  • Having >1 entities with slightly different behavior is more difficult code-wise.
  • More wires with diff behaviors is more confusing, both visually and wrt how it all works.

But not sure if maybe I'm completely missing some great idea behind using it.
Why do you want it instead of simplier constant combinator?

4 years ago
(updated 4 years ago)

I will try.
But in complex constellations it is often the problem of messing signals. And our entity will be used in complex situations, won't it.
So the separation of input and output often can help reducing complexity.

4 years ago
(updated 4 years ago)

Hm, I guess, but then it's also easy to fix by adding an arithmetic combinator with * + 0 -> * logic, to intentionally separate those.
Granted, +1 extra element is not nice, but imo a better fix for a more niche use-case than using more bulky and complex combinators everywhere.
Don't think I quite understand "messing signals" problem though, tbh.

4 years ago
(updated 4 years ago)

You want to take some input and calulate some output. If some item is both input and output how you can distinguish it?
Look at this example:
0eNq1kt1qwzAMhd9F106ZQ5M0fpVRSn68ViyRg62UhuB3n+0yyH7Y1ovdGGSk4/Mda4V2mPVkkRjUCtgZcqCeV3B4pmaId7xMGhQg6xEEUDPGKvZxQ5x1ZmyRGjYWvACkXt9ASS9+VRiHbjOR+6MATYyM+m4gFcuJ5rHVNkh+GBQwGRd6DUX9OH/YFQIWUFm9K4Js8MfWDKdWX5orBnOh7QUH1vZPeNZ0r5ozh4OBpDbHfPIN4PH+COkuunBRScbD6n5rH/vE5n1M5BNS/mOaXxHrd8Tq/xDlQ3/oLobPM307nz8SkUwRhRVI+mqzlAKuASilkB/kvtrXVVnJp7IovX8DFJjp0Q==

4 years ago
(updated 4 years ago)

You want to take some input and calulate some output. If some item is both input and output how you can distinguish it?

  • One obvious fix might be not to use same signal for both input and output.

    Essentially treat these as two different things on one network, instead of making two separate networks to reuse same one signal.

  • Negate input signal and set new value after that.

    For example: Input - red[A]=5, desired-output - A=0, code - out = -input = -red[A]
    Or: input - red[A]=5, desired-output - input * 2, code - out = -input + input*2 = -red[A] + red[A]*2
    And so on.

    Probably less observable and not as visually appealing or intuitive as other options, but should work, I think.

  • As already mentioned - add an arithmetic combinator as a one-way filter between two distinct networks.

But yeah, maybe built-in separate inputs would be kinda nice too, if sprite for the thing is less symmetrical, so it's clear which is which, or if script on the combinator allows to easily work with either end.
And probably a matter of personal preference too, as I definitely like simplier "square calculator-box on the network" approach more.

4 years ago
(updated 4 years ago)

Essentially treat these as two different things on one network, instead of making two separate networks to reuse same one signal.

Sounds kinda like a distinction between old circuit-switched networks (like non-digital telephone) and modern packet-switched networks (the internet).
I.e. instead of thinking in terms of input-to-output circuit passing through multiple checkpoints that connect these together on some conditions, one can just slap destination label on the thing and let factorio handle the routing.

4 years ago
(updated 4 years ago)

Thinking more about differences between these combinator styles, I came to like the idea of using one with separate (and easily connectable anyway) inputs/outputs more and more, so will change the combinator type here after all.
(or technically not change, as the implementation trick is to add same constant combinator, but invisible and connected to actually placed arithmetic/decider one outputs, and run everything pretty much in the same way otherwise)

Will probably handle the migration by placing all existing combinator code into presets, issuing a message about it, and just removing old ones, to avoid needing to do messy and error-prone one-off rebuilding and reconnecting for a larger entity.

Thank you for the idea!

Also, would you happen to know of any good sprite/image for new 2x1 thing?
(anything symmetrical and with roughly same style/perspective should work, easy to copy-paste colored leads from factorio sprites onto it)
I'm thinking to put some kind of thinking/glowing moon-orb on top of recolored decider combinator, but that's not very creative... wonder if maybe there's a good "brain in a round-ish jar" sprite to borrow somewhere...

4 years ago
(updated 4 years ago)

-- deleted --

4 years ago

Thank you for the idea!

Never mind. Although I have more ideas.

Also, would you happen to know of any good sprite/image for new 2x1 thing?

The one from fCpu I like. It is 2x2 so it fits more to the more extensive function it provides - in my opinion.

4 years ago

Seem to be a recolored arithmetic combinator with a cpu-ish plate on top instead of indication screen.
Would be easy to take a slightly-different decider one and paste same cpu on top of its screen, though wonder if I should try to get that screen to work somehow instead...

4 years ago
(updated 4 years ago)

Updated combinator type in 0.0.12, but currently didn't bother even doing "color rotate" on its sprites in gimp, or updating icons/thumbnail.
Want to check if display on this thing can be used to indicate something, and then either replace sprite with a static one, or maybe just recolor and slightly tweak frame on this one to keep the fancy display output.

New response