My Retro 3D Engine is Ready
Ғылым және технология
Streamed Live on Twitch: / tsoding
Enable Subtitles for Twitch Chat
More Episodes: • Raycasting in TypeScript
References:
- github.com/tsoding/raycasting
- lodev.org/cgtutor/raycasting3...
- tsoding.github.io/raycasting/
- tsoding.github.io/olive.c/
- github.com/mrdoob/three.js/bl...
Support:
- BTC: bc1qj820dmeazpeq5pjn89mlh9lhws7ghs9v34x9v9
- Pay for my VPS: zap-hosting.com/en/shop/donat...
Пікірлер: 57
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
28 күн бұрын
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.
21:21 an unholy amount of spaces
@desplmfao
28 күн бұрын
its what shows if you use tabs instead of spaces in github
39:50 "I need picture, and arrow!" Next stream: Category Theory.
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.
great stuff, thanks for sharing!
this is a beautiful work of art.
Just a heads up to everyone you can see twitch chat if you enable closed captions
@OM-yn8pt
28 күн бұрын
this is crazy whats happening here??
@Blazing_Hotmagma
11 күн бұрын
@@OM-yn8ptjust yet another recreational programming session
8:17 - "From the pp....from the pp....we are shooting the rays..." - and then I was interested...
@aciddev_
17 күн бұрын
"tsoding measuring his pp size on the stream" - chatter
With great retro comes great responsibility.
It runs at 60 fps on my phone, does it count?
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
The inverse camera matrix looks like a scew operation
This project is so cool, I aspire to do something like this one day
you're a literally a legend, and I think it;s finely the time to try Neovim
@taba1950
21 күн бұрын
Nah, it's not worth it
just in time for me to start!
❤
реальный сигма ставлю лайк
It will replace Unity. Suggestion, ask to acquire information about the user's hardware and also obtain the maximum FPS and the browser used.
Lets see when will js start bottleneck..
@iamdozerq
28 күн бұрын
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
28 күн бұрын
@@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
28 күн бұрын
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
28 күн бұрын
@@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
28 күн бұрын
@@iamdozerq Compared to other "managed high level languages", JS can probably be faster, same as vice versa.
man i gotta know, whats ur hardware?
про врагов в пулл реквестах и "b for " топовые шутки)
Last minute: but is there not still a problem with the sprite? Because it's in the "air" and not "standing" on ground/floor
Isn't the matrix multiplication more efficient?
@TsodingDaily
28 күн бұрын
Yeah, probably. I should definitely look into that when I'll be optimizing things next time.
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
27 күн бұрын
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.
Thank you...
Seriously asking; what does that "Tea: 100°C" , I'm scared to think of that is the CPU degrees.
Are you going to implement "room over room" ?
@TsodingDaily
28 күн бұрын
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.
Your awesome dude 😎🍻
Did you know that "pp" sound exactly like "pipi" in French, a word that mean urine :')
Hahhaaaa Daggerfall clone when?
Z.......... buffer
Portal gun when?
tsoding dot what
you need some vitamin D, friend.
Easily get 144fps on my laptop
First
Lies, 5 FPS on Edge. What is this, Chromium only?? Maybe is not fast unless really *really* good specs. That's all.