So I have just deployed a pretty big update mostly focused on Behaviors, but with a few other tweaks and bug fixes thrown in. My main focus has been trying to create tools to make it easier to organize and reuse complex behaviors.
New Stuff:
Behaviors
Behaviors in general have gotten some improvements. Dragging behaviors is smoother now, and they snap to an (invisible) grid when you drop them. This should make it easier to keep your behavior trees tidy. When dragging a single node, all of its outputs are dragged as well - this takes a bit of getting used to, but it’s super handy for moving & organizing big sections. The old behavior (just dragging one node) is accessible by holding the shift key before dragging.
Some behaviors now have error messages that alert you when you try to do things like add a Motor to a static object, or try to play an animation without creating one first - this will hopefully cut down some frustration. Please let me know if you encounter cases that should have an error message, but do not.
There is a new behavior type called “Function” which is just a set of commonly useful Math functions such as sine, cosine, absolute value, etc.
The “Scroll View” node has been renamed to “Camera”, which I hope is less confusing to newcomers. It has also gained two new inputs: “move x” and “move y” which allow you to move the camera position while it is scrolling. This enables you to use autoscrolling in general, but still tweak the camera position for stuff like focusing on a part of the level, or for adding screen shake.
Bundles
Bundles in particular have gotten a major overhaul. They have been terrible for a long time, and this update should make them much more useful for organizing behaviors. The big news for bundles is that they can now have inputs and outputs, so you can essentially create your own entirely custom behavior nodes. When you are inside a bundle (click bundle, then “open”), then there are “New Input” and “New Output” buttons available in the “Bundle” section of the left behavior menu.
Editing nested bundles is now much easier as well, and you can nest behaviors as deeply as you like and still be able to edit them properly.
Bundle Library
Once you have a useful bundle, you can add it to your global library by clicking the bundle and checking the “add to menu” checkbox. This will add the bundle to your behavior menu for all your games. To remove a bundle from your library by clicking and holding the menu button and then selecting “Delete” in the menu that pops up
Select, Copy and Paste
Behavior window zoom has been changed from a slider to zoom in/zoom out buttons. This is more convenient than the slider and makes room for a new button: bundle selection. If you click the select button, then you can drag to select multiple behavior nodes, and have the following options:
- Bundle - this will convert the selected nodes into a new Bundle
- Copy - copy the selection to your clipboard
- Cut - copy the selection to your clipboard and delete it
Once you have copied some behaviors, clicking on the behavior workspace area will show a “Paste” menu option. The behavior copy and paste is converted to text, which means we can share behaviors by copying and pasting them anywhere ( like this forum for example ). The only limitation is that when pasting in behaviors copied from outside the game, you have to use “ctrl+v” to paste - this is a browser security measure.
To wrap it all up, here is an example - a “Screen Shake” behavior node that is just a custom bundle. You can copy it from here and paste it directly into your game:
{"behavior":{"links":[{"input_id":"38305985c54a824ci0","output_id":"382f26e0a2d9f343o0"},{"input_id":"383055fb77d01d4ai0","output_id":"382f26e0a2d9f343o0"},{"input_id":"3830206d54fc8c4ei2","output_id":"38305985c54a824co0"},{"input_id":"382e7c23c93f1c4fi0","output_id":"382e4e82e014b345o0"},{"input_id":"382f26e0a2d9f343i1","output_id":"382e4e82e014b345o0"},{"input_id":"382f26e0a2d9f343i2","output_id":"382ec193613f3d43o0"},{"input_id":"382f26e0a2d9f343i0","output_id":"382e7c23c93f1c4fo0"},{"input_id":"3830206d54fc8c4ei3","output_id":"383055fb77d01d4ao0"}],"nodes":[{"name":"Screen Shake","outputCount":0,"group":"","y":0,"behaviorType":"logic.NodeGroup","x":-270,"inputCount":1,"id":"382dfd747d25194a","isMenuItem":false},{"name":"Switch","outputCount":1,"group":"382dfd747d25194a","y":256,"_startVal":0,"behaviorType":"logic.logic.Switch","x":630,"inputCount":3,"id":"382f26e0a2d9f343"},{"name":"Random","outputCount":1,"group":"382dfd747d25194a","y":192,"min":-4,"behaviorType":"logic.logic.Random","max":4,"x":810,"inputCount":3,"id":"38305985c54a824c"},{"x":990,"maxRight":20,"group":"382dfd747d25194a","scrollY":true,"y":224,"parallax":100,"top":0,"scrollX":true,"repeatBG":false,"minLeft":0,"inputCount":4,"id":"3830206d54fc8c4e","bottom":9,"name":"Camera","outputCount":4,"behaviorType":"logic.components.View"},{"name":"Bundle Input","outputCount":1,"group":"382dfd747d25194a","portId":"382dfd747d25194ai0","y":256,"tag":"shake","behaviorType":"logic.NodeGroupInput","x":450,"inputCount":0,"id":"382e4e82e014b345"},{"name":"Always","outputCount":1,"group":"382dfd747d25194a","y":352,"behaviorType":"logic.triggers.Always","x":450,"inputCount":0,"id":"382ec193613f3d43"},{"name":"Timer","outputCount":1,"group":"382dfd747d25194a","count":1,"y":128,"behaviorType":"logic.triggers.Timer","x":630,"inputCount":3,"delay":20,"id":"382e7c23c93f1c4f"},{"name":"Random","outputCount":1,"group":"382dfd747d25194a","y":288,"min":-4,"behaviorType":"logic.logic.Random","max":4,"x":810,"inputCount":3,"id":"383055fb77d01d4a"}],"v":"2"}}
Website
There is a small update to the website where you can unlist your game from the games page if you are using a paid version. There is a “Don’t display in games list” checkbox in the game settings panel. If you select this box your game will be removed from the games page listing on the site. Keep in mind that t may take a couple minutes for this change to take affect, since the game listings are cached.