Devlog 8!
Today I went insane making a randomly generated tilemap! But it was worth it!
A tilemap, is basically the background, which is composed of a grid of which tiles can be drawn on. I wanted to make a randomly generated grid, that can be changed with a random assortment of seeds, that can scale to my needs. I didn’t want to draw one out, which would take time, and may fail in the long run if I wanted to expand/shrink the map.
So I made a randomly generated one!
After lots of research I found a great tutorial by Jackie Codes about procedural tilemap generation in Godot. Essentially all the tiles will be made grass by default. But by using a 2DNoiseMap, we’re able to get a random assortment of values based off of equations, making blobs or paths depending on the Noise type we use (each type is a different algorithm generating noise). By translating x-y pairs from the map to cells, we’re able to get a list of where we want the path tiles, and put them on top of the grass tiles. Godot automatically gets the tiles that are both grass and path, and puts them between the grass and path.
Pretty neat, and seems easy after learning about it. Only took me probably 2 hours of research and 2 hours of implementation though sooooooo it wasn’t that easy learning it. I had many issues along the way, one of which basically left out the tiles that were both grass and path. Not cool Godot. Took more research, and found out thats why I put grass down first, then the path.
Also made the map limited, so it doesn’t lag the game when first loading in. May have crashed Godot making a giant map… but now the player has bounds too! Enemies can still spawn outside, but ignore the barrier. If they happen to die outside, coins are clamped to inside the barrier, and automatically move.
Anyways I also started work on miscellaneous spawning objects. I’m starting with a chest. All I’ve done, is the code to spawn them in, but no functions yet. I’ll figure it out when I have time.
Coming close to shipping! I just want to implement items, two more enemies, and like two more weapon types! Also a inventory system to see what the character is holding! Then also, the player should have weapons limited to 5 or 6 maybe. A bit of a list, but the rest of this shouldn’t be too bad to implement. Maybe only the inventory…
Welp,
Cya!
Log in to leave a comment