+19

Unit Tools : Flow Control

JasonJonesLASM 2 years ago updated by Lazlo Bonin (Lead Developer) 2 months ago 41


I wanted to start a serious of narrowly focused tools, that expand the different categories of Bolt. This first one is Flow Control. This will provide you with the means of controlling the flow of your game better, making tedious tasks more enjoyable. Here are a series of GIFs and information about each to get you start. Click the download image at the bottom of this post to get this package.



COMBINE


This unit waits for all connected flows to enter before continuing on. Simple as that.




DO ONCE


Do once performs a one time action, while simultaneously doing another on the same frame, or starting on the next frame. After 'And' or 'Then' is performed, no matter which one, it will continue every frame after as long as there is an input into Enter. You can also reset the Do Once by entering into the Reset Control Input.



FRAME SEQUENCE


Frame Sequence is just like a normal sequence. The difference is every Control Output happens a frame later than the previous one.




CYCLE VALUE and CONTROL


Cycle has two types. Value and Control. Each time you enter this unit, it will switch to the next port and flow out, or send out it's current value out of the options you have provided. Option for tag setting to see which index you are on instead of an int.




WAIT FOR SECONDS LOOP, WAIT UNTIL LOOP, and WAIT WHILE LOOP


The Wait Loops extends the basic Wait units in many ways. You can place these in an Update without worries. There is a toggle for Async, if you want to fire a new one every frame. If not leave it untoggled, and it will block more from entering. There is looping, an entered and exit state, as well as break. Break will stop the loop in its tracks and exit. With Wait loops there is a little more, you can now get the time elapsed, and time remaining.

That is it, download below, the latest version is 1.0.3:




PREVIOUS VERSIONS:

v1.0.3
v1.0.2
v1.0.1

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):

Man, that looks absolutly awsome!!
Thanks a lot for sharing! Much appriciated!

edit: A little text file with some install instructions would be helpful.

+2

Thank you! Was in beast mode to do this one. But I love it, expect more themed things like this.

I forgot to put back in the DoOnce info though. So there is And and Then. If you do not tick Then, And will fire every frame along with the same frame as DoOnce. If then is ticked, it'll start the frame AFTER DoOnce.

Totally understand. How do I install your extension?

+1

You just open the Unity package and install where it asks. Then Tools > Bolt > Update Unit Options. Then after goto Tools > Ludiq > Generate Custom Inspectors. After it'll be in the fuzzy finder under Control and Wait.

+4

Looking great!

Love the combine & do once especially.

The more I think about it, the less satisfied I am with the way wait units are handled at the moment in Bolt. I'd love for them to be compatible everywhere, in loops, nested, etc. I'll have to rethink it for a future version!

Thank you. I think combine is my favorite too. Might need to tweak that one, a tad. Think there may be a small loophole.

I don't mind them as a lightweight solution, but I always wanted more. Loops have always been a mainstay in my production, that's why I always tried to add in looping. So many situations where something should happen while another is halting going forward. Usually you use one off situations, seemed state machines are a lot for such little tasks. This is here for now though, I'd love to see how your expand the API on that one though, if necessary. 

+1

Looks very useful, will be having a play with them later and looking forward to your awesome tutorial on unit creation :D


p.s. how come your not a Bolt dev ;)

+1

UPDATE: Flow Control 1.0.1

Combine       

- Added Relation, for better error detection on connected units.

- Reworked the base of it all. Now supports connections flow entering multiple times without effecting its connection count. Once it is complete, it now properly resets itself. See below:



DOWNLOAD Version 1.0.1

UPDATE: Flow Control 1.0.2

Wait Loops

- Fixed all wait loops, where breaking from one will break from all. 


DOWNLOAD Version 1.0.2

+1

Yaaay. This was a nasty bug. Me an reaper were "WTF" on Stream :D

I love combine.  Seriously.  Thank you!

Thanks. No problem! That one is the most satisfying to me too. Glad you are enjoying it. Incoming update in like the next 20 seconds. Some of it is pretty pertinent if you use the wait loops at all, and a couple other additions.

+1

UPDATE: Flow Control 1.0.3

Frame Sequence

- Added a Reset Control Input

Cycle Value and Control

-Added a Reset Control Input

Wait Loops

- REALLY REALLY TRUELY Fixed the loops breakability. Went back and retested (With others!) and rebuilt until it worked perfectly.

- Fixed Time Remaining not changing. 

- Added a Break output, to do something different if your break instead of naturally exiting.


DOWNLOAD Version 1.0.3

Hi Jason,
thanks a lot for making your Flow Control better and better. Would it be possible to include the version in the naming of the file? That will help to keep an overview.

Thanks


edit: One more question. Is there a chance to add a description to the units within bolt, like the official units have (dokumentation)?

That would be awsome!

+1

I'd love to and already wanted that, but if someone downloads the one from the original at the top (I can't edit a post once a comment happens), then they will be just downloading the oldest versions (which would have been broken). I do have the old versions named out already still on the server though.  I could leave those old versions to download on each new update? 

I see, you are trapped :). It is ok the way it is now, i guess. Maybe Lazlo has an idea on how to improve the download section if more people post more often.

But Thanks for your efforts!

Okay, it is all set now. I will continue to have seperate named unitypackages for every new version of each one I release. 

Try now, you should be able to edit your post even after it's been commented on!

Nice one thanks! This well help 

+1

UPDATE: Flow Control 1.0.4

Wait Loops 

      - Fixed wait loops still running on scene change. All loops on that particular flow/state machine will be destroyed upon the MonoBehaviour or objects disabling and destruction. 

      - Complete internal rework of the code. Way cleaner and easier to work with, and much more efficient, with less code to run each loop.

Combine
      - Deleted the left over Debug Logs showing its current connections and entered connections.


DOWNLOAD V1.0.4

Hey Jason, I just downloaded your plugin and it's really awesome ! 

But I'm running into an issue, maybe a bug : When a break enters a break on "Wait Loop" it's impossible to relaunch it (on enter) the node will remain inactive/blocked, no matter what. Is that normal ? 

Thanks for the help and time, 

Jonathan. 

+1

If Async is left unchecked, another connection cannot be started until it has completed. It was an added feature to allow useable loops within loops/update ect. Uncheck it and it can be fired multiple times

If a loop is broken and then reentered and doesn't work, it's a bug. I've made some internal changes that might fix it as a side effect though. There was another break issue reported. 

I have an issue with Combine in  a single frame as well. I'm currently in the midst of some other stuff outside of games, but I'm going do what I can to get it uploaded soon, with the wait fix anyways. 

Ok, well this explains the problem I got then, thanks !

Hey Jason, I'm havin another issue but this time I think it's a bug :

Unscaled time on the wait loop node does not seem to work (I'm using it a lot for my game, it's really usefull for quick animations, here, for the pause menu UI, with a 0 time scale).

Here is a repro :



Once it's entered (on the wait loop node) he will get stuck and show a strange value on the elapsed (that will also be stucked)
+1

I'll check into it soon, thanks for the visual imagery to accompany this. Right now I'm scratching my head, I must have done something and can't get my plugin to load the modules. I'll take another stab soon, but I'm sure the new changes will fix this as well. I'm juggling a few things at once right now. If anyone's interested I can just upload the source. I'd like it to be structured, but unfortunately I know nothing about public repos to lead something like that.

Not sure in the meantime you want to try the unit i made, https://support.ludiq.io/forums/5-bolt/topics/1004-animation-curves/

I wrote it because of the need for normalised time for stuff?  

Nice work, looks great and will help till I can fix this.

I'm going to attempt to open up my stuff on GitHub. I will have to learn it first, but I'd like everything to now become open source and be able to have others contribute. Having multiple projects, multiple unit packs, and requests as a solo dude, is hard to maintain, to where a week has gone by and I can't resolve everything still on just one set. Plus maybe someone smarter than me will make them faster and better. I'll work on that over the next week and post the details.


+1

Hey, Jason, I already have them up, I just hadn't made any sort of announcement or anything until I had any sort of significant contribution.  If you still want to collaborate, just ping me on Discord sometime

Cool!
Do Once did not work for me. Are there any limitations where can it work?
Wait For Seconds Loop works fine everywhere so far.

+1

No limitations and honestly it's the simplest unit to develop ever, not sure why It wouldn't work. It was done exactly like the original macro version that's up almost 1 to 1 with some additions for switching ports.

Honestly probably not going to do much updating. With these units, with Wait units getting an overhaul in 1.4, I might as well just stop, because there are too many use cases, and situations that break them,  be that will probably be fixed in next month or two by someone who actually developed this plugin. There is the source uploaded for anyone who wants to fix it or contribute, but I'm going straight Macro now for any releases, because it's simpler, can stop worrying about reflection issues until better recovery is introduced (some stuff coming soon).

But the Macro of Do Once works nearly the same, just seperated into different units. Can get it here: 

https://support.ludiq.io/communities/5/topics/634-do-once-and-and-then

And source for anyone who wants them: 

https://support.ludiq.io/communities/5/topics/1106-all-my-unit-source-files

Sorry for the hassle. Even wait units can be done as Macros, just a little trickier. Maybe I'll release something to replace this, that is easier for other non coders to work on in such use cases. Not many hardcore coders here that seem willing to do Custom Units yet, so any issues I can't figure out, well I'm out of luck getting help.

I'll update soon, might try to take a stab at this today, see what I can do. 

Sorry, it's working!
Just didn't have reset flow so it never happened again, and it led me to thinking that...
Thanks

+1

Ooh ok, cool, no problem. Still going to do this though!

Where do I need to install Flow Control addon in 1.3.0? Editor hangs when trying to generate types.. And I can't install Bolt now..


Same happens with comments addon. 

I guess Bolt can't install because of that


Also getting this:

Sorry about that, been doing other various API things at the moment, so I haven't used it to notice. I did have to change some namespaces on a few others when helping someone out. 

Kinda swamped right now, but everything going to eventually be redone, C# files on my website for all assets, and everything pickable individually, tutorials for each, and other various things. So it's going to take some time to both get the site finalized, tidying up, and producing complete content. Hoping by the end of the month, but they will all be redone completely. I learned so much since it's release.

I don't want to use DLLs anymore for that reason. It's nothing some extra folders can't do for organizing. It's caused me a lot of serialization problems between editor files and runtime when something is removed. If you go to Reality.Stop()s GitHub, he has both sets of those in CS files if anyone wants to give it a stab in the mean time.

I've got the comments converted over to 1.3, but I haven't adjusted the others yet (sorry, been working on real life stuff - bleh).  I was going to use the conversion as an opportunity to learn from them  :-D .  It's fairly trivial, though, just shuffling some namespaces around and cleaning up which dlls get included where.  I haven't actually posted anything on the matter yet as I wanted to talk to you about moving the namespace for the ones in the addon pack to prevent naming conflicts if you're still planning on releasing those external to the pack.  In addition, the pack attempts to merge things into a few packs the user can choose from rather than individual releases.  Not sure if that's okay with you, or if you want to keep things in the LASM namespace.  


Also, you're a contributor on the github, Jason, you could modify the shared ones there AND put them on your website :-).

Yeah, I'm going to hit you up later  on Discord. Just getting a little confusing. I'd love to fix them up as they are intended to be for the GitHub, so they play nice with everyone's current development. For the future with my website, I'm talking a complete revamp of everything from the get go. They will not be compatible, in the same namespace, folder structure, or necessarily named the same or contain all other same units. Since icons and some connection info changed, that mucked this execution thing up a bit, which is fine If I didn't feel my old code was confusing and mistake ridden, I'd have just kept patching the holes.

Sorry,i got trouble


Unloading broken assembly Assets/Plugins/LifeandStyleMedia/Bolt/Editor/Lasm.BoltAddons.UnitTools.FlowControl.Editor.dll, this assembly can cause crashes in the runtime

Unit Tools Version : 1.0.4

Unity Version : 2017.3.0f3

Bolt Versuib : 1.3

Api Compatibility Level : .Net 4.6


Yeah, I was doing some testing on a new version. Here it is though. 1.0.5.1 Combine is essentially broken internally, but it will compile. We are getting all of these except Cycles now native, so I will only be modifying those going forward. Port definitions are gone because they changed, but that only effects the labels for the port names to look cleaner. Everything else should be in order and transfer over. Just import this first, you will get a conflict after compile. then just delete the old dlls or old folders if there is nothing else needed. Then it will be fine and everything should be back to normal.

http://www.lifeandstylemedia.com/uploads/bolt/FlowControl_1_0_5_1_source.unitypackage

I tried downloading the latest version from the last post, and while it doesn't give errors, no new nodes show up when I update the units and generate inspectors. I'm in Unity 2017.2.0p4 with Bolt 1.3  Did I do something wrong? Thanks. 

+2

No nothing should be wrong, though I'm on 2018, they are just Cs files, and not made with any thing special for anything other than 3.5 Or above. It's worked for me and a few other I'm aware of. Gotta be some reason here.

+1

There was something wrong with the units, so I reset it back to default and it worked. Thanks!