How to make a simple 3D* game in Python from scratch - Ray casting

preview_player
Показать описание

In this video I will show you how to make a very simple 3D* game from scratch in python, using the ray casting technique. This technique was widely used in the early days of 3D PC games, it consists of launching rays from the player and recording when those rays hit an object.

*Technically it's a 2.5D game =P

00:00 Intro
00:35 Libraries
00:41 Initial parameters
01:11 Vision loop
02:18 Plot adjustments
02:54 Player's movement
03:34 Graphical enhancements
05:18 Basic random map generator
05:55 Enhanced map generator

Рекомендации по теме
Комментарии
Автор

Hello guys! hope you enjoyed this video! All the code, with a detailed guide, is available on github, link in the video description.

FinFET
Автор

I thought that someone with this kind of quality and effort put in a video that is 6 mins, that is straight to the point would have ATLEAST 500k subs. This is a criminally underrated channel. (Subbed btw :D)

vinutf
Автор

Thank you. That was very helpful. I've come at Python for game development for a long time, but never felt like I could pull it off. Struggled with some of the basics. This helped me see how simple it could be, even for a novice. I appreciate you making these kinds of videos. I'll see if I can replicate something similar to this in the future, maybe use it as a basis for practice a project or something. I appreciate the files listed as references, too.

ComradeCorwin
Автор

I loved this tutorial! I managed to make the room with one block in the middle and the player movement works! The room is all blue which I like, and the exit also works.

bornbloxbro
Автор

I really liked this tutorial! I managed to get something like this working, except I drew the lines in pygame instead of matplot!

kspnasa
Автор

I can't even tell how good this explanation is. Thank you, sir!

Tyrannia
Автор

awesome video what i’ve been looking for!!

mamo
Автор

Great tutorial video and it is very inspiring! I like how you combin e interesting ideas within hundred lines of code. And the explanation and logic flow is very clear too!

MauriceL
Автор

GG mec, franchement j'ai appris grâce à toi le ray tracing, et le mettre en application avec pygame

manah
Автор

thanks for the github it really helped when I was struggling

judaheastling
Автор

you are amazing! now I have my own raycasting game!

judaheastling
Автор

really easy to undestand and implement thanks 👍

sippingtexastea
Автор

on VSCode
the line " plt.vlines(i, -h, h, 1w = 8) "
gives an error and I cant seem to wrap my head around it
2:51

milkman
Автор

First button press after launch is not recognised and then every press is delayed by 1 (if I press "left right up down", I'll get "- left right up"). Cool tutorial btw

rusland
Автор

It is really high graphics for python!

btplayzx
Автор

thanks!! i mean, i did some debugging because it didn't work.. but after debugging it was great!!

jaydenjonathanowen
Автор

not sure if you're still reading comments but
everytime i try to execute the visual loop test, the line "if mapa[int(x)][int(y)] != 0" keeps giving the "list index out of range" error.

i tried your GitHub code as well and get the same issue. I use Pycharm so im not sure if you could help

enderredacted
Автор

When there is a 1 in the mapa at index [1][1], then the program gives an unexpected output . I realized it does so because the While loop which calculate the vline height, it's x and y never are able to cross their value upto the next whole number after 1, as cos and sin are never added into them again as the if condition gets true on the first run and the loop breaks, resulting the code running for the same x and y values again and again . Just try putting 1 at the [1][1] index in this code, you'
ll get what I mean

mirAAk
Автор

Yeah, but how do I fix the issue with the graphics being distorted/curved?

Ali
Автор

hey bro it is always not responding can you help

bhavyamverma
join shbcf.ru