godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.13k stars 86 forks source link

Pasted Node reference rerouting. #5651

Open EMBYRDEV opened 1 year ago

EMBYRDEV commented 1 year ago

Describe the project you are working on

We are working on a first person shooter utilising quake/source engine style logic entities. This allows level designers to script encounters without technical knowledge.

Describe the problem or limitation you are having in your project

We create fairly complex networks and mechanisms out of these logic entities and our level designers need the ability to be able to copy-paste these groups of nodes and have them automatically reference the newly created versions of each other.

This is the default behaviour seen in Unreal Engine and it is one of the key things we are concerned about when migrating to Godot for our next project.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Below is an example of how this feature works in Unreal Engine which has been essential for the development of SPRAWL.

https://user-images.githubusercontent.com/20043270/197676477-3fe16c62-4e1d-44e1-9fcb-daa26a7c5950.mp4

As you can see, when Node A refererences Node B and is copy pasted, the newly created Node C will reference the newly created Node D.

Currently as things stand in Godot, Node C would still be referencing Node B and for complex networks of references this would require a lot of manual labour to update these references.

Screenshot_30

Above is a screenshot of how complex these networks can get, however the most comon usecase is a button that is connected to a door, sfx, particle systems etc that needs to be copy pasted through the level.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I have not had the chance to look into the technical details surrounding this, however I believe that the newly added support for the @export attribute on nodes directly could make life a lot easier in this regard?

If this enhancement will not be used often, can it be worked around with a few lines of script?

I dont believe so, this is pretty core to how the editor handles copy pasting.

Is there a reason why this should be core and not an add-on in the asset library?

As mentioned above this is code editor behaviour and I also believe this should be default editor behaviour as seen in Unreal Engine as is something that has been incredibly useful to me both during the development of SPRAWL and during my day job at a large studio.

JoNax97 commented 1 year ago

I think this feature would make more sense when instancing scenes more than copy pasting. Tbh I don't know if this is the case today, can anyone confirm?

RedMser commented 1 year ago

@JoNax97 The proposed feature already works this way when instancing scenes. Both Node and NodePath exports store relative paths, so any references within a scene will be fine. It's only an issue when copy pasting both a referencing and the referenced nodes in the editor.

However, I do agree with @STUDIOEMBYR that as a level designer, this is an expected functionality and would help a lot when creating a level scripting system using export variables.