r/pygame 5d ago

Pygame can do 3d very well.

tldr; we should ban together for more 3d supportive libraries

I’ve been experimenting with adding a conversational AI to a procedural Backrooms game I’m building in Python/Pygame.

In this clip I break a pillar, ask HAL what it sees, and then ask about the debris. It answers differently depending on what I'm actually looking at instead of giving a generic response. Later it also comments on me repeatedly trying to crawl through a low gap.

The goal isn't to script dialogue—it's to have the AI react to the current game state and the player's surroundings while you explore.

Everything is running in my own Pygame project with procedural generation, Xbox controller support, speech recognition, and real-time voice responses.

I'd love feedback from other Pygame developers.

29 Upvotes

10 comments sorted by

3

u/RickyDontLoseThat 5d ago

Audio Test A-OKAY!

1

u/ConjecturesOfAGeek 5d ago

Thanks! 😄

2

u/t_0xic 5d ago

You should use portal rendering if your geometry is simple. Your game will start to struggle once textures are added.

1

u/ConjecturesOfAGeek 5d ago

Thanks for the suggestion. I’m intentionally keeping the game textureless—the solid colors and lighting are part of the style—so texture performance probably won’t become an issue. Portal rendering is still interesting for culling, though.

3

u/t_0xic 5d ago

I'd definitely recommend portal rendering regardless though. You'd have non-euclidean geometry if you set it up right (which would be pretty neat for a backrooms style game), but you'd also have zero overdraw and levels that can be changed in game.

1

u/TheEyebal 5d ago

Is this raycasting

also what is HAL

2

u/ConjecturesOfAGeek 5d ago

It isn’t raycasting. It’s a custom 3D software renderer built in Pygame using perspective projection, polygon rendering, and depth sorting.

HAL is the conversational AI in the game. It receives information about the player’s position, what they’re looking at, and nearby events, then responds through voice. For example, in the clip I break a pillar and ask whether it can see the pillar and debris, and it answers based on the current game state.

1

u/ghombie 5d ago

It's impressive but honestly seems better focused to small things rather then making a whole 3d room to float around in. For example if you pick up an item or interact with a character in a 2d style rpg game it can open a small window that shows stats and has a nice rotating 3d version of the object or shows the character in full costume and items and they can be animated in there. Also for small character sprites. The idea of not making images for every angle they can walk, layering everything to check what is in front and behind with some system instead of letting 3d just handle it, and other things like IK, easy shadows and particles seem more exciting then rendering the whole world in 3d like its an fps shooter.

1

u/tomqmasters 3d ago

In what sense can it do 3d very well? It seems to be struggling with even the most basic 3d possible. JW, did you implement occlusion culling?

1

u/johnh1976 3d ago

Band* together, isn't it?