0
Fixed

Replacing Select with Branch breaks a Graph

HyenaGames Dev 3 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 9

I had a graph with a Select node that had 2 Float Literals hooked up. I right-clicked it and chose Replace and selected Branch. and Bolt broke with a constant stream of errors.


PlayerController.asset

Attached is my PlayerController asset which I cannot currently open in my Unity project. If this can be fixed, Please email it to hyenagames@gmail.com!  I really need to look into Collab or Git or something so I can revert changes that break things...

Thanks.

(Made this Private since I have an asset attached)

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

Steps to Reproduce:

1) Create a Graph using a Select node, like this:


2) Right-click the Select Node and choose Replace

3) Replace it with a Branch node.

BOOM. Dead Graph when using Bolt 1.3 and Unity 2018.1.0b10

FYI, I was able to fix my PlayerController by editing two Invalid links out in a text editor. I don't need you to attempt to repair that any longer, but definitely hope you can fix the bug that causes the graph to crash :)

Argh, this is going to be a tricky one.

Basically, the connection recovery system creates invalid ports to hold the previous connections. However, these ports end up having the same key as new valid ports (in this case, ifTrue and ifFalse). However, unit port keys are always expected to be unique on a given unit, not on a given input/output set.

I see two ways of fixing this:

1. (Easy, not ideal) Not creating the duplicate ports and breaking the connection in this case.

2. (Hard, ideal) Refactoring the uniqueness to be required per input/output set, not overall.

+1
Fixed in Beta

I went for solution #2 because I want things to be done right. ;) Also refactored the whole unit port description system so that it's a lot more robust and in line with the rest of the descriptors. It appears to be working for now, but it was a significant enough refactor that I'll want another Beta version before pushing to stable.

cool stuff. Thanks for your hard work Lazlo!