What is Mode 7? Let's code it!

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ต.ค. 2024
  • Creating a pseudo 3D effect using Mode 7 in Python and Pygame.
    Github:
    github.com/Sta...
    #coderspace #mode7 #pygame #python

ความคิดเห็น • 89

  • @eddievhfan1984
    @eddievhfan1984 ปีที่แล้ว +31

    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 ปีที่แล้ว +57

    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 6 หลายเดือนก่อน +4

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

    • @zerobyte802
      @zerobyte802 5 หลายเดือนก่อน +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.

  • @stevenray8737
    @stevenray8737 ปีที่แล้ว +10

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

  • @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 หลายเดือนก่อน

      ​@@girlsdrinkfecktheir is singular possessive

  • @sulrich70
    @sulrich70 ปีที่แล้ว +12

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

  • @johnstarfire
    @johnstarfire ปีที่แล้ว +9

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

  • @貝時計
    @貝時計 11 หลายเดือนก่อน +2

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

  • @rockaripoffj
    @rockaripoffj 7 หลายเดือนก่อน +1

    was looking for a tutorial like this, amazing

  • @MaxCarponera
    @MaxCarponera 3 หลายเดือนก่อน +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.

  • @cheezeebutter452
    @cheezeebutter452 7 หลายเดือนก่อน +51

    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 หลายเดือนก่อน +10

      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 หลายเดือนก่อน +9

      @@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 หลายเดือนก่อน +7

      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.

  • @K5RTO
    @K5RTO ปีที่แล้ว +3

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

  • @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

  • @xLoxLoLex
    @xLoxLoLex ปีที่แล้ว +4

    I always enjoy your content so much!

  • @HandlebarOrionX
    @HandlebarOrionX 11 หลายเดือนก่อน +1

    Such a brilliant looking effect

  • @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.

  • @randy7894
    @randy7894 11 หลายเดือนก่อน +1

    Just what I needed! Ty

  • @1980y
    @1980y ปีที่แล้ว +4

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

  • @gianlucagiuman6132
    @gianlucagiuman6132 ปีที่แล้ว +1

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

  • @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.

  • @_ironrose
    @_ironrose ปีที่แล้ว +2

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

  • @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!👍

  • @SkyFly19853
    @SkyFly19853 ปีที่แล้ว +3

    I love retro style...

  • @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)

    • @CoderSpaceChannel
      @CoderSpaceChannel  ปีที่แล้ว +5

      I'll think about it

    • @Dekerus
      @Dekerus ปีที่แล้ว +1

      ​@@CoderSpaceChannel lolz!

  • @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.

  • @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.

  • @ASTERisk44946
    @ASTERisk44946 ปีที่แล้ว +1

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

  • @dietrichdietrich7763
    @dietrichdietrich7763 11 หลายเดือนก่อน

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

  • @djaccount5458
    @djaccount5458 ปีที่แล้ว +1

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

  • @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!

  • @barnabyfontana7528
    @barnabyfontana7528 21 วันที่ผ่านมา +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).

  • @zhabiboss
    @zhabiboss ปีที่แล้ว +2

    You should make a series with nostalgic games

  • @kowkodivka
    @kowkodivka ปีที่แล้ว +1

    wow, thanks for the new video!

  • @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

  • @phillippi2
    @phillippi2 10 หลายเดือนก่อน

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

  • @IdkFlyCasual
    @IdkFlyCasual 11 หลายเดือนก่อน

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

  • @tails_the_god
    @tails_the_god 4 หลายเดือนก่อน

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

  • @elModo7
    @elModo7 9 หลายเดือนก่อน

    *Nostalgic Mode7 Fans*

  • @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 17 วันที่ผ่านมา

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

  • @ChristianGeske-yn3mr
    @ChristianGeske-yn3mr ปีที่แล้ว +1

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

  • @Sky_kidharry
    @Sky_kidharry 4 หลายเดือนก่อน

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

  • @謙虛的學仔
    @謙虛的學仔 ปีที่แล้ว +1

    so nice^^

  • @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

  • @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!

  • @enzetael
    @enzetael ปีที่แล้ว +1

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

  • @MURBULBEK
    @MURBULBEK ปีที่แล้ว +28

    Backrooms??????

    • @Alpaca_4
      @Alpaca_4 ปีที่แล้ว +3

      Yes☠️☠️☠️☠️

  • @mtalhakhalid1679
    @mtalhakhalid1679 ปีที่แล้ว +1

    Infinite room looon like gzdoom one hahahaha

  • @xeridea
    @xeridea 2 วันที่ผ่านมา

    "in order for the method to be executed with the performance of compiled languages" ... .ummm, python will never be executed with the performance of compiled languages. You can get reasonable performance with JIT, but it will still never compare to what you can get with a compiled language.

  • @lanchanoinguyen2914
    @lanchanoinguyen2914 ปีที่แล้ว

    Which api you use?

  • @karaliseklers2531
    @karaliseklers2531 ปีที่แล้ว +2

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

  • @augustingavrilovici8951
    @augustingavrilovici8951 6 หลายเดือนก่อน

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

  • @liorxd2557
    @liorxd2557 ปีที่แล้ว +1

    you are genius :0

  • @tcgvsocg1458
    @tcgvsocg1458 ปีที่แล้ว +1

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

  • @miriamalmeida6687
    @miriamalmeida6687 10 หลายเดือนก่อน

    Snes the best console

  • @MrEnergy921
    @MrEnergy921 ปีที่แล้ว

    You are the python god! :D

  • @xaosit8974
    @xaosit8974 ปีที่แล้ว +1

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

  • @backer01
    @backer01 ปีที่แล้ว

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

  • @doka-sp
    @doka-sp 9 หลายเดือนก่อน +1

    ew, AI generated

  • @Logicatube
    @Logicatube ปีที่แล้ว +1

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

    • @MrRastler
      @MrRastler ปีที่แล้ว +1

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

  • @mark-tin
    @mark-tin ปีที่แล้ว

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