godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.48k stars 21.08k forks source link

Visualscript Ghosts #37278

Closed mrjustaguy closed 1 year ago

mrjustaguy commented 4 years ago

Godot version: 3.2.1 Stable OS/device including version: Windows 10 64 bit Issue description: I've noticed some wierd issues with VS on some of my larger projects where when i connect something, another thing disconnects, or in some cases i get ghost nodes Godot VS Ghost as seen, i have no physics process, however the node is in there, before however i did have one, but it stopped working for some reason (Said there was no start node) so i killed it, however this ghost still exists Steps to reproduce: Unsure atm, seems like it's more likley to happen the more nodes&node interactions you make. Symptoms: Random things moving/connecting/disconnecting/becoming useless ghosts (nodes that worked just fine and all of a sudden can't be used for anything) Possible cause: Faulty saving/loading of VS Minimal reproduction project: Sample.zip This is a sample where i have a ghost Physics process function, trying to add Physics process will make another for a total of 2 Physics Process functions

swarnimarun commented 4 years ago

So it happened after a restart/reload of the script?

mrjustaguy commented 4 years ago

No, just happened during connecting & creating nodes which became apparent when running... There were a few times when I've gotten the same Ghosting like in the sample above but noticed it without reloading/restarting scripts (very easy to spot when you decide to kill a function because you don't need it anymore and it sticks) however i'm unsure if reloading/restarting the script would help in causing it. It isn't Very common but every once in a while i notice something like that happen, but I'm still unable to pin it to any single action or set of actions to get reproduce those bugs..

swarnimarun commented 4 years ago

Alright will look into it. 👍 For now seems like I can reproduce it let me test it out a bit more.... maybe it's some sort of ordering problem with the undo redo stack of some job....

If you do encounter it again, then please throw a screenshot(or logs from it) of the output log tab.

ghost commented 4 years ago

I confirm this bug , and more , when trying to replace the ghost node there is a chance of a crash. Also when the ghost node exists , changing the values of a custom node won't work , and also won't get deleted , and can't be disconnected or connected.

ghost commented 4 years ago

Update, This bug happen when getting this error modules/visual_script/visual_script_editor.cpp:2858 - Trying to connect between different sequence node trees

mrjustaguy commented 4 years ago

Ok i found a great example of a broken script where the nodes randomly disconnect as i try to connect other nodes VS Bug.zip Try dragging the math add output to the 1st x for example, breaks half the links in the deconstruct vector 3..

mrjustaguy commented 4 years ago

Ok I just found a big one, This Gridmap code.. Kill Physics process or Killing, half the code goes missing, half doesn't.. But that's not all, see that construct string from vector 3? try connecting it to the array above.. it'll disconnect it from the String Lstrip it is attached to.. and the other way around.. when connected to the array output above it it'll disconnect from it when you try to get the string output of that node to string lstrip..

Bug.zip

Is it possible that the Graph "unification" is causing this issue? https://godotengine.org/article/gsoc-2019-progress-report-3#visual-scripting

swarnimarun commented 4 years ago

Is it possible that the Graph "unification" is causing this issue? https://godotengine.org/article/gsoc-2019-progress-report-3#visual-scripting

Thanks for the awesome work at debugging guys. And yes that has this bug, and I know pretty well now where I managed to introduce it. I think.

I will try to check out all the edge cases and fix them asap.

EDIT: Unless ofc it is one of those expected, unexpected cases. Will figure it out once I try out all the bug zips.

swarnimarun commented 4 years ago

Alright @mrjustaguy your bugs are technically problems with the fact that nodes can't exist and work in two functions(different sequence trees) simultaneously. And deleting functions deletes all the related dependent nodes. So yeah sadly that's not a bug but ~feature~ quirk of the current system.

I plan to rewrite parts of VisualScript to allow for nodes to be usable in multiple functions(sequence node trees) and way across the graph but it wasn't possible at the time due to the restriction of not breaking old visual script system. So it's now fixable for 4.0.


As for the ghosts that's a separate issue, although related but it seems like a bug and there seems to be a few ways it might be possible to cause it. It's basically an issue with how nodes are deleted or the connections disconnected on connecting amongst different functions/sequence trees.

I believe it should have more cases to handle all kinds of interconnection issues properly. And better messages from the error logs would save everyone a lot time too for now, until I do rewrite stuff.

Will look into fixing it.

mrjustaguy commented 4 years ago

Also just noticed a way to crash Godot with VS related to the Graph Unification.. if you accidentally move a node from one function to another & have any data nodes attached from it's former function it'll crash Godot.

Should I make another issue or is there some other issue related to GU issues that fits it better?

Edit: also Glad I can help in finding bugs & helping with debugging them

swarnimarun commented 4 years ago

Also just noticed a way to crash Godot with VS related to the Graph Unification.. if you accidentally move a node from one function to another & have any data nodes attached from it's former function it'll crash Godot.

Should I make another issue or is there some other issue related to GU issues that fits it better?

Sure there isn't any. I guess it's more critical as crashes shouldn't be happening.

Edit: also Glad I can help in finding bugs & helping with debugging them

Can very much appreciate all the help. The PR was already under-tested due to time and personnel constraints. :)

mrjustaguy commented 4 years ago

There made an issue https://github.com/godotengine/godot/issues/37991

Calinou commented 1 year ago

@mrjustaguy Can you (or anyone else) still reproduce this bug in Godot 3.5.1 or any later release?

If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.

mrjustaguy commented 1 year ago

I haven't been using VS in a long time, and haven't been able to reproduce now, however this is if I remember correctly one of those hard to reproduce issues that randomly crop up with no clear steps.. Though given the fact that it's a hard to reproduce issue that has possibly been resolved and isn't relevant to 4.0 due to no VS in there, this could be closed, and reopened in case someone does reproduce it in the future.

Calinou commented 1 year ago

Closing per the above comment. Please comment if you can still reproduce this issue.