Behavior Package 1.0.4 Released! Changelog inside

Hello everyone! The new version of Behavior is now out (7th of November, 2024, 17:07 GMT).

Thank you so much for the feedback and reports! We’ve tried to fix as many issues as we could. We really appreciate your feedback, support, bug reports and requests, keep them coming! :slight_smile:

You can find the changes below:

Changed

  • Updated AppUI dependency to 2.0.0-pre.11.

  • Label displaying the graph description text removed from the subgraph node inspector.

  • Increased variable link search view width a bit and increase the text’s width in the search options.

  • Changed the output location of IL2CPP link files so as to not pollute the Assets directory.

  • If a NavMeshAgent is available, the Patrol node now uses its speed to feed the animator’s speed parameter.

  • Set BehaviorGraphAgentEditor’s editorForChildClasses to true in its CustomEditor property and added a call to DrawPropertiesExcluding in OnInspectorGUI.

Fixed

  • Fixed node wizard validation step not accepting other character sets than ASCII in variable names.

  • Fixed Event Channel wizard not filling in types for variables with a matching name on the Blackboard when editing the event message.

  • Fixed Event Channel wizard NodeUI preview not applying the correct margin styles on the message label.

  • Removed additional “New” from the variable name when creating a new Event Channel or Enum variable on the Blackboard.

  • Fixed an issue where the Blackboard would be reloaded when opening the asset searcher on a variable asset field.

  • Fixed not assigned EventChannels not generating local instances by BehaviorGraphAgent when the BlackboardVariable was part of a BlackboardReference.

  • Fixed blackboard variables added through the subgraph story representation having extra spaces between words.

  • Deleting a Blackboard Asset will correctly remove references in other graphs and unset variable links that reference its variables.

  • ComponentToComponentBlackboardVariableCaster now checks the source object type for polymorphic type before using GetComponent.

  • Pressing Spacebar in the graph to open the search menu will no longer throw an exception if using InputSystem with no Mouse support.

  • Navigate and Patrol actions will correctly check for null and not throw an exception due to incorrect use of ReferenceEquals.

  • Fixed a runtime type construct serialization issue, where a types with multiple generic components were failing.

  • Fixed FindClosestWithTagAction condition that was preventing the node to be executed when a null target was provided.

  • Fixed PlayAudioAction nullreference when the pooling was attempting to release an AudioSource that has already been destroyed.

  • Adds runtime serialization support to Switch and Patrol node.

  • Fixed runtime serialization support for MathTypesCastBlackboardVariables.

  • BlackboardVariables from added Blackboard Assets that can be cast to a field weren’t shown as link options.

  • Fixed an issue in Conditions causing linked variables blackboard asset prefix to be removed when using the graph.

  • Fixed both Blackboard.SetVariableValue api’s to allow for setting a variable via an object.

  • Cooldown node will correctly initialize its wait time and won’t block graph execution while waiting.

  • Being unable to zoom in the graph after opening another graph with the Open button.

10 Likes

Regarding this:

Cooldown node will correctly initialize its wait time and won’t block graph execution while waiting.

Having the following graph:

The graph above will crash when running the “Cooldown” node during the second iteration of the “Repeat” node. The child nodes are executed successfully once. No exception is thrown either!

Does it actually crash? What do you mean crash here?

Cooldown returns fail if it’s waiting for its cooldown to finish, does it run again after that 1 second?

Or perhaps the issue is with the repeat while not calling it again :thinking:

This Repeat While node is a custom script, isn’t it? Can you please share the script? You can do it in DM if you prefer

You’re right, using “Repeat” without a condition works fine. I can’t find any issue with my custom condition though. Here’s the code:

[Serializable, Unity.Properties.GeneratePropertyBag]
[Condition(name: "Is Living", story: "[VitalsController] health higher than 0", category: "Conditions", id: "7d34e713e66ab96229b47a5a5b835871")]
public partial class IsLivingCondition : Condition {
    [SerializeReference] public BlackboardVariable<PE_VitalsController> VitalsController;

    public override bool IsTrue() {
        return VitalsController.Value.Health > 0;
    }

    public override void OnStart() { }

    public override void OnEnd() { }
}

The “VitalsController” field has a correct value - it works the first time it’s run.

Also, sorry by “crash” I just mean the node shows up as interrupted in debug mode (red x)

Cooldown returns fail if it’s waiting for its cooldown to finish, does it run again after that 1 second?

It does not run again after that 1 second

Ah! Can you update to 1.0.4 and try the same graph again? :grin:

I am on 1.0.4 :smiley:

Yikes sorry. Let’s move this to the other thread! I forgot we were on the 1.0.4 thread.

1 Like

I think I found the cause. Continuing here:

Thank you very much! Everything else I’ve previously reported works fine on 1.0.4 :+1:

Some things I’m really looking forward to:

  • More nodes
  • It would be nice if the other actions related to navigation (Navigate to Location/Target) could get the same Speed implementation which has been added for Patrol nodes
  • Being able to have Lists of custom MonoBehaviours and interfaces
  • Blackboard Variables as Interfaces (as in: referencing a MonoBehaviour which implements a specific interface)
  • I know it sounds silly but I think there should be a warning when you have a conditional branch where one of the True/False branches doesn’t have any child nodes - in this case, a (not very descriptive) exception is being thrown in the console
2 Likes

Yes! @MorganHoarauUnity added it and we talked about adding it to the others too :slight_smile:

Being able to have Lists of custom MonoBehaviours and interfaces

It’s in the works! :grin:

Blackboard Variables as Interfaces (as in: referencing a MonoBehaviour which implements a specific interface)

Can you explain this more please?

I know it sounds silly but I think there should be a warning when you have a conditional branch where one of the True/False branches doesn’t have any child nodes - in this case, a (not very descriptive) exception is being thrown in the console

No, you’re right! I’ll make a quick fix for it tomorrow :slight_smile:

Me too! Can you give examples for nodes you’d like to see?

1 Like
Blackboard Variables as Interfaces (as in: referencing a MonoBehaviour which implements a specific interface)

Can you explain this more please?

Sure, I’ll give you an actual example from my project: I have multiple MonoBehaviours which implement a “IDamageable” interface. Currently, I’m creating a variable inside a blackboard with a type of GameObject:

image

It would be nice if when creating a variable, I could select one of my interfaces instead of “GameObject” so that I restrict the possible values to only MonoBehaviours which implement that interface. I don’t find this high priority though, it’d just be nice to have.

Me too! Can you give examples for nodes you’d like to see?

  • Playables Action Nodes: for example, playing a single animation clip
  • Animator related nodes: for example, setting layer weight
  • Actions related to Raycasts, box casts
  • Actions related to Lights: for example, modifying intensity
  • Finding the nearest GameObject by Layer

Ah yes! We’re looking to allow more types, like structs and classes. Interfaces should be one of them also :slight_smile:

2 Likes

Thank you for these ideas! We’ll look into them :slight_smile:

1 Like

Thanks for all the hard work, great update. I’ll let you know if we run into any issues. I see that AppUI was updated but they’ve not yet fixed the issue with App UI Shaders being forced into the Graphics → Preloaded Shaders settings. Is that on their radar?

Some other feedback:

  • The Cooldown node seems to work really nicely now. It would be great if we could add some min/max randomization to the Duration value. Perhaps a variation of that node like CooldownRange?
  • I can’t remember if I mentioned this elsewhere but rid values inside of graph asset files change just from being open in the editor. This causes a bit of a version control nightmare so I have to close all behavior graph tabs when I am done working on them to stop it happening.
  • I’m noticing quite a lot of allocations from various nodes in the graphs. Whilst this isn’t game-breaking, generally speaking there should be no regular allocations to keep gameplay butter smooth at high framerates. I tried to capture as much as I could in a single screenshot but there is more than this. (Note I used Deep Profile)
2 Likes

I am sorry that I have no time to look at this package in depth as of yet. But since this package was rapidly develop I would like to proactively ask, Is it possible to include and integrate ReactiveX operator into this package as a node?

I might be very misunderstand this unity’s Behavior package. But, as far as I can see, this system was heavily work in reactive manner. And many of scheduling and fabrication of logic flow was already developed from RX system. I think reusing those existing paradigm would be perfect for behavior node flow control

@fendercodes

Addressing the individual points:

  • Cooldown - Yes i think that’s a reasonable request and i’ll add something the backlog.
  • rid - I was looking into this yesterday and will continue doing so. I also find it quite annoying, the assets seem to be constantly dirty.
  • Allocations - We have ongoing tasks for optimisations and this will improve over time for sure.

Thanks,

@davidlovegrove Thanks. I’m not sure if its related to the rid issue, but sometimes I get errors from line 412 of BehaviorGraphAgent when a graph starts. After re-saving the graph asset, then the errors go away. It might be when I push changes on one machine and then pull them on another that something beaks. However, that is a shot in the dark. I’ll try to see if I can detect a pattern in future and let you know.