State Machine Gadget Support
I’m imagining a state machine gadget, where the name of the gadget specifies a unique state machine. Then, a microchip could have a tab for state machine control which includes which state machine gadget it is associated with, and a numerical state number. The state machine gadget would be used to automatically enable the microchip associated with the current state, an input for setting the next state, and then a signal for jumping to the assigned next state.
Right now, using selectors and variables is more complicated than it should be because the timing of variable setting and selector changing has to be sequenced, and sequencing logic in dreams requires careful use of timers, which also adds unnecessary delay.
-
Just a general suggestion regarding timed sequencing, Timelines can be easier to set up and configure than Timers.
For the state machine itself, I prefer to use a Variable; start at 0 and count up in integers. Use an = Calculator to power on whatever you need for the current state; ideally just place each state in a separate microchip. If you want a repeatable timed sequence of states, then place Variable Modifiers on the timeline with your required length and order.
-
https://indreams.me/collection/cbLFjDcxHYj
I 100% agree with your suggestion. It would be really nice if there was a Dreams-afied state machine gadget!
In the meanwhile I have a state machine gadget for you!
-
There's probably a community version already built. If anyone knows of one and can provide a link, that would be helpful.
-
Lol I just did, well a collection that has one.
https://indreams.me/element/ovZrSNdfiHp
Here is the direct link.
Here is teh description from the creation:
This chips lets you maintain a changeable state without having to use pulses! You can speciffically set the state or use helpful prev/next inputs. The state will remain intact until you either reset the chip or turn off its power.
Why would you use this over the built in Selector gadget? Simply, control! This chip allows you to have more states, neater logic with a single state output, and continuous flow with no requirement of pulses.
The best way to utilise this chip is to wire a Calculator from the output. Then in the Calculator check what the state is and then power on a chip for that particular state. So for example "does state = 2 then power on the chip for state 2". This way you can contain all your logic neatly and have as many states as you want.
-
Can also use this variable gadget as a state machine:
https://indreams.me/element/ojJJWvTiMud
A Local Variable with the absolute minimum amount of logic. Get, Set, Add, Subtract (add -1) and Clear (power off).
-
you can already set up complex state machines using variables and selectors (selectors almost work like ENUMs in programming, which are mainly used for state machines already). In programming, or even other game engines, you program your own state machines. I believe that having a dedicated state machine would just be redondant to other gadgets that are mainly used for that.
-
I'm not quite clear on why variables are needed at all, unless you want them to be persistent. What kind of setups do selectors not do? Could you explain more about that? 🤔
-
The main issue for me with Selectors is that they're limited to 10 output ports. Variables also have the benefit of being able to use 'Get' Variable Modifiers anywhere without having visible wires across different microchips.
Please sign in to leave a comment.