• Hi Guest!

    We are extremely excited to announce the release of our first Beta for VaM2, the next generation of Virt-A-Mate which is currently in development.
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.
SimpleStateMachine

Plugins + Scripts SimpleStateMachine

Download [<1 MB]

entitycs

Active member
Joined
Jun 9, 2021
Messages
89
Reactions
150
entitycs submitted a new resource:

SimpleStateMachine - Spam-Create, Modify, Undo, Compare & Iterate through the States of your Scene/SubScene/Atoms

  • Thank my early backers, esp. Vitlam, if you end up having fun with this.

    SimpleStateMachine

    Main goals:
  • Help users build interactive, and sequential scenes, with less fear of making mistakes.
  • Give the user a better sense of ability, without having to learn much more beyond the native UI.
  • Give users a way to experiment with controller physics values - differences in how character's body moves in...

Read more about this resource...
 
Is this a "state machine" in the Computer Science sense (a symbol graph) or a "procedure that remembers stuff" sense?
 
You could call it a simple version of one. Kind of depends on what you do around it.

"The machine is in exactly one state at any given time, and it changes to a different state in response to inputs, producing outputs based on the current state and transitions."

I honestly haven't done much testing around the "Range" options I made available on request. You could use them in a way that breaks the idea right away.

Basically, it simply saves the state of things, in many variants, and if using only a single instance, gives each state a node within a finite linear graph where states can be entered / exited via the algorithms the machine provides. But I don't stop users from moving the "cursor" and re-appearing at any state from any other state. That's part of what makes it simple. It's not meant to constrict traversals / transitions as part of its intentional design.
 
I'll release a simple demo scene showing how to use it for UI branching. I'll throw in some SFW 2-character states + transition examples too. Working incrementally on my first big scene, showing more use cases & other stuff - couple weeks out though, for the bigger scene.
 
Sup dude... I'm finally gonna give this one a try! (and then also try to wrap my head around your comment on Sensor ;)
 
Sup dude... I'm finally gonna give this one a try! (and then also try to wrap my head around your comment on Sensor ;)
It'll make sense when you see the "lite" scene... I think that's where I'm supposed to release it? The rig would be a little more advanced, but the geofencing between rooms, then adjusting sensor instance(s) per room (by adjusting sensor directly, then creating a slot for each setup using the state machine) would be pretty simple.


aufwiedersehen
 
Use Case Examples: "Swappables"

Custom Unity Asset State Swapping


Player-Preference-Capable Swapping (eg. Player-Chosen Appearance + swaps later in scene)
 
"draft"
Feature Update Preview Thread
  • New feature in latest version - ignore controller restoration on grasped controllers.
  • Feature test - Triggering parent SubScene state from child SubScene Animation, + separate Animation + end of loop trigger for each state: verified working.
    • Haven't tried the feature test on v10/v11, but I don't see why that wouldn't work.
Setup:

# Top Level involving the state machine consists of
SubScene -> SubScene -> Person
names/uids: (.stateTracked -> SubScene -> Person)

# Top level state machine instance
.stateTracked -> SimpleStateMachine -> 4 States
* All -> Controller -> Controller -> All

...Controller states are moving the limbs/controllers.
..."All" states are not only moving controllers, but triggering Animations on "SubScene".
...Triggers in the SubScene animation are making calls back to the parent instance (iterating through the 4 states)
 
Last edited:
I've got error messages at restores in slots. I want to swap the persons in scene on the mal person. "Atom wide" is activated. It would better if the Atom1 can change to Atom2 in milliseconds. Could it be that you can change the Atom-ID?
 
I've got error messages at restores in slots. I want to swap the persons in scene on the mal person. "Atom wide" is activated. It would better if the Atom1 can change to Atom2 in milliseconds. Could it be that you can change the Atom-ID?
If I understand correctly, you have 2 Persons to swap, which may be working, but with some reported error, and you're wondering if the plugin state can include the Atom UID.

"Atom Wide" is a setting that applies to the plugin instance, and/or to a state slot. When a state slot is created with the "Atom Wide" option selected on the left side of the UI, this means that restoring to this slot will trigger "Next" or "Prev" on other instances of the plugin. Any/All other additional instances on the original Atom *or its child Atoms* will try to move to the Next/Previous state, if on the right hand side of the UI, "Atom Wide" (or "Game Wide") is selected.

Changing the uid of Atoms through the plugin is not currently supported.

I believe I'm not fully understanding the entirety of your question though. Can you elaborate a bit more? I am currently doing a rework of the save/restore formatting, which will make the next version fully incompatible with previous versions - but part of the goal is to not need to tie the UID of Atoms to the state/slot data - only the names of sub-controllers, (eg. Person joint controllers).


If there is a plugin that can trigger a change of UID, you could in theory use the MVRScript slot types along with the plugin to switch the UIDs of atoms back and forth...
 
If I understand correctly, you have 2 Persons to swap, which may be working, but with some reported error, and you're wondering if the plugin state can include the Atom UID.

"Atom Wide" is a setting that applies to the plugin instance, and/or to a state slot. When a state slot is created with the "Atom Wide" option selected on the left side of the UI, this means that restoring to this slot will trigger "Next" or "Prev" on other instances of the plugin. Any/All other additional instances on the original Atom *or its child Atoms* will try to move to the Next/Previous state, if on the right hand side of the UI, "Atom Wide" (or "Game Wide") is selected.

Changing the uid of Atoms through the plugin is not currently supported.

I believe I'm not fully understanding the entirety of your question though. Can you elaborate a bit more? I am currently doing a rework of the save/restore formatting, which will make the next version fully incompatible with previous versions - but part of the goal is to not need to tie the UID of Atoms to the state/slot data - only the names of sub-controllers, (eg. Person joint controllers).


If there is a plugin that can trigger a change of UID, you could in theory use the MVRScript slot types along with the plugin to switch the UIDs of atoms back and forth...

Admittedly, I'm trying to understand the plugin. I added the plugin to both users and understood that the Atomwide checkbox had to be checked. I thought the plugin worked by loading it for each user, and then switching between the two when I clicked "Next." Unfortunately, you can't see in the video what was actually done before.

For me, the default Genesis model loaded when I clicked Next, with an error log. I'll have to copy that out.
 
Admittedly, I'm trying to understand the plugin. I added the plugin to both users and understood that the Atomwide checkbox had to be checked. I thought the plugin worked by loading it for each user, and then switching between the two when I clicked "Next." Unfortunately, you can't see in the video what was actually done before.

For me, the default Genesis model loaded when I clicked Next, with an error log. I'll have to copy that out.
I just packaged up v18 of the plugin. It's also free - just writing up another release for the hub, but no idea how long it would take to reach "published" status on here these days.

If you want to join the discord, you can watch me create with it, and ask questions in the chatroom... follow along even...

The plugin can do so much, it's really difficult to make any number of videos to explain what it does / can do, because there's so much it can do. That's why I set things up so I could stream through the Discord. It'd be much easier to understand.
 
Admittedly, I'm trying to understand the plugin. I added the plugin to both users and understood that the Atomwide checkbox had to be checked. I thought the plugin worked by loading it for each user, and then switching between the two when I clicked "Next." Unfortunately, you can't see in the video what was actually done before.

For me, the default Genesis model loaded when I clicked Next, with an error log. I'll have to copy that out.
I'll see if I can't go back to the scene I believe you are referring to... The "Outlook" environment scene with the "Swap" button... and update it to v18., so I can include it as an example scene in the package. How's that sound?
 
I'll see if I can't go back to the scene I believe you are referring to... The "Outlook" environment scene with the "Swap" button... and update it to v18., so I can include it as an example scene in the package. How's that sound?
That's would be fine. For this plugin / functionality can you earn money.
 
That's would be fine. For this plugin / functionality can you earn money.
This plugin is free. It's just had delays making it onto the Hub, so it gets shared more regularly in the Patreon. There is a paid plugin, whose menu system depends on SimpleStateMachine, but SimpleStateMachine itself is free. It's only being released on Patreon to keep up with the functionalities I need to create the scenes and menu systems I want for the other stuff.
 
Is this the scene you were referencing?

I'm remembering now that I was explaining that the swap could be done with a set of native triggers alone.

The scene is overly bulky as is, but I could remove all but the persons and buttons.

There's still the question of what you want to swap between the characters - eg. appearance only - appearance + plugins / behaviors. There are different types of swaps,

If I remember correctly, the only difference between using all native triggers vs. using SimpleStateMachine is that (I believe) the native trigger method requires two writes to the 'hard' disk (to do the swap efficiently - else you're waiting on writes & reads to the same file). I'm looking into whether using SimpleStateMachine still required one write to disk, or if I had found a method to do it all in memory...

1751495678351.png


If you want to use native triggers, for example, to only change the appearance presets, "live", as they are before the swap, you can use these...
1751495822171.png
,
1751495860001.png

where Person2 would Store with the name ending in 'ecxtmp2', then Load with the name 'ecxtmp'.

This is a good place to compare SimpleStateMachine state slot contents with the concept of native presets and SubScenes. If we ignore the "playable" features and iterating/indexing/connecting states to other instances/etc... and just focus on the data, the following comparisons can be made:

Changing the Receiver to 'Preset' in the native trigger (pictured above) in theory includes 'everything', and would work like an 'All' state in SimpleStateMachine - main difference between SimpleStateMachine "All" state slots being that everything is in memory, and saved with the scene vs. saving every "preset" / "state slot" to disk. These states/slots have only a negligible impact on scene load because they aren't applying themselves to the containing Atoms until they are "Restored To" via a "Next/Prev/RestoreToIndex" call.

Changing the Receiver to 'PosePreset' would work similarly to 'Controller' state types in SimpleStateMachine - main difference here being SimpleStateMachine Controller states are built on a per-Controllers basis. They do not change/include the state of all Controllers on the Person like a pose preset would - allowing for multiple state machines / other plugins to decide the state of every non-selected controller, while it iterates through states to "animate" its selected controllers only.

Changing the Receiver to 'PluginPreset' should be pretty similar to SimpleStateMachine 'MVRScript' state slots, with differences being the same as the "All" state slots. This, surprisingly, acts like setting triggers for a plugin's settings/options, even if that plugin doesn't provide a trigger. SimpleStateMachine slots then can act like triggers for scripts on the same Atom, and/or on child Atoms. Again, just act as though you are going to create a preset for the plugin(s) you want to change at some point in the scene, but instead of naming and saving a preset to save/load from disk on every change, you create a state slot, and use the 'Edit' and 'Play' modes along with the navigational triggers to control the "script preset triggers (if you will)".


This is also a good place to note that the "Others" state types for SimpleStateMachine will always include "everything" except for whatever other singular type or collection type options are available. So currently, they exclude controllers, scripts, and/or pose morphs, depending on the context.
 
Last edited:

Similar threads

Back
Top Bottom