Automatic 2d Terrain Map Atlas Generation #6971
shadowmaster435
started this conversation in
2D
Replies: 1 comment 1 reply
-
Title should likely be updated to mention "2D terrain" otherwise people are liable to confuse this with 3d terrain |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Due to the already versatile system godot has this system would mesh more or less perfectly with the already existing systems (terrains alternate tiles ect) and could even, anyways by using a 2x6 tile atlas and dividing a full tile into 4 quadrants and arranging them by corner, uv coordinates of each quad can be assigned to whatever connection cases are relevant to whatever corner the quad is on then stich all of the resulting uv's together to form all the required textures, i've included images to attempt to portray how this system could work. i've included code for fetching the uv coordinates for every case a corner can have it uhhh took a while because i decided to do it the slow way.
a quick way to check for each corner case would go something like this
(example base atlas in practice)
heres how you could use the peeking bits system to only generate specific connections this would also generate peeking bit combos for said connections
Anyways with all that out of the way heres this massive chunk of code to get the relevant UV coordinate for a provided corner given an array of directions you want connected
Beta Was this translation helpful? Give feedback.
All reactions