godotengine / godot

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

Entire scene tree deleted #29865

Closed sporefreak closed 3 years ago

sporefreak commented 5 years ago

Godot version: v3.1 Stable

OS/device including version: Win10 Pro Version 1809 OS build 17763.557

Issue description: Working on a very simple scene made to recreate the Astroids ship, I hit F5 to test the project and was able to successfully fly around and things were working as intended. I closed the window to change things in the Ship scene and everything was gone except the base Area2D I had created, it had nothing connected to it and all the Child nodes I created were nowhere to be found, Child nodes included: KinematicBody2D and CollisionShape2D. KinematicBody2D had 2 AnimatedSprite nodes.

Steps to reproduce: UNKNOWN

Zireael07 commented 5 years ago

Without a sample project, it's unlikely we'll be able to recreate the problem.

slapin commented 5 years ago

use version control systems, that will make it easier to reproduce bugs and keep data safe

KoBeWi commented 5 years ago

Did you do any operations like changing scene root or changing type of a node? There's a bug that clears your scene sometimes when you do these actions (something I'll create an issue for, later).

Also, project auto-saves by default when running, so if you ever have your scene cleared this way, just reload that scene (Scene -> Revert Scene) and everything should be back.

sporefreak commented 5 years ago

no, Nothing was changing type, its fairly simple movment keys processed under _Physics_process (To turn and move forward/backward) The whole scene was still gone upon reloading the scene, that was my first thought, but everything was still gone. the Script was just fine so i only had to replace the scene parts. Is there any way removing the scene from another scene would delete it? I did do that a while before but AFAIK that should only remove it from that second scene and not delete the first.

KoBeWi commented 5 years ago

That kind of destructive change can only happen with a tool script. Anything that happens in-game doesn't normally affect the scene files (unless you save them somehow from game).

johnnygossdev commented 5 years ago

I've come across similar behavior.

I was altering a scene and made a child the root node of the scene. Everything ran fine so I moved to other scenes and when I tried running the game again, the scene I first altered had reverted back to its original state.

It's happened 2 or 3 times for me.

Zireael07 commented 5 years ago

There were issues related to changing root nodes @jaggygames - see any open ones looking like yours?

OP, did you change root node by accident?

hodgej commented 5 years ago

I'm having the same problem, it's very frustrating as I've spent hours working on this scene. Has it been reported as an issue?

johnnygossdev commented 5 years ago

There were issues related to changing root nodes @jaggygames - see any open ones looking like yours?

OP, did you change root node by accident?

I've had a look and this issue most closely resembles what I've come across. At least for me though, the scene seemed to go back to a previous state rather than having nodes deleted but the changes I made to the script associated with it stayed. I'll try and illustrate here:

//Initial Scene
    NodeA (script)
        NodeB
//Altered Scene, make NodeB root, alter script so it extends from NodeB instead
    NodeB (altered_script)
        NodeA 
        NodeC
        NodeD

//Run: OK. Work on other scenes. Attempt to run again. Error in altered_script because it's in the wrong place

//Reverted Scene
    NodeA
        NodeB (altered_script)
sporefreak commented 5 years ago

Sorry to get back a week later, dont use Git often. I did not reparent anything in the scene, infact I didnt even change any of the nodes at all. I was simply writing in a script (Thats all I had been doing that day) and testing some various movment mechanics I was making.

Calinou commented 4 years ago

@DGSitze Can you (or anyone else) still reproduce this bug in Godot 3.2.2 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.

KoBeWi commented 3 years ago

Closing due to lack of update. Please comment if you can still reproduce this issue in the latest stable version of Godot.