Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Characters don't get deleted when changing rooms #345

Open
balloonpopper opened this issue Nov 15, 2024 · 4 comments
Open

Characters don't get deleted when changing rooms #345

balloonpopper opened this issue Nov 15, 2024 · 4 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@balloonpopper
Copy link
Contributor

balloonpopper commented Nov 15, 2024

Bug description

Characters don't get deleted when changing rooms and appear in the next room when they haven't been included in that room.
It is related to the room not having the "Script name" property set.

Steps to reproduce

Have 2 rooms where RoomA connects to RoomB. RoomA should have some characters added to it. RoomB should not have the characters added to it.
Do not set the "script_name" for the parent node of either room.
Play the game and go from RoomA to RoomB, the characters from RoomA will be instantiated in RoomB.

Expected vs observed behavior

Characters shouldn't appear in a room they haven't been included in.

Environment information (please complete):

  • Windows 10
  • 4.4 dev 3
  • Latest popochiu dev commit

Additional context

After some investigation, what appears to happen is that this code runs in the goto_room function (i_room.gd): (line 166)

	if store_state:
		rooms_states[current.script_name] = current.state
		current.state.save_children_states()

If the parent node of the room does not have a script name set, then it gets the value of the destination room. This means that if you're going from RoomA -> RoomB, this store state code stores RoomA's state in the dictionary 'room_states["RoomB"]'. Afterwards, when RoomB is instantated, the code in the "room_readied" function runs and the code on line ~239-255 recreates RoomA's characters in RoomB.

	for chr_script_name: String in rooms_states[room.script_name]["characters"]:
		<...>
		current.add_character(chr)
@balloonpopper balloonpopper added the bug Something isn't working label Nov 15, 2024
@stickgrinder stickgrinder added the wontfix This will not be worked on label Dec 22, 2024
@stickgrinder
Copy link
Collaborator

@balloonpopper sorry for the lag.

I'm going to close this without fixing because we can't accept bugs on a non-supported version of Godot.
In the past we notices that working with dev engine versions shown bugs that eventually disappeared at a later stage of Godot development.

Thanks for taking the time to report, and work this around but we'll face the problem when we'll port the engine to 4.4 stable.

@balloonpopper
Copy link
Contributor Author

@stickgrinder - I disagree with the closing of this ticket. Why didn't you just ask if I could confirm it in 4.3 instead of closing it?

This should be reopened. I have just tested this in 4.3 and this is still a valid bug. When travelling between 2 rooms without script names associated with them, characters from the first room appear in the second room when they shouldn't.

In fact, it's more than just characters. all these errors appear when I go from the first room to the second room. They are all things in the first room that should get deleted when entering the second room.
image

@stickgrinder stickgrinder reopened this Dec 23, 2024
@stickgrinder
Copy link
Collaborator

stickgrinder commented Dec 23, 2024

@balloonpopper we gave for granted that the problem was with that version of Godot because you mentioned it, and it's not clear how a room can be created without a script name in the current supported version.

Can you please make clear how this step to reproduce the bug came to be in your context?

...
Do not set the "script_name" for the parent node of either room.
...

If that came out of the normal usage of Popochiu, then that's of course a bug.
Keeping @mapedorr in the loop, because it was him reviewing the original PR.

@balloonpopper
Copy link
Contributor Author

balloonpopper commented Dec 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants