3.0 Released!
It's been a long time coming, but the Community Addons is back in the swing of things! For a long time now, we've been anticipating the arrival of Bolt 2.0, which brought many improvements, an overhauled API, and the obsoleting of many of the units in the Addons. Now that the future of Bolt looks a bit different, there is value in continuing the Community Addons project, so we're back at it.
For this release, we've got an improved release strategy laid out, AOT compatibility, and a whole pile of toys from Jason Jones. A lot of those units were released previously on his website separately, but he's brought them under the Community Addons where the community as a whole can help maintain them and improve them. If you're looking to get the new features for your project and already have the 2.4 units, be sure to read Updating from 2.X below.
The Addons are in the best state they've been in for a long time, and it's exciting to be working on the project again after such a long break!
Updating from 2.X
Important - Do not skip if you are updating from the 2.X line of units!!!
The Community Addons project has moved away from distributed dlls to the Unity Package Manager. The primary driver for this is the existing dlls caused problems when building for AOT platforms (namely, Unity didn't realize it needed to include the dlls in the build). By using the Unity Package Manager, we can actually deliver the source code to your projects, enhancing your ability to tweak, customize, and participate in the project, while simultaneously slaying the AOT dragon once and for all. In addition, we can push out fixes as we have them, rather than slowly bundling things up into a large release.
All in all, it's a much better delivery system, but it does mean that you need to DELETE all Bolt.Addons.Community dlls from your Assets/Plugins directory! These are old, no longer updated, and will interfere with the new version. Simply remove them from your project, and then follow the Installing the new version instructions below for how to add project via the Package Manager.
If you have Jason's Bolt Extensions or UAlive, contact him on how to update safely now that these units are in the Community Addons.
Installing the new version
The Community Addons now uses the Unity Package Manager to directly pull the repository down into your project. However, this does mean that you need a configured .git client, because Unity does not provide one for you. This is a one-time setup step per computer that many of you can skip over if you've actively used .git before. (for more information on the subject, you can consult Unity's documentation on the matter: https://docs.unity3d.com/Manual/upm-git.html)
Prerequisite: If you don't have a git client installed on this computer
- Install Git. https://git-scm.com/downloads
- Otherwise, manually configure Git to be a part of your system environment.
- Windows:
- On Windows, this means adding the git executable to your PATH environment variable
- Right-click My Computer on your desktop or start-menu, and select Properties.
- Click the Advanced system settings tab.
- Click the Environment Variables button.
- Under System Variables, click PATH (can also be called Path) and click Edit.
- Paste the location to your git.exe and insert a semicolon at the end as a separator between what you just pasted and what was already there (No spaces). For me, this path was
C:\Program Files\Git\bin\git.exe
- Windows:
(other platforms are supported, ask on the discord for help)
Installing
The Community Addons can be installed using one of two methods:
Via Package Manager:
Open the Unity Package Manager, and click the "+" button in the top-left corner :
and add the following url:
https://github.com/RealityStop/Bolt.Addons.Community.git
(for more information, or if errors are encountered, see https://docs.unity3d.com/Manual/upm-ui-giturl.html)
Then, use the Tools menu to Build Unit Options, and they're ready to go! Once you've rebuilt your unit options, the new nodes will be available for use.
Manual install:
Alternatively, open Packages/manifest.json and add this line under dependencies:
"dev.bolt.addons": "https://github.com/RealityStop/Bolt.Addons.Community.git"
(for more information, or if errors are encountered, see https://docs.unity3d.com/Manual/upm-ui-giturl.html)
Then, use the Tools menu to Build Unit Options, and they're ready to go! Once you've rebuilt your unit options, the new nodes will be available for use.
New Content
Whoohoo! Now we get to talk about all of the new toys! In addition to the new update method, the AOT compatibility, and the ability to see the source directly in your project, we also have new Units to play with!
AOT Compatibility
There is now a custom build script to pull in a custom link.xml to force Unity to include the Addons in AOT builds. The Dragon has finally been slain, and version 3.0 brings the first version that is fully AOT compatible.
Reroutes
Behold. You can finally reroute flows and values wherever you please. You can find them by searching 'reroute' in the fuzzy finder. Once you've picked them from the fuzzy finder, you can simply press spacebar
to lay down a new reroute.
Just promise to show us any spaghetti atrocities you commit:
Random Element
There is now a unit that can select a random element from an IEnumerable, with optional toggles in the graph inspector for accessing both the key and value of a dictionary:
Be aware that because of how the data containers are structured, accessing elements from an array or list is far more performant than accessing a random element of an dictionary (in my testing with 10000 elements, arrays/lists were about 100x faster). It's still fine to pull from a moderately sized dictionary, just try not to do it every frame.
Query
We now have a Query node, which can perform operations similar to how you might use LINQ in C#. The simples, Any, is shown here:
Any returns if the collection has any items (and thus, is not empty). For instance, if you maintained a list of targets in range, you could query the list to test if there were any targets in range.
However, the Query node offers a drop down that can alter the operation performed for several other variations:
Some of the other variations have to operate against each element in the input Collection
such as the following case that results in a filtered list Where the condition yielded true:
Here is a super basic example using the Where method. If the item is above 10, its automatically added. Here's some input, and the resulting output:
When working with some of the Query types, you'll notice that the condition is checked multiple times, which means you need to use a variable or reroutes to feed the updated result back into the unit each time. This is because (using the above Where example), each item in the Collection
input node is being tested to determine which elements result in a true
Condition
result. To do this, it will set the Item
output and pulse on the Body
flow output, much like the For Each
node does. However, after that flow has terminated, the Query will recheck the Condition
to find the result of the operation for that Item in the collection. Using reroutes to show this relationship, the following is an equivalent:
Array and Multi-Array support
Three new units have been added to improve support for arrays and add multidimensional arrays to Bolt. If you are unfamiliar with multidimensional arrays, you can think of them as an n-dimensional table, or a list of lists, rather than a flat list. (Creating jagged multi-arrays are currently not supported, use C# for that)
Additional units that are able to fetch items from arrays (of any dimensions) have also been added. You can find all of them under Community->Collections=>Multi Array
Convert
Convert is an AOT safe way of converting an object or collection from one type to another. This was created so we could use Linq properly by evaluating only after we converted. The convert unit however, is intended to also convert any object to another type if it is an allowed conversion.
And that's all for now! Go make something awesome!