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

Created on 10 Oct 2017  路  6Comments  路  Source: godotengine/godot

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

enhancement editor usability

Most helpful comment

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

All 6 comments

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

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.

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.

@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.

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?

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.

Was this page helpful?
0 / 5 - 0 ratings