I'm pretty much looking for a 3D version of the tilemap and its system of terrain painting, which allows defining a center tile and edges then simply drawing your terrain without having to worry about placing corners / edges manually. If in 2D you have 4 corner and 4 edge sprites, in 3D you'd have 8 corner and 6 face meshes... ideally allowing the same mesh at different rotations where that is optimal. This isn't only for an editor tool but meant to be updated in realtime to allow terraforming, similar to Minecraft terrain but using mesh tiles essentially.

Although this shouldn't be that difficult to script on my own in need, I was wondering if there's already a builtin way or how others achieved this. I have some familiarity with the 3D gridmap, what I want here is most likely a fork of it, granted it can handle realtime edits without stuff like physics glitching if someone's standing on the ground during an update: It just needs a way to define edges and corners so one can simply paint the type they want at a certain 3D point then automatically have it surrounded by the right tiles at the right rotations around holes and bumps.

Does anyone have any advice, an example script, ideally a demo on how to turn the Gridmap into an editable tilemap painter? I'm not seeing an addon for this particular purpose in assetlib so far.

Something I forgot: For the particular project I'm thinking of I don't believe I want holes in the ground, I'm probably looking to have just a heightmap dressed in tiles. Not sure if I'll want to support multiple height differences in this case, such as both 90* with 45* and maybe 22.5* slopes, if there exist tiles for each I may need a slope variation system. I was thinking of trying this with with Kenney's 3D tiles actually, such as his nature kit for terrain:

https://www.kenney.nl/assets/nature-kit

Megalomaniak I was pondering if using multiple overlapping gridmaps for different sets might be ideal, especially as I may want different grid powers for items of different scales. Only annoyance is you then need to scan each gridmap for intersections and delete cells from others that overlap, shouldn't be that difficult to script. Using one gridmap seems easiest in the end though.

In any case it doesn't spare needing a way to define neighboring tiles and automatically paint them from the center. Surprisingly I haven't found an addon for something basic like this yet. I have found a video where someone explains how they did it, albeit their approach is far more complex and requires a ton of neighbor tiles.

What I likely want and may have to build is an editor tool that lets you set each tile in a mesh library to take a different shape based on its neighbors. I wanna do both terrains and roads, the later will have more complex and unique rules as you have different types of curves and ramps that you always want to connect accordingly. In that I could use advice on how such an addon would be designed, so ideally I also have an editor menu where I can easily configure the different connection types in the GridMap itself.

I have a vague memory of having seen something in the past that might come in handy here but just for the life of me can't recall where or what exactly it was. Been searching for a while now but just can't for the life of me find it again, or even sure what terms to use. In the meanwhile I came across this again, maybe it's of some use. Not really related to this topic though, but it does offer the hint that there's a lot that can be done with gridmaps if one is willing to put the work into it to extend and innovate.

If my mind manages to finally remember what it actually is I'm searching for tho I'll search for it again and post if I find it. Think it was something to do with rule based auto tiling but someone was essentially porting the concept over to 3D somehow... So each tile/grid would be neighbor aware. That is you place a few specific tiles around and it would auto fill the rest according to them knowing exactly which tiles match which ones as neighbors and all that.

Or maybe the issue is I'm thinking of multiple different things that in my memory have blended together into a single thing here...ugh.

    Megalomaniak Thanks, will look at it a bit later. It is partly related, especially as this may answer another issue I had: Say I want the ability to place houses in the gridmap, but I want the windows to cast light at night... the gridmap can't edit the material on an individual home, nor place a light entity in front of the window as it only handles meshes. My workaround was to have each tile in the gridmap associate scenes spawned at relative locations then deleted once the tile is gone, but that would have been an rather ugly hack... instancing scenes instead of meshes on the grid would be much better for this reason. Also because I may allow large areas to be created, and from what I understand the gridmap is turned into one mesh internally so you can't occlusion cull or LOD different tiles... even seen people mention you can't extract individual colliders to do things like surface based footsteps. So placing full scenes on the grid instead seems like a better option, even if there will be multiple less optimized meshes this way. I can easily think of how that would be done but still thinking if it should be done selectively.

    What I'm thinking of ultimately doing is not using a gridmap at all, just a script that spawns and erases scene instances, which can easily do so at fixed grid units stored by dictionary of vectors to avoid unneeded loops. I'll likely specify a rule set in the definition of each tile, under the form "if neighbors <1, 0, 0> and <-1, 0, 0> connect whereas <0, 0, 1> and <0, 0, -1> are empty use shape_straight" tested for all 4 possible rotations (0, 90, 180, 270).

    One thing I should know how to do in this case is rotate the neighbor check with the desired rotation of that tile, which will save a lot of unneeded definitions. Like if I use the rotation <0, 90, 0> then <1, 0, 0> should become <0, -1, 0> in the check. What's the best way to rotate a position vector and swap axes or flip the sign accordingly?