-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
TileSet/TileMap rework #45278
TileSet/TileMap rework #45278
Conversation
I have crash when trying to open empty project with Address Sanitizer(this errors probably means that uninitialised variable was used)
|
@@ -395,6 +395,50 @@ class Geometry2D { | |||
H.resize(k); | |||
return H; | |||
} | |||
|
|||
static Vector<Point2i> bresenham_line(const Point2i &p_start, const Point2i &p_end) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should #43916 be closed or merged then?
I cannot reproduce. Could you give me the exact scons args you use and the steps to reproduce the bug? |
This contains leak, address and undefined sanitizers:
|
I found that this is caused by non initializing tilemap - this patch fixes issue
|
Ah ok. I though pointers were supposed to be initialized automatically to nullptr. That's weird. |
When opening and closing editor with this project - Temp Projekty.zip I have this read after free:
|
This patch fixes invalid read(I don't know if it is proper, but works)
|
Also |
Thanks again! I'll apply those patch. |
@qarmin I updated the PR, could you try again and see if most of your problems are solved? |
I am not against it, the main problem for me right now is that only right click works for me to move the view (I don't know why but middle mouse button to pan is not working well on my side).
Yeah, this is a bug I have to fix. If nothing is selected on the left the atlas should not be displayed. I'll fix this.
Ah yeah, I should add the zoom buttons. :)
Make sense, though I might deal with that kind of things later on. There might be a lot of different features people might like with modifier keys (maybe the rect tool is used more often than the line tool for example). I think it's better to wait for now to see what might be the best solution.
Hmm... Maybe this should be made configurable, as this might depend on the game you are working on. But that's a good point. We might draw the grid around the preview, but it cannot be extended to there. There is a limit on how many lines we can draw. |
But doesn't the grid extend anyways when you click and draw the tile at that position? My biggest worry would be that rapid mouse movements would cause lots of redrawing, but almost the same happens when you draw lots of tiles. |
No, there a limit on how many tiles shapes are drawn anyway, otherwise there would be significant slowdowns. The solution tries to always draw as much tiles as possible in the screen, and prioritizes the tiles in the center. Btw I forgot this question:
That's weird. The base tile size is to be modified in the inspector though (when editing the TileSet resource), did you modify this value? Because the tile size value in the atlas is only for rendering purposes (size of the texture region), this is needed for isometric tiles for examples, where usually tiles in the texture will have a different size from the one in the grid. |
Ah right, I didn't expect this. But maybe I just had wrong assumptions about the new system 🙃 This led me to discover another bug: when you change tile size in the inspector, the currently drawn tiles aren't updated until you reload the scene.
But middle mouse works for me, so it's either system-specific bug or just something on your side. IMO it would be fine if tilemap editor prevented right-click panning. (although removing it entirely isn't a bad idea, because right now we have 3 ways of panning) |
Ah. I fixed a similar bug long ago. It seems it appeared again. I'll fix it.
Ah I had never checked in other programs, but it seems that I have bad behaviors in Firefox too. I'll investigate that on my side then.
Yeah, I think that for consistency it would be better. An it would allow use to use right click for more context-aware things I guess. The current situation is kind of wasting a button. |
Alright, I pushed some bugfixes and it now draws the grid around the preview. |
Regarding that last visual bug with content drawn outside of the scroll container: it's likely this issue #36164. |
Closing as superseded by #48535 |
This is a first step in the TileSet/TileMap rework. It includes:
Disclaimer: the API is not ready yet and a lot of feature are missing.
Some screenshots for pleasure:
Download the builds (produced by CI):
Linux with mono: https://github.com/godotengine/godot/suites/1851943757/artifacts/35926599
Windows: https://github.com/godotengine/godot/suites/1851943754/artifacts/35925761
MacOs: https://github.com/godotengine/godot/suites/1851943758/artifacts/35926056
WARNING: opening an existing project with this build will break your TileMaps/TileSets resources for any other version of Godot. Make a backup of your project if you wish to try it on existing projects.
This is the place to provide feedback on this build. Please report here any crash/errors.
I don't want to give any documentation for now on how to use the editors yet, to see if it is intuitive enough. ;)