Background: My simplified method of version control (and feature extension) has been to duplicate the folder containing my self contained prototype “main” scene, scripts, and assets, supporting scenes.
I then rename this duplicated folder and modify the internal contents, scenes, scripts etc.
Example of what i am trying to describe:
Folder A: Character controller with player based movement
Folder B: copy folder A and rename to create character controller with camera based movement
Folder C: copy folder B and rename to create character controller isometric stationary camera
Folder D: copy that folder and rename to create character controller isometric with fluid camera follower…
Basically i am iterating through controller ideas to find which one i like the best without modifying the code once i am happy with the results. Therefore i can choose Folder C as my selected controller and continue development.
Problem: When i attempt to test the newly created “main” scene the changes i made in the scripts do not express themselves.
Efforts:
1.) I unattach all scripts and re attach the scripts (ensuring they come from the new itteration folder). This works about 50% of the time.
2.) If i open all scenes and scripts in the new directory and then close them then run the new “main” scene the scene works correctly.
3.) if i close and reopen Godot and attempt to rerun the modified “main” scene the changes do not exist.
4.) opening the same files on a different machine (res:// is on drobox and shared across multiple computers) results in similar behavior. Fixing all issues on one computer does not translate to any other computer (these computers do not run simultaneously, one is run only in the daytime, another only at nighttime with no overlap, and dropbox is fully synced prior to starting any work.)
Assistance Requested: I need help understanding what the editor is doing here.
1.) Are there dependencies that do not update when a folder is duplicated and the internals are modified?
2.) Is there a cache in Godot editor that needs to be purged by opening each scene and script before running?
3.) This one is a bit of a strech, so bear with the idea. Editor based signal connects are hidden in the scene text files, are script pathways hardcodded to a location at initial attachment and then not updated with a file name or folder name change?
4.) If i rename a folder in my OS with godot closed will this result in bugs and errors that do not appear at first but might manifest later?
Appreciations: Obviously my method of iteration, feature additions is not ideal, is there a better way? I want to make sure my methods don’t cause future headache. Thanks in advance.
TLDR: packed scene paths are not updating after changing nodes and saving. If i can get some help understanding why the .tscn is not saving the changes that are made i would appreciate it. This issue is based on my failure to properly understand why the strange behavior is happening, especially if it is my fault and not in any way related to the editors’ operations.
I have reloaded the “main” scene multiple times, each time i have to delete all nodes and re add all sub scene nodes.
This will fix the game play. I save all scenes starting from the most inner nested out. This works.
If i exit godot and reopen, the original bug comes back.
I believe the error is located in the .tscn files. This is the .tscn file after i modify the scene, test the scene (the scene now works) and save the scene.
path should be: res://prototyping/prototype_fauxsotropic_controller/ [insert item here] not the original res://prototyping/prototype_player_controller/
From the above we see that the packed scene paths do not update to that of the new nodes. Why is this happening? why is the save button on the scene not saving the scene?
Digging further, I think this has something to do with the Resource UIDs (Unique IDentifiers). I’m reviewing the documentation but so far there have been no eureka moments.
So what I have learned is that the text files of .tscn files do not change when you manually duplicate a file. As such the paths of the files within the packed scenes do not change. (impetuous for change has not yet been discovered by myself. I.E. what causes the editor to write new data to a file)
Changes to a scene’s sub scene’s nodes (wish there was a better way of explaining this, it sounds awful confusing) does not change the scene even though an asterisk appears next to the file name and you save the scene.
I recommend that you DO NOT, manually duplicate files as a method of feature extension or of manual version control. Re do all the work manually (which might seem extensive but is well worth it.) Based on this I recommend that you do not manually duplicate anything in the file structure of your project as I have yet to bound the extent of this issue.
I wish I knew this well in advance as now I have 10 or so categories of scenes and sub scenes which will require full rebuilding, with possible overwrites of script files which were not properly linked to the manually duplicated folder and have since been overwritten / destroyed and are not recoverable.
Clearly I do not yet have a proper understanding of the Resource ID’s or the process by which the Editor links files, finds files (scenes), or knows when or how to update the actual .tcsn file. However, I have learned enough that hopefully someone who finds this thread does not make the same mistakes I have found.
REQUEST: Please, someone update the documentation, or the new user section of the documentation such that all new users Avoid this method of file duplication. This was about 2 weeks of wasted effort, don’t make this same mistake.
I am also standing by for any possible recommendations for solo user (working primarily offline) methods for version control. My only get experience was in graduate school and that was command line only, and does not feel appropriate (automated and Editor friendly) for this situation. I also admit my research into this area is woefully incomplete. Thank you in advance for any recommendations.
FIXED:
I had to dig pretty deep to figure out the behavior. so TLDR.
How to safety copy scenes, files, folders in Godot must be done in the editor. You must also right click and select duplicate. This will create a new resource ID for the files when they are duplicated. Dependencies remain consistent so if you want to change scripts make sure those were duplicated appropriately or else you will have to pull from your version control.
Total time to fix my 6 different character controls, GUIs, etc. took less than 1 hour once I knew what i was doing. Lost considerable time on this issue so hopefully this helps someone out there.