godotengine / godot

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

GridMap Enhancement: Make use of Bresenham's line algorithm for drawing #11995

Open Scott3730 opened 7 years ago

Scott3730 commented 7 years ago

In pixel art applications, it is common to use a line algorithm draw a line between the last two sampled input points. For example, if I move my mouse too fast for godot to handle on my PC, I get a handful of discrete tile placements. Using Bresenham's line algorithm, these would instead be solid lines of tiles.

This was drawn with a single left-click and quick drag: image

But it really should be something like this instead: image

This is a common feature of raster based drawing applications, and I believe most voxel packages also. (at least MagicaVoxel and Qubicle). It would vastly improve the usability and general "feel" of the GridMap editor

Algorithm for reference: https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm

HooniusDev commented 7 years ago

Could the bresenham line also be exposed to gdscript as well? Would be nice to have it for FOV calcs on roguelike games.

Calinou commented 4 years ago

For the record, this is already done in the TileMap editor thanks to #12334. This still needs to be added to the GridMap editor as of https://github.com/godotengine/godot/commit/d711c57d767734887fbf0955a7b9902c54498a0d.

cryptoquick commented 4 years ago

Just saw an opportunity to help with housekeeping; I noticed that https://github.com/godotengine/godot/commit/d711c57d767734887fbf0955a7b9902c54498a0d that @Calinou mentioned was merged. Just curious if this issue has been resolved through that change.

Calinou commented 4 years ago

@cryptoquick This issue is about GridMap (= 3D tilemaps), not TileMap. It's still not solved last time I checked.

It shouldn't be too difficult to implement, but I didn't manage to do it when I tried last year.

cryptoquick commented 4 years ago

Ah, I get it, makes sense. I'm still new to Godot, just looking into stuff and stumbled across this.

Does Godot have any sort of roadmap or prioritization board?

Calinou commented 4 years ago

Does Godot have any sort of roadmap or prioritization board?

There's the Godot proposals repository and the roadmap repository, but priorities aren't set in stone.