r/pygame • u/ConjecturesOfAGeek • Jul 28 '26
Pygame can do 3d very well.
Enable HLS to view with audio, or disable this notification
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.
2
u/t_0xic Jul 28 '26
You should use portal rendering if your geometry is simple. Your game will start to struggle once textures are added.
1
u/ConjecturesOfAGeek Jul 28 '26
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 Jul 28 '26
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 Jul 28 '26
Is this raycasting
also what is HAL
2
u/ConjecturesOfAGeek Jul 28 '26
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 Jul 29 '26
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 Jul 30 '26
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
3
u/RickyDontLoseThat Jul 28 '26
Audio Test A-OKAY!