godotengine / godot

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

Exported vars not immediatelly updating for inherited scenes. #5997

Closed kubecz3k closed 6 years ago

kubecz3k commented 8 years ago

Operating system or device - Godot version: Ubuntu 16.04, f86176d20b75598de78f117c06f55ef193115fd6 commit

Issue description (what happened, and what was expected): It's possible to accidentally modify exported values for inherited scenes in some scenarios. If you change exported var in base scene, and at the same time you have opened third party scene which is holding inherited scenes, then exported values for those instanced inherited scenes wont be updated.

Steps to reproduce:

  1. Create BaseScene, attach a script to a scene, declare exported var someValue = 3
  2. Create InheritedScene which is based on BaseScene
  3. Create new 'World' scene.
  4. Add InheritedScene to WorldScene.
  5. Save
  6. Don't close World Scene
  7. Modify Exported vars of BaseScene to 5 and save it ~8. Change anything in WorldScene~
  8. Save WorldScene
  9. Reopen World Scene, exported var of InheritedScene node will be 3

Link to minimal example project (optional but very welcome): Video that demonstrates the issue: https://youtu.be/6juDGlZo2Bw Sample Project to make your own tests: (not sure if this is really needed since you still need to understand reproduction steps and perform some of them): InheritPropertyNotUpdated.zip

I'm not 100% sure if this bug qualify for fix before 2.1 but I assume It might be good thing to be considered (since updating scenes with big number of inherited scenes is painfully). Also I think this bug is not present in 2.0 branch

kubecz3k commented 7 years ago

retested today on e12b422c90f3f866d133ea5ab797fb37f675e019 it's still valid

reduz commented 6 years ago

I remember I recently changed this, if you change the exported value from the code, and the same value is used, it will be modified.

kubecz3k commented 6 years ago

Will recheck at the beginning of the next week

kubecz3k commented 6 years ago

The issue is still valid in ef08228db738ea731a975c986ccf4da873930fbd

reduz commented 6 years ago

This is actually working, the problem is that you have a scene that contains the integer value as 3 (BaseGameObject) and by the time the instanced one is loaded, it will understand this as the actual value.. just for the fact that it's what it was saved. Even if you modify it.

I will close this because I think it's quite a corner case and working it around (checking what is loaded instead of using what is saved) may result in another batch of inconsistencies.

kubecz3k commented 6 years ago

Well don't think it's a corner case, I very often have some main 'level' scene open at the time where I'm working with other smaller scenes. In a result subscenes that are added already to big 'Level' scene are transparently become out of sync. Usually it ends with some bugfix hunting couple days/weeks later.

kubecz3k commented 6 years ago

I off-course can be wrong and it's a minor use-case. Guess we can wait and see if more people will report something similar.