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

Fix tilemap live editing while game is running #83146

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

pancelor
Copy link
Contributor

fixes #77328

thanks to @torcado194 for figuring out how to fix this!

I've been using this for a week or two with no problems in my simple use cases (single-layer single-source tilemaps)

@AThousandShips AThousandShips requested a review from groud October 11, 2023 11:53
@AThousandShips AThousandShips changed the title fix tilemap live editing while game is running Fix tilemap live editing while game is running Oct 11, 2023
@AThousandShips AThousandShips added this to the 4.2 milestone Oct 11, 2023
@akien-mga akien-mga requested a review from KoBeWi October 11, 2023 11:56
@groud
Copy link
Member

groud commented Oct 11, 2023

Hi! Thanks for trying to the solve the issue but this is not the right way to solve the problem.

The commit_action(false) call aims to avoid calling the functions on the locally edited TileMap for performance reasons. The argument cannot be removed like that as it would impact editing performances.

The issue must be solved in UndoRedo. I think solving the issue should be done by still calling the callbacks when p_execute is false. This means:

  • Updating UndoRedo::commit_action to always call _process_operation_list but with an added p_execute argument.
  • Adding a p_execute argument to _process_operation_list
  • Only execute code when p_execute is true (the callable.callp(nullptr, 0, ret, ce) part), but still notify the debugger via the callback (check how method_callback is used)

@pancelor pancelor force-pushed the fix-tilemap-liveupdate branch from 77b9cfb to d80a317 Compare October 11, 2023 14:06
@pancelor pancelor requested a review from a team as a code owner October 11, 2023 14:06
@pancelor
Copy link
Contributor Author

Ahh that makes more sense; thank you for the detailed steps! lmk how it looks

@pancelor pancelor force-pushed the fix-tilemap-liveupdate branch from d80a317 to d66b175 Compare October 15, 2023 02:00
@akien-mga akien-mga merged commit 4a6e8dc into godotengine:master Oct 16, 2023
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@pancelor pancelor deleted the fix-tilemap-liveupdate branch October 16, 2023 21:40
@caimantilla
Copy link

Did this break again?
I've been struggling figuring out how to make my own Node type work with live editing, which led me here.
So, I added a TileMap, and the tiles I paint only show up in-game once I restart...

@KoBeWi
Copy link
Member

KoBeWi commented Jun 17, 2024

Can't reproduce the problem, the TileMap updates normally for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tilemaps no longer reflect changes via live updates
6 participants