Page 1 of 1

How to create a new combinator?

Posted: Sun Nov 09, 2025 2:12 pm
by Xeon257
I want to create a combinator that represents sine and cosine functions.

Is there a better way to build a machine that performs this kind of circuit processing, other than using the tick event?

And to implement this, do I have to keep track of every combinator entity and run a loop on each tick?

Re: How to create a new combinator?

Posted: Sun Nov 09, 2025 9:24 pm
by DaveMcW
Yes, you must use the on_tick event to get input from a circuit network.

Output must be a constant-combinator where you set your processed signals.

Re: How to create a new combinator?

Posted: Tue Nov 11, 2025 7:55 am
by Osmo
DaveMcW wrote: Sun Nov 09, 2025 9:24 pm Output must be a constant-combinator where you set your processed signals.
Must is a wrong word, constant combinators are a common option, but decider combinator can also be a good choice if your entity has input and output sides, since decider's outputs can also be freely manipulated.

Re: How to create a new combinator?

Posted: Tue Nov 11, 2025 9:07 pm
by eugenekay
The Sine function can be implemented using a Lookup table, with a Filter Combinator in "Select Input" mode:
11-11-2025, 16-02-01.png
11-11-2025, 16-02-01.png (57.99 KiB) Viewed 16 times


The values are normalized to three digits (1.000 = 1000), with an extra Arithmetic Combinator to account for 0-indexing. As-configured, this mechanism displays sin(30) = 500. With a bit more work this circuit could be extended to handle 91+ degree Input values using the Arithmetic Combinator's Modulo operator and some more Deciders.... but I got bored and stopped here.

I hope somebody finds this useful!