How to Make a First Person Shooter like Wolfenstein 3D

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024
  • Creating a Wolfenstein 3D clone using Python and OpenGL. Python 3D Game Tutorial.
    The main stages of creating a 3D Game in the style of a retro First Person Shooter in Python.
    Used: Pygame, ModernGL, PyTMX, PyGLM, Numpy
    Source Code:
    github.com/Sta...
    #coderspace #wolfenstein #python #opengl

Комментарии • 136

  • @keithprice1950
    @keithprice1950 11 месяцев назад +3

    These AI voices are so unnatural.

    • @dieSpinnt
      @dieSpinnt 10 месяцев назад

      They kind of make you feel uncomfortable, don't they?
      But if you think about it, would you also express such childish criticism towards a mute, disabled or otherwise disadvantaged person (this includes the lack of training in a foreign language)?

  • @shivangrathore
    @shivangrathore 11 месяцев назад +2

    Those who saying "I can't be good as him"
    I guess he has years of experience or Maybe this game took him days/months (because see the time gap between this and his last video) so that means he did alot of research

    • @CoderSpaceChannel
      @CoderSpaceChannel  11 месяцев назад +3

      I presented this game in Community Posts 3 months ago. It took about a week to create.

    • @svenhulsebus6200
      @svenhulsebus6200 11 месяцев назад

      @@CoderSpaceChannelwould you mind sharing which community?

    • @CoderSpaceChannel
      @CoderSpaceChannel  11 месяцев назад +1

      take a look at the Community tab on this channel

  • @SebaBress
    @SebaBress 9 месяцев назад

    So very interesting... I wish I could understand at least a quarter of what you're doing.

  • @blockedchannel7032
    @blockedchannel7032 11 месяцев назад

    А туторы по Vulkan будут?

  • @expl0siveR3x
    @expl0siveR3x 11 месяцев назад +85

    I dont get how programmers can get as smart as this guy as one myself ill never be this good i doubt

    • @Vextrove
      @Vextrove 11 месяцев назад +23

      I believe you can do it if you had the same years of experience

    • @expl0siveR3x
      @expl0siveR3x 11 месяцев назад +10

      @@Vextrove thank you bro thats inspiring

    • @PeranMe
      @PeranMe 11 месяцев назад +15

      Whether you get this good or not is almost 100% up to you. You may have a lot to learn, but all the resources are out there! Don’t let anyone tell you you’re not smart enough. You just have to put in the hours.

    • @costelinha1867
      @costelinha1867 11 месяцев назад +1

      @@PeranMe Yeah, I'm not gonna get this good with pygame + open gl, because honestly.... I'd rather develop games in a more straightfoward way. (either a 2d game with pygame, or in the case of a 3d game like this one, just using a game engine.)

    • @rexvectum
      @rexvectum 11 месяцев назад

      Yeah you will just keep doing it big dawg 💪💪💪

  • @kimeg7294
    @kimeg7294 11 месяцев назад +12

    Time to start coding again

    • @DanniManni
      @DanniManni 9 месяцев назад

      How’s it going?

  • @TanjoGalbi
    @TanjoGalbi 11 месяцев назад +10

    You made a common mistake made by many indie developers. The aspect ratio for the interface. You have hardcoded it to be for 16:9 screens. Often this is done for convenience while in the initial steps of making the game but is left there as it becomes harder to change the more you build code around it. Always start from the point of view that you do not know the aspect ratio and code from that from the start of the project. That way, when you introduce the ability of the user to select the screen resolution they want to play in it will not affect your HUD or menus in any way even if the aspect ratio is 21:9 (becoming more common with gamers using curved screens) or even wider!

    • @intron9
      @intron9 11 месяцев назад

      I won't call that a mistake, just a recommendation for bigger games. We can't think about every future use case. It's okay to hardcode some stuff for a few elements, we have only so much time.

    • @TanjoGalbi
      @TanjoGalbi 11 месяцев назад +1

      @@intron9 Well, it is a mistake but not because it's not thinking about future case as you put it. Current case is that there are a multitude of aspect ratios in common use, 4:3, 16:9, 16:10, 21:9 to name the 4 most common (though it's rare now to find anyone still using 4:3). Programming a game to respond to aspect ratios correctly from the start of the project not only ensures support for those mentioned ratios but also any unforeseen future ones.
      For example, the game "theHunter: Call of The Wild" had it's map hard coded for 16:9 for ages before they were able to figure out how to fix it for other aspect ratios. The problem there was the placing of waypoints because it could not figure out where the mouse pointer was actually pointing to on the map! Seems a simple fix but it took them a long time because hard coding makes the rest of the code dependant on it too and so harder to change later down the line.
      But, even though it's more common in indie games it's not limited to them! Red Dead Redemption 2 had a weird bug on my 16:9 2K system (before I upgraded to 21:9) where it seemed to be rendering the world at 18:9 then squashing it width ways to 16:9 while overlays like the mini-map were correct at 16:9. When I reported it to their tech support I was told it was my HDMI cable even though I told them I was using Display Port! Very poor response! Especially when a cable can not change the aspect ratio of the game world while keeping 2D overlays unaffected! In fact, I've never heard of a cable changing the aspect ration of a display signal at all!! Funny how it got fixed mysteriously in the next major update! LOL

    • @dieSpinnt
      @dieSpinnt 10 месяцев назад

      @@TanjoGalbi So ... when are you ready to show your game with all of those specifications implemented?
      I can't wait to see it. Thank you!:)

    • @mutbrechtasengard5210
      @mutbrechtasengard5210 27 дней назад

      @dieSpinnt TanjoGalbi raised a valid point and offered constructive criticism for all viewers to consider. He also responded respectfully to a reply. Regarding the topic at hand, whether or not @TanjoGalbi has a reference code is irrelevant. He was simply sharing his perspective and presenting arguments he felt were important. Unfortunately, your response reflects an inability to engage with the objective points of the discussion. You should reflect on that, though I suspect you may unfortunately lack the self-awareness to do so.

  • @erc0re526
    @erc0re526 11 месяцев назад +10

    To see Python reach such speed is astonishing. How is it possible? Is it the hardware, the C libs (numpy, opengl,...)? Magic! Love your stuff dude

  • @Garulf
    @Garulf 11 месяцев назад +30

    In the original Wolfenstein 3D the doors opened horizontally. They only open vertically in the secret doom level due to how doors worked in Doom 2

    • @lifesplayer4987
      @lifesplayer4987 11 месяцев назад +4

      Yeah in Doom floors and ceilings could change in height.... walls/doors couldn't move horizontally. Also in Doom 2 the Wolf3D door handles were on the side... in your game the handles are near the floor....

    • @revolverocelot6587
      @revolverocelot6587 11 месяцев назад +1

      There's an unused linedef (124?) that was intended for horizontal doors in Doom 2.

    • @rinkachi-rinkitata
      @rinkachi-rinkitata 11 месяцев назад

      ​@@revolverocelot6587handy for source ports

  • @nil0bject
    @nil0bject 11 месяцев назад +2

    cool vid. fyi, don't make a relationship between player and camera. there is no need. just have the camera follow the player

  • @ruthlessadmin
    @ruthlessadmin 11 месяцев назад +1

    This would have been a cool video if you didn't ruin it with text-to-speech.

    • @Skisdomine
      @Skisdomine 4 месяца назад

      yea, and the sound effects he uses for the game sound goofy.
      also the rat npc looks weird and isn’t even necessary, if you ask me.

  • @Sw3nssoN
    @Sw3nssoN 11 месяцев назад +6

    Great video, one type of problem ive always had with both these types of engines and raycaster engines is rendering halfblocks/slopes etc. Could you make a video about this?

  • @Wingman-69
    @Wingman-69 11 месяцев назад +3

    Can‘t play doom on a pregnancytest anymore😢

  • @taichikitty
    @taichikitty 11 месяцев назад +2

    The artificial voice for the narration keeps me away from the content, sorry.

    • @litjellyfish
      @litjellyfish 11 месяцев назад

      @@knight5370no he is spot on. It really is distracting

    • @dieSpinnt
      @dieSpinnt 10 месяцев назад +1

      They kind of make you feel uncomfortable, don't they?
      But if you think about it, would you also express such childish criticism towards a mute, disabled or otherwise disadvantaged person (this includes the lack of training in a foreign language)? Of course, your criticism is absolutely valid. Nobody is forcing you to watch this content. Bon Voyage!:)

  • @azaias
    @azaias 11 месяцев назад +7

    Thanks again for the content and in-depth explanations! I always look forward to your videos

  • @joshbarros1995
    @joshbarros1995 11 месяцев назад +4

    Amazing brother!!! Do you plan to increase it, add multiple floors, stairs, diagonal walls, powerups, episodes, bosses and more?

  • @EmiliaKaida
    @EmiliaKaida 11 месяцев назад +3

    One year ago, you made a video about DOOM (Wolfenstein) game in Pygame. Is there any difference between this and that version?

    • @arashputata
      @arashputata 11 месяцев назад +2

      That one was more native, this one uses opengl

    • @costelinha1867
      @costelinha1867 11 месяцев назад +1

      The other one was made using raw pygame with raycasting, meaning the rendering is done entirely via the CPU, and the game is actually 2d, so much so that the ground in that game is not a texture, but just a colored rectangle.
      This one actually uses the GPU (Hence why it's so much more complicated to work with) but that means it's no longer pseudo-3d but ACTUALLY 3d, which means you no longer need to rely on raycasting to render the textures, and you can more easily remove the limitation of only being able to aim horizontally. Also since you're using the GPU, you can optimize it more, since it's no longer just using the CPU for everything.

  • @replicant8532
    @replicant8532 11 месяцев назад +12

    I've taken a look at the repo and I must say that's pretty good written code. I like how you organized the classes. This is very neat, congrats!

  • @Rafaeldonfigueiredo
    @Rafaeldonfigueiredo 11 месяцев назад +2

    Wow! How could I learn game concept like you. I'm always impress with your knowledge. I try to understand some concept watching gaming videos, but I think I need some books to learn too.

  • @martinbecker1069
    @martinbecker1069 11 месяцев назад +2

    I'd be lying if I said I wasn't disappointed that this wasn't the next episode of recreating the original doom engine, but you don't owe us anything (so do what you want) & this is still awesome and interesting.

  • @theALFEST
    @theALFEST 11 месяцев назад +1

    Why using dictionaries instead of arrays/lists for map data?

  • @jumbledfox2098
    @jumbledfox2098 3 месяца назад +1

    really brilliant video, you are very good at what you do

  • @anomalouschaz
    @anomalouschaz 11 месяцев назад +2

    bro please make a full tutorial... noob python devs like me are unable to make all of this from scratch by our own xD
    I have never been able to find a good tutorial about how to implement GL graphics on pygame :(

    • @shivangrathore
      @shivangrathore 11 месяцев назад

      Even a expert python programmer can't understand this, you need mathematical knowledge and knowledge about rendering and all

    • @azaias
      @azaias 11 месяцев назад

      The OpenGL 3D Engine series has actually been extremely valuable to me for learning about OpenGL with pygame. But I also spent a LOT of time afterward just testing things in a simple pygame app with an OpenGL context to figure out how they work, what can break certain things and why, etc... Alot of the math involved is still completely foreign to me though.

  • @consonaadversapars
    @consonaadversapars 11 месяцев назад +1

    Will you make a whole game? Where can I buy it?

  • @АлексейШтейников-ц4ц
    @АлексейШтейников-ц4ц 11 месяцев назад +4

    finally some good pygame content

  • @kangaroo_
    @kangaroo_ 4 месяца назад

    This is brilliant beyond compare! Love your tutorials. When I tried to run the code, the shaders generate an error saying “slot unavailable for layout location” and TypeError: 'NoneType' object is not subscriptable. In context of understanding what’s happening at a deeper, any help would be much appreciated.

  • @TheLonerD
    @TheLonerD 11 месяцев назад +2

    Thanks for Borderlands music.

  • @gsestream
    @gsestream 11 месяцев назад +2

    skybox for outdoor levels, double sided triangles to get rid of the vertex order/culling. just use pixel shader that renders scatter light reflection cache fast, ie the whole scene but fast approximation.. use sprite rendering for bounce scatter lighting 360 degree fast image renders, similar to g-buffer but for scatter lighting.

    • @gsestream
      @gsestream 11 месяцев назад +1

      instance the per pixel fast reflection cache object light emission/reflection approximation spheres, even textured with object spheremap if you so choose

    • @gsestream
      @gsestream 11 месяцев назад +1

      Try plane-triangle scan line at once z-buffered line-texturing rendering on old slow systems, simply multi-threadable also.

    • @gsestream
      @gsestream 10 месяцев назад

      ahem, moderngl does not install with recent build tools 143 for visual studio. I dont like bugged installers, pip install moderngl.

  • @eifclub978
    @eifclub978 Месяц назад

    THANK YOU SO MUCH I FINALLY FINISHED IT
    🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳🥳

  • @СлаваКучумов-к2з
    @СлаваКучумов-к2з 11 месяцев назад +1

    Zaaaaaamn that looks more difficult than rocket science 😳😳😳

  • @ChezDog
    @ChezDog 11 месяцев назад +1

    nice, but crashes on me, the assets have no sprite folder,idk,every modules are fine,anyway I'm Impressed, in this video , I'm still new in coding python btw

    • @CoderSpaceChannel
      @CoderSpaceChannel  11 месяцев назад +1

      Empty folders were not added to the repository. Fixed, try again

    • @ChezDog
      @ChezDog 11 месяцев назад

      got it,thanks@@CoderSpaceChannel

  • @Sebwazhere
    @Sebwazhere 7 месяцев назад

    I did the first part of the voxel engine for this tutorial but now there's all this new stuff which I don't understand how to add now

  • @yondration4285
    @yondration4285 11 месяцев назад +1

    We want tutorial for it

  • @MaHaririan
    @MaHaririan 2 месяца назад

    Thanks 🙏🏻
    I have a question
    What is the name of map making app?

  • @KageMorghulis
    @KageMorghulis 4 месяца назад

    Why don’t you speak with you’re own voice?

  • @ezequiel6091
    @ezequiel6091 11 месяцев назад +1

    Can you create a 3D phisycs engine?

    • @iniyanmaster4194
      @iniyanmaster4194 11 месяцев назад

      He already posted a video on that topic

  • @milklordnomadic
    @milklordnomadic 29 дней назад

    What's up with the AI voice on these?

  • @razorblade413
    @razorblade413 11 месяцев назад +1

    Awesome vid! I have 1 question: why the main class deal with the opengl context initialization instead of engine class?
    I'm relatively new to this. I'm on the journey of making a 3d game opengl with the absolute bare-minimum stuffs in Java, but I watched this video and is just what I'm looking for, but in python.
    The way that I'm currently doing this in short is:
    Main class:
    main(){
    new Engine().run();
    }
    Engine class:
    public void run() {
    init();
    loop();
    clean();
    }
    private void init() {
    // init window
    // init opengl context
    // init shaders
    // load model and create gameobject (example: a character with a texture)
    // init controller stuff
    // init projection and view matrices
    }
    private void loop() {
    // init time
    while {
    // start time
    // update method
    // render method
    //window class: swap buffers and poll events
    // show fps ups on screen
    }
    }
    private void clean() {
    // clean buffers object and finish game
    }
    Is this organization code correct? I'm trying to apply best practice and all the code thanks!

    • @svenhulsebus6200
      @svenhulsebus6200 11 месяцев назад

      Probably just coding style. Python tends to throw it all in main, while Java style would go for an extra screen and OpenGl context class, injected everywhere one needs it. Generally seperation of tasks is a good idea

    • @azaias
      @azaias 10 месяцев назад

      The main class seems to be for initializing the display, which includes the initialization of the OpenGL context, and running the engine. The engine deals with the game itself. This approach seems very clean and easier to manage

  • @softwet4341
    @softwet4341 11 месяцев назад +1

    WOW, new video

  • @autozone5335
    @autozone5335 11 месяцев назад +1

    Absolutely amazing!

  • @MyRobenson
    @MyRobenson 8 месяцев назад

    HELP!!! How do I create a parser

  • @adepejufaruq6970
    @adepejufaruq6970 10 месяцев назад

    Can you please make a video that we will just follow just to replicate this "Einstein-like" work?
    Pleeeeease?

    • @CoderSpaceChannel
      @CoderSpaceChannel  10 месяцев назад

      This video is a symbiosis of two tutorials, about creating a voxel engine and a video about raycasting. Creating a level is like one layer of voxels, and the main game logic is taken from the tutorial about raycasting

  • @SkyFly19853
    @SkyFly19853 11 месяцев назад +1

    Sooooooo good.
    Python has so much potential...

    • @litjellyfish
      @litjellyfish 11 месяцев назад

      It has for sure. But not really for those types of applications. it’s sooo sloooooow

  • @RetroGamesCouple
    @RetroGamesCouple 11 месяцев назад +1

    Well done indeed! Looks very nice and well made!

  • @worldwisethinker
    @worldwisethinker 6 месяцев назад

    That Borderlands 2 music in the background sent me straight back to 2012.

  • @maramarek
    @maramarek 10 месяцев назад

    Hello, how come the accuracy of the enemies shooting is around 5% in my case? Txh

  • @Wilksey37
    @Wilksey37 11 месяцев назад

    Just resolved the deps, and the HUD sprites in the game are huge, there are no door sprites I can see, which is why I can't move through the gaps I guess if the door is "closed", and the console keeps pumping out: "libpng warning: iCCP: known incorrect sRGB profile" - what am I missing?

    • @Wilksey37
      @Wilksey37 11 месяцев назад

      Warnings were a red herring, it was using Intel graphics instead of Nvidia, why would the Intel graphics cause some of the images to not display? It is an i7-9750H with integrated UHD 630 Graphics, should be man enough to display an image? IT was the HUD images were massive in the centre screen, enemies and other sprites and doors, all other textures were present.

    • @matricesingolare9150
      @matricesingolare9150 10 месяцев назад

      Same problem... Did you solve it?

    • @Wilksey37
      @Wilksey37 10 месяцев назад

      @matricesingolare9150 yes it was using on board graphics instead of my graphics card, not sure why that affects it but that solved it for me.

    • @matricesingolare9150
      @matricesingolare9150 10 месяцев назад +1

      @@Wilksey37 thank you!!!

  • @dieSpinnt
    @dieSpinnt 10 месяцев назад

    Just a question about some design choices. I get it that no swastika was used. The original version was banned in Germany for that reason. But why do you display my murderous and evil ancestors as rats?:) That is dehumanizing and waters down an important historical lesson: Everyone of us is able to do the worst and unthinkable atrocities. Just some "gamification" is needed, like a hateful ideology paired with bad environmental or economical conditions plus some kind of reward for you.
    But thank you for the video!:)

    • @CoderSpaceChannel
      @CoderSpaceChannel  10 месяцев назад

      Rats are enemies unique to the SNES port of Wolfenstein 3D. Mutant rats were added to the game in order to replace dogs, because of the strong censorship of the port.

    • @Skisdomine
      @Skisdomine 4 месяца назад

      @@CoderSpaceChannelyou could’ve just used dogs, lol

  • @andrzejsiebieranski7239
    @andrzejsiebieranski7239 11 месяцев назад +1

    As always, good work!

  • @Dast-U1
    @Dast-U1 10 месяцев назад

    Я жду от тебя туториал по Python , только ты можешь объяснить мне python.
    Было бы круто если бы ты снимал ещё на русском языке, я английский не понимаю но судя по проектам ты красавчик

  • @Joao-uj9km
    @Joao-uj9km 11 месяцев назад

    Looking beautiful m8! Congrats on the performance, given it running python on cpu side. Also cool that you've used OpenGL. These days Vulkan has been very compelling.

  • @eifclub978
    @eifclub978 Месяц назад

    Why is the sprite sheet a txt file not a png one in github

    • @CoderSpaceChannel
      @CoderSpaceChannel  Месяц назад

      run the game and the sprite sheet will be automatically generated

  • @chuckebbs7541
    @chuckebbs7541 7 месяцев назад

    thank you man

  • @roman-bolkhovitin
    @roman-bolkhovitin 7 месяцев назад

    It's awesome. Waiting for Quake.

  • @chuckebbs7541
    @chuckebbs7541 7 месяцев назад

    I really love these videos and they are helping me a great deal on working with my own engine

  • @Wilksey37
    @Wilksey37 11 месяцев назад

    Amazing work, would be interesting to add a way to adjust the ceiling and floor height and perhaps add slopes to the levels.

  • @omiorahman6283
    @omiorahman6283 11 месяцев назад

    Can we get a assimp and modern tutorial

  • @yds6268
    @yds6268 11 месяцев назад

    You deserve a million subscribers for sure!

  • @Freshbrood
    @Freshbrood 11 месяцев назад

    This is pretty cool. Is your code open source and available to play with?

  • @eifclub978
    @eifclub978 3 месяца назад

    it doesn't work, i had to remove the doors

  • @eifclub978
    @eifclub978 3 месяца назад

    how to open doors?

  • @carlfranz6805
    @carlfranz6805 11 месяцев назад

    What will this run on?

  • @pppkenken6610
    @pppkenken6610 11 месяцев назад

    Shift the word.

  • @borisstihkrajnc6234
    @borisstihkrajnc6234 11 месяцев назад +2

    Sorry but you are 30 years too late.

  • @MrEnergy921
    @MrEnergy921 11 месяцев назад

    Impresive! Very Nice!

  • @skyneon-8500
    @skyneon-8500 11 месяцев назад

    wow

  • @costelinha1867
    @costelinha1867 11 месяцев назад +1

    Pretty impressive, although honestly, I doubt I would have the patience to implement such a game in such a low level way, and instead would probably resort to a game engine. (Which again, only makes your approach even more impressive.)

  • @legiran9564
    @legiran9564 11 месяцев назад +1

    Any plans to do a Doom game tutorial in Vulkan?

  • @אילוןמעיין
    @אילוןמעיין 11 месяцев назад

    תודה!

  • @jesse2535
    @jesse2535 11 месяцев назад

    I'm on a journey to code a software rasterizer that can run decently well for old looking game graphics and still be written in python and use software to code the rasterizing algorithms. Thus far with the use of numpy I can draw a triangle every frame at around 1000 fps when pygame's triangle algorithm can do it in 2500 fps. The difference is huge but that one uses highly optimized code and basic GPU parallelization. These videos help me figure out how to do this better each time. Thanks for the work.