Seven's Godot Gamedev Woes

Talk about your new projects here!
Post Reply
User avatar
sevenhundredbees
 

Posts: 5
Joined: Wed Apr 24, 2024 9:17 pm

Seven's Godot Gamedev Woes

Post by sevenhundredbees »

Recently I've been fiddling with Godot, an open-source gamedev engine, again. I tried it back when Godot 3 was out and found it so baffling I had to vent to friends. Had to reinvent custom centering code from scratch because GUI elements and 2d sprites are different types of object that can't talk to each other and don't have the same spatial properties.

Anyway, these days I'm on Godot 4 with the rest of society, and... it's good! Lots of problems and inconsistencies were fixed, such as how sprites can now have a Z-axis too, not just GUI elements... All great! I still don't like a lot of the built in signaling code for AnimatedSprite objects, to the point I made my own state machine that swaps textures manually at specific times to emulate complex and responsive animation behavior. But whatever! It's a good engine now.

This thread is going to be half devlog, half complaining. Let's get to the devlog section for today.

I decided to make a game with only one texture source. Behold, the linchpin of my next project!

Image

It doesn't look like much, but with a clever application of the threshold filter, it quite resembles half an industrial wall texture! I created cubes of the stuff after futzing with godot's various decal and 3d sprite options. Turns out I just had to make a Surface Material on my Mesh Instance and give its Albedo a Texture, whatever any of that means.

Image

Once the cubes were working, I began the ambitious part of my project. You see, I want to load my game map from the banana too! How? Well, if you take an image and sharpen it real far, you get all kinds of fascinating artifacts. Here are some now:

Image

Essentially, when the game starts I want to load a map based on an image like this. Every white pixel is an empty space, and every black pixel is a block. This part was surprisingly easy.

Code: Select all

for i in 100:
	for n in 100:
		var c = img.get_pixel(i, n)
		if c.r == 0:
			var tileinstance = tile_black.instantiate()
			tileinstance.position = Vector3(float(i-50), 0.0, float(n-50))
			self.add_child(tileinstance)
Essentially, this is checking every pixel, and if the pixel has zero in its red channel (which would make it black), it creates a block at the equivalent coordinates. Um, but the first time I implemented this, I had been using X and Y position (Right and Up) instead of X and Z position (Right and Forward), so...

Image

It looks pretty cool, though! Join me next time for scope creep, as I try to make really any image viable as a map you can walk around in. My success will be mixed!!
User avatar
motsdrama
 

Posts: 141
Joined: Mon Apr 22, 2024 11:40 pm
Location: Diet Building

Re: Seven's Godot Gamedev Woes

Post by motsdrama »

yo, thats a really crafty use of that banana picture!!! super cool stuff you've got going on here! :D can't wait to see more updates!
Image
xuefang
 

Posts: 73
Joined: Wed Jan 22, 2025 7:14 am

Re: Seven's Godot Gamedev Woes

Post by xuefang »

сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтtuchkasсайтсайт
Post Reply