What is Mode 7? Let's code it!

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024
  • Creating a pseudo 3D effect using Mode 7 in Python and Pygame.
    Github:
    github.com/Sta...
    #coderspace #mode7 #pygame #python

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

  • @cheezeebutter452
    @cheezeebutter452 6 месяцев назад +43

    I hate this recent "trend" of using ai voices in videos. Please let us hear your voice, it is not a bad one I am sure, it can't be worse than the emotionless ai voices.

    • @playnalisis
      @playnalisis 3 месяца назад +7

      The problem is a lot of people do not have a good voice. And it’s very hard to do a video without takes after takes.

    • @cheezeebutter452
      @cheezeebutter452 3 месяца назад +8

      @@playnalisis Personally I'd still prefer a "bad" voice over an ai voice. I've done some videos before and am actually working on some and yeah it's a lot of work doing takes and retakes but its real man.

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

      @@cheezeebutter452 there is really good Ai voice. I use it and it works

    • @Sunrymoon
      @Sunrymoon 2 месяца назад +4

      The real problem comes from the fact everyone has his own problem. Whether or not it's a lack of mic,lack of time,a very strong and pronounced accent, having the voice of a toddler etc. tho I do not like the ai voices,I don't think it's a "trend" and I think a lot of people just see ai voices as an opportunity to make videos regardless of their limitations

    • @Ostnizdasht206
      @Ostnizdasht206 2 месяца назад +1

      I agree but unfortunately ai is here to stay.

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

    Well done! Impressive channel. Love how much more you get out of pygame.
    I’d love if you make a video about driving game from the driver perspective

  • @ThankYouESM
    @ThankYouESM Год назад +5

    Liked and already sub'd! I wish there was a way to also create HTML5 games at least from our Python scripts, especially because I have far more time to play smartphone games as opposed to PC games.

  • @eddievhfan1984
    @eddievhfan1984 Год назад +30

    It's worth noting that in the IRL Super NES/Super Famicom, that Mode 7 was natively only capable of doing linear matrix transformations (translate, rotate, scale, skew). In order to get these 3D perspectives, the console could run small graphics attribute updates at the end of every video scanline (H-DMA, horizontal blanking Direct Memory Access), changing the Mode 7 transformation matrix on each line to simulate a non-linear transform. This is also used to get different "sky" and "floor" patterns, as Mode 7 supported only one background layer; you'd draw the sky, then rapidly mirror the floor graphics into the graphics memory.

  • @VanillaMidgetSSBM
    @VanillaMidgetSSBM Год назад +56

    Something I want to point out - This is **not** Mode 7, this is simply a perspective projection (which, while was possible using Mode 7, was not the only purpose)
    Mode 7 on the Super Nintendo was a Hardware Acceleration feature that allowed a background layer to be adjusted using an Affine Transformation.

    • @AkaiKnight
      @AkaiKnight 5 месяцев назад +4

      *adjusts glasses*
      "well, acktually..."

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

      Retro Game Mechanics Explained covers this topic in his SNES series. The familiar “mode 7” perspective also depends on HDMA varying the scale factor over time as the screen is drawn.

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

      I think he/she meant "Mode 7 looking" graphics.

  • @ivanmironov599
    @ivanmironov599 Год назад +25

    For those who might follow along with this tutorial and write the code as it goes, note that you will not be able to get a display window to pop up (seen at 2:40 and 3:30) if you have created only a mode7 and settings file. The reason it works for them (and wasn't explained from the beginning) is because they're using PyCharm and, when they run the code in the mode7 file, their configuration is set to work off of the main file they already have coded out.
    Note: As of this writing, Numba is only compatible with Python 3.7-3.10, and NumPy versions 1.18-1.23. They are currently working on updating it to work with Python 3.11.

    • @girlsdrinkfeck
      @girlsdrinkfeck Год назад

      their ? i only hear a single dude talk

    • @issholland
      @issholland 28 дней назад

      ​@@girlsdrinkfecktheir is singular possessive

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

    Demo coder here. Quite clearly explained, but so many optimizations possible... First, eliminate repeated variables (like floor_pos and cell_pos) and make all the operations in the same expression to eliminate further variables... make a sin/cosine table (or sin, sin+90) and make it integer by passing the SCALE to it and trunk (less resolution, a lot of performance boost)... Make the divisions 2-exponent where possible and convert to binary left rotations... I'd like to see how it performs with these without jit compilation.

  • @stevenray8737
    @stevenray8737 Год назад +10

    Magnificent tutorial. Brings back memories of writing a ray-caster demo many years ago.

  • @sulrich70
    @sulrich70 Год назад +12

    Incredible. Thank you. It’s simple the way you do this, but it’s also hard!

  • @barnabyfontana7528
    @barnabyfontana7528 13 дней назад +1

    This is definitely not how mode 7 worked. Mode 7 was not "weak 3d", it was not even 3d. Perhaps an aproximation, but still does not look nor behaves like mode 7 did. In the snes, a 2x2 matrix was applied per scanline (when a scanline was finished, an interrupt is called which changes the matrix; that's how the snes was able to do it. If other consoles, like the megadrive/genesis had the ability to call interrupts at the horizontal blaking, they would have been able to achieve the same effect. Of course, this would need to be at the VDP level, and the vdp would need to have the ability to do matrix transformations quite fast).

  • @johnstarfire
    @johnstarfire Год назад +9

    Yours are the state of the art of tutorials and their topics are so interesting. Your subscribers will increase soon.

  • @costelinha1867
    @costelinha1867 Год назад +3

    People: Pygame isn't exactly suited for 3d game develpment.
    Coder Space: Make a shit ton of videos on how to do 3d/pseudo 3d game development in Pygame.

  • @blurayys
    @blurayys Год назад +7

    Love this! Do you think you could make a tutorial on 2.5d, where you are a 2d character in a 3d environment? (Like Pokemon Diamond and Pearl)

  • @貝時計
    @貝時計 11 месяцев назад +2

    とても参考になる興味深い解説です!
    細部まで理解して、自分でも実装してみます

  • @VeraVoxel
    @VeraVoxel Год назад +3

    you know they could easily sell a gimped piece of doom by just adding a second background, but scaled from the top instead to seem like a ceiling. And then the walls could be moving sprites. And the floor of course is the normal mode 7 layer.

  • @user-dc9zo7ek5j
    @user-dc9zo7ek5j Год назад +4

    Amazing work, I remember I played a game with similar effect 15 years ago, I think it was final fantasy but I might be mistaken.

  • @spikkit
    @spikkit Год назад +3

    I was able to implement this into your previous DOOM-like tutorial, but it looks super janky. Like, it displays the floor and ceiling properly, and I have it use the players position and angle to move it around which also works, but it looks like its all detached from the walls. Any suggestions on how this could be fixed?

    • @spikkit
      @spikkit Год назад +1

      I think i has to do with the FOV not matching between the wall projection and the floor/ceiling projection, but I'm not sure how to remedy this.

    • @CoderSpaceChannel
      @CoderSpaceChannel  Год назад +2

      seems to be the answer here:
      gamedev.stackexchange.com/questions/176347/raycasting-with-mode7

  • @K5RTO
    @K5RTO Год назад +3

    Nice! I am really enjoying your channel. Keep up the good work.

  • @xLoxLoLex
    @xLoxLoLex Год назад +4

    I always enjoy your content so much!

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

    The next improvement I'd suggest is using a plane composed of tiles, that would be closer to the real mode7, as the mode7 was a regular tile plane, composed of small tiles, that supported affine transforms during their display. Cool effects!👍

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

    Sine of x (degrees) ≈ (4x(180-x))/(40500-x(180-x))
    Bāshkara I approximation of sine

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

    For two decades i always tout that mode7 could move a background in 3D space including 3D rotation in all directions,BUT as it turns out,a background doesn’t move in 3D space,instead a background is scewed,stretched,shrinked in whether form to fake 3D movement of it but in reality it just uses perspective correction to give the elussion of a background moving in 3D,
    Pretty clever,
    Same thing with sprite scaling trough software,
    Now even if a background and a sprite could,ve move in 3D space,i still would,ve considered that as fake 3D as well since everything would,ve be still flat anyway,except that it would,ve look smoother.

  • @karaliseklers2531
    @karaliseklers2531 Год назад +2

    wow so many clickbait youtubers out their but u hold it down

  • @rockaripoffj
    @rockaripoffj 7 месяцев назад +1

    was looking for a tutorial like this, amazing

  • @MURBULBEK
    @MURBULBEK Год назад +28

    Backrooms??????

    • @Alpaca_4
      @Alpaca_4 Год назад +3

      Yes☠️☠️☠️☠️

  • @SkyFly19853
    @SkyFly19853 Год назад +3

    I love retro style...

  • @zhabiboss
    @zhabiboss Год назад +2

    You should make a series with nostalgic games

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

    Just what I needed! Ty

  • @doka-sp
    @doka-sp 8 месяцев назад +1

    ew, AI generated

  • @1980y
    @1980y Год назад +4

    чувак, ты просто клевый!!очень светлый и здравый ум! спасибо за твои труды! я тобой восхищаюсь!
    ps да я русский...

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

    I wonder; is it possible to use this with a Wolfenstein 3d style ray cast for drawing walls?

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

    *Nostalgic Mode7 Fans*

  • @djaccount5458
    @djaccount5458 Год назад +1

    Hello, how put object on projected plane, i have no idea!!!

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

    Hmmm how can i bend the plane to make it like a sonic 3 special stage style?

  • @gawd0r
    @gawd0r Год назад +23

    Amazing video, so beautiful to see stuff that I used to implement in days in assembly, being done in a few python lines. Excellent tutorial!

  • @HrvRockstar12
    @HrvRockstar12 Год назад +1

    lol I don't even know how to get to the first menu that he got. How do you get GMS2 to recognize these files?
    Also - will this overwrite how Game Maker Studio 2 will run? I have other levels that do not use this.

    • @samuelhulme8347
      @samuelhulme8347 9 дней назад

      Game Maker Studio is not used in this video at all. It’s just regular Python.

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

    i feel as if this should be easy to add to your wolfenstein game. any tips?

  • @gianlucagiuman6132
    @gianlucagiuman6132 Год назад +1

    Super !! High level teacher updated on latest news for library !! i remeber the old demo on amiga....

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

    4:01 I tried the command and it doesn't work! Son of a program!

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

    Such a brilliant looking effect

  • @ASTERisk44946
    @ASTERisk44946 Год назад +1

    I love this I'm gonna try to make a flying game via mode 7

  • @mtalhakhalid1679
    @mtalhakhalid1679 Год назад +1

    Infinite room looon like gzdoom one hahahaha

  • @why_i_game
    @why_i_game Год назад +1

    You have a typo in your description, "Paygame" should be "Pygame".

    • @CoderSpaceChannel
      @CoderSpaceChannel  Год назад +1

      thanks, fixed

    • @why_i_game
      @why_i_game Год назад

      @@CoderSpaceChannel Great videos, by the way. Almost makes me want to get into coding in Python!

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

    Snes the best console

  • @kowkodivka
    @kowkodivka Год назад +1

    wow, thanks for the new video!

  • @cookiepolice2086
    @cookiepolice2086 Год назад +1

    What does dx, dy and focal length mean? And thx.

    • @CoderSpaceChannel
      @CoderSpaceChannel  Год назад +1

      dx, dy - increments, one step on a 2d plane, along the x and y axes
      fol_len - distance from the camera to our screen

  • @謙虛的學仔
    @謙虛的學仔 Год назад +1

    so nice^^

  • @enzetael
    @enzetael Год назад +1

    0:40 what's the name of this game?

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

    wow this is very interesting. I love 3D effects.

  • @_ironrose
    @_ironrose Год назад +2

    great video! please continue creating tuts about interesting topics like this

  • @lanchanoinguyen2914
    @lanchanoinguyen2914 Год назад

    Which api you use?

  • @xaosit8974
    @xaosit8974 Год назад +1

    я то думал, где ты пропадал, а ты вот где шляешься)

  • @tcgvsocg1458
    @tcgvsocg1458 Год назад +1

    pleae can you do the first level of game like "street of rage" but in python from very begginig to end ?

  • @liorxd2557
    @liorxd2557 Год назад +1

    you are genius :0

  • @MrEnergy921
    @MrEnergy921 Год назад

    You are the python god! :D

  • @backer01
    @backer01 Год назад

    А почему ты забросил старый канал?

  • @ChristianGeske-yn3mr
    @ChristianGeske-yn3mr Год назад +1

    Just in time compilation in Python you just blew my mind lmao.

  • @Logicatube
    @Logicatube Год назад +1

    Почему ты перешел на англоязычный ютуб?

    • @MrRastler
      @MrRastler Год назад +1

      Потому что, там есть монетизация :)

  • @mark-tin
    @mark-tin Год назад

    Жаль что ру видео больше нет