My Retro 3D Engine is Ready

Поділитися
Вставка
  • Опубліковано 15 жов 2024
  • Streamed Live on Twitch: / tsoding
    Enable Subtitles for Twitch Chat
    More Episodes: • Raycasting in TypeScript
    References:
    github.com/tso...
    lodev.org/cgtu...
    tsoding.github...
    tsoding.github...
    github.com/mrd...
    Support:
    BTC: bc1qj820dmeazpeq5pjn89mlh9lhws7ghs9v34x9v9
    Pay for my VPS: zap-hosting.co...

КОМЕНТАРІ • 62

  • @Owen3H
    @Owen3H 3 місяці тому +7

    Great work on the optimizations, couldn't get it to go below 120 and average is ~200. I did also notice a little bug where tabbing out to a different monitor (or right clicking) would keep the player moving until the same key was pressed again.

    • @TsodingDaily
      @TsodingDaily  3 місяці тому +13

      Thank you! And all of that on a 2D Canvas without any hardware acceleration, pixel-by-pixel in pure JavaScript. It's truly admirable how much the best Google Engineers managed to optimize this Toy Script Language.

  • @hendrikd2113
    @hendrikd2113 3 місяці тому +13

    39:50 "I need picture, and arrow!"
    Next stream: Category Theory.

  • @sirynka
    @sirynka 3 місяці тому +6

    It is running at ~70 fps on my tablet (snapdragon gen1). The minimum i've got was 30 fps when most of the screen is covered by key and wall textures.

  • @irishbruse
    @irishbruse 3 місяці тому +13

    Just a heads up to everyone you can see twitch chat if you enable closed captions

    • @OM-yn8pt
      @OM-yn8pt 3 місяці тому +1

      this is crazy whats happening here??

    • @Blazing_Hotmagma
      @Blazing_Hotmagma 2 місяці тому

      @@OM-yn8ptjust yet another recreational programming session

  • @taba1950
    @taba1950 3 місяці тому

    Not sure if you know this already, using the "debugger" command in the browser will pause the execution and bring up the debugger. You can write it before any point in your code that you want to debug

  • @skejeton
    @skejeton 3 місяці тому +21

    21:21 an unholy amount of spaces

    • @desplmfao
      @desplmfao 3 місяці тому +4

      its what shows if you use tabs instead of spaces in github

  • @BlackHermit
    @BlackHermit 3 місяці тому +1

    With great retro comes great responsibility.

  • @FrankBudino
    @FrankBudino 3 місяці тому +7

    8:17 - "From the pp....from the pp....we are shooting the rays..." - and then I was interested...

    • @aciddev_
      @aciddev_ 3 місяці тому

      "tsoding measuring his pp size on the stream" - chatter

  • @alvaronaranjo2589
    @alvaronaranjo2589 2 місяці тому +1

    48:18 I saw up to calc in hs. Fun times

  • @notrumur
    @notrumur 3 місяці тому +1

    this is a beautiful work of art.

  • @Vinoyl
    @Vinoyl 3 місяці тому +3

    great stuff, thanks for sharing!

  • @OCPyrit
    @OCPyrit 3 місяці тому

    Z buffer as a 2d image was always a weird concept to me. You might think the Z value is already stored in the coordinates of the polygons and vertices, so you don't need this second frame buffer image.

    • @Heater-v1.0.0
      @Heater-v1.0.0 3 місяці тому +2

      Well, yes, all the information you need is in the coordinates of all the polygons and vertices. Consider: You already have hundreds of objects in your scene and have drawn them, then when you render a new object you have to find out if every pixel that could render it is in front or behind anything that was previously drawn so as to determine if that pixel should be drawn or not. That would require calculation from all the previously drawn objects polygons and vertices, a horrendous lot of work. The Z buffer basically remembers all the previously calculated depths of all the previously drawn objects, saving only the least depth ones. That saves recalculating things over and over. The Z buffer is basically a cache of previous results that greatly speeds things up.

  • @lukepond
    @lukepond 3 місяці тому

    This project is so cool, I aspire to do something like this one day

  • @DMWatchesYoutube
    @DMWatchesYoutube 3 місяці тому

    The inverse camera matrix looks like a scew operation

  • @kirillvoloshin2065
    @kirillvoloshin2065 3 місяці тому

    про врагов в пулл реквестах и "b for " топовые шутки)

  • @siriusleto3758
    @siriusleto3758 3 місяці тому +1

    It will replace Unity. Suggestion, ask to acquire information about the user's hardware and also obtain the maximum FPS and the browser used.

  • @IMBG-ih3nu
    @IMBG-ih3nu 3 місяці тому +1

    you're a literally a legend, and I think it;s finely the time to try Neovim

    • @taba1950
      @taba1950 3 місяці тому

      Nah, it's not worth it

  • @koktszfung
    @koktszfung 3 місяці тому +3

    It runs at 60 fps on my phone, does it count?

  • @Maik.iptoux
    @Maik.iptoux 3 місяці тому

    Last minute: but is there not still a problem with the sprite? Because it's in the "air" and not "standing" on ground/floor

  • @terrybrooks9514
    @terrybrooks9514 Місяць тому

    Matrix rant. Still laughing! "Problem Solved."

  • @jormoungandr
    @jormoungandr 3 місяці тому

    Seriously asking;
    what does that "Tea: 100°C" , I'm scared to think of that is the CPU degrees.

  • @ronp6108
    @ronp6108 3 місяці тому +1

    Isn't the matrix multiplication more efficient?

    • @TsodingDaily
      @TsodingDaily  3 місяці тому +1

      Yeah, probably. I should definitely look into that when I'll be optimizing things next time.

  • @MenilekAlemseged
    @MenilekAlemseged 3 місяці тому +1

    man i gotta know, whats ur hardware?

  • @zboxjpg
    @zboxjpg 3 місяці тому

    реальный сигма ставлю лайк

  • @wtfisgoingon535
    @wtfisgoingon535 3 місяці тому

    Did you know that "pp" sound exactly like "pipi" in French, a word that mean urine :')

  • @hubstrangers3450
    @hubstrangers3450 3 місяці тому

    Thank you...

  • @draftcypruss
    @draftcypruss 3 місяці тому +11

    Lets see when will js start bottleneck..

    • @iamdozerq
      @iamdozerq 3 місяці тому +1

      Js is actually very performant if you know what you doing. Todays js environments pretty optimized and js can turn in assembly as simple as c.

    • @cheerwizard21
      @cheerwizard21 3 місяці тому +5

      ​​​@@iamdozerqThat's actually a bold wrong statement. I mean, we can just begin with the fact that JS has no pointers and no custom memory managment at all. That's actually one of the most powerful tools for optimizations, especially in such complicated systems like game engines or similar. Compiler has also probably weaker optimizations for loops, branches, etc. If you turn your slow code into ASM or directly into machine language, it won't make it faster. WASM is not counted btw, because it's an external tool for optimizing JS and not JS itself.

    • @cheerwizard21
      @cheerwizard21 3 місяці тому +1

      You can for sure write simple retro game in JS like this one. I don't think he will se a lot of perfomance issues for such game, unless he scale it very rapidly.

    • @iamdozerq
      @iamdozerq 3 місяці тому

      @@cheerwizard21 i am sure that it possible to make things as fast(or even faster) than java or csharp. Ofcourse all our discussion can be discarded without huge performance tests sadly...

    • @cheerwizard21
      @cheerwizard21 3 місяці тому

      @@iamdozerq Compared to other "managed high level languages", JS can probably be faster, same as vice versa.

  • @negrastormentas2865
    @negrastormentas2865 3 місяці тому

    Are you going to implement "room over room" ?

    • @TsodingDaily
      @TsodingDaily  3 місяці тому +1

      For now, I don't really plan to add more features to the engine. I just wanna start making the actual game and then I'll see if I need anything else.

  • @nathanpotter1334
    @nathanpotter1334 3 місяці тому

    just in time for me to start!

  • @aftalavera
    @aftalavera 23 дні тому

    I only have a question for you tsod, whats your net worth?

  • @houssamassila6274
    @houssamassila6274 3 місяці тому +6

    you need some vitamin D, friend.

    • @angelcaru
      @angelcaru Місяць тому +1

      I prefer regular D

  • @ImDGreat
    @ImDGreat 3 місяці тому +1

  • @SwedishviKingohnoes
    @SwedishviKingohnoes 3 місяці тому +2

    Hahhaaaa Daggerfall clone when?

  • @nenkonotmapping477
    @nenkonotmapping477 3 місяці тому

    Z.......... buffer

  • @DeathSugar
    @DeathSugar 3 місяці тому

    Portal gun when?

  • @alexandrosvangelatos9979
    @alexandrosvangelatos9979 3 місяці тому

    Your awesome dude 😎🍻

  • @skejeton
    @skejeton 3 місяці тому

    tsoding dot what

  • @Seedwreck
    @Seedwreck 3 місяці тому +1

    Lies, 5 FPS on Edge.
    What is this, Chromium only??
    Maybe is not fast unless really *really* good specs.
    That's all.

    • @angelcaru
      @angelcaru Місяць тому +1

      Edge is Chromium-based, and his laptop is 10 years old

    • @Seedwreck
      @Seedwreck Місяць тому +1

      @@angelcaru I mean, my desktop is not new that’s for aure

  • @PennyEvolus
    @PennyEvolus 3 місяці тому

    Easily get 144fps on my laptop

  • @eliphazbouye
    @eliphazbouye 3 місяці тому +1

    First