you single-handedly got me interested in the more technical, "mathy" aspects of programming. i genuinely thought it was something i wouldn't be able to grasp or learn but your videos made it so much more accessible - thank you sir :).
@javidx94 жыл бұрын
Thats cool Thomas, I hope you continue learning!
@ykyjohn4 жыл бұрын
indeed, thank you very much
@bethesdacam3 жыл бұрын
This!
@Fergobirck4 жыл бұрын
You have an incredible gift for tutoring. I've started following you when you had 6k subs and it's great to see how the channel has grown. You deserve it!
@javidx94 жыл бұрын
Hey thanks Fernando, its very humbling (or disturbing?) that people are interested in what I babble on about XD. Thanks for your support though buddy!
@jacq02724 жыл бұрын
Your tutorials are always really helpful for understanding these concepts. I cannot wait to dive into this one!
@javidx94 жыл бұрын
Well thanks Jacq0, this video is more of an application example rather than the theory behind it, but I hope its informative!
@jacq02724 жыл бұрын
@@javidx9 No bother at all, my comment is poorly phrased. Even if its just an application and explanation, it can still be valuable in understanding, especially since the source is available. Like a demonstration of sorts!
@ManMadeOfGold4 жыл бұрын
I was just rewatching a lot of your old vids until a few minutes ago, guess I'm not done yet!
@javidx94 жыл бұрын
lol, there's quite a few now :D
@TopShelfization3 жыл бұрын
reinventing the wheel, simply because you can.
@monopoly21704 жыл бұрын
"This is all technology I've covered in two previous videos" And I wouldn't mind a thousand more
@Godmcgod4 жыл бұрын
You sir are the Bob Ross of programming. Never stop!
@whoshotdk2 жыл бұрын
I just implemented sprites in my raycaster based on the code from this. On line 584+, you calculate the screen position of the sprite. It sits inside a double "for" loop. If you were to define the position variable before the loop, you'd be able to check the Y position is in screen bounds during the Y loop, outside the X loop. If it's out of bounds, simply "continue" the loop, bypassing the X loop entirely. Probably considered a micro-optimization but it really helped speed things up in my C# implementation!
@doscassette8713 жыл бұрын
Absolutely fantastic. I've been looking for an engine like this to build a retro ARPG and had been messing around with building my own but this saves a ton of time. Absolute legend
@zerdagdir19884 жыл бұрын
Bisqwit tackled this subject to an extreme level
@iProgramInCpp4 жыл бұрын
I have not seen one single raytracer video on his KZbin channel. The only things I've seen are proper 3D software renderers
@r1pfake5214 жыл бұрын
Watching Bisqwit is nice and entertaining, but I don't really learn much from them, because most of the time he just shows the code and doesn't really explain that much. To be honest Im not even sure if he considers his videos as tutorials or if he just wants to show cool stuff.
@zerdagdir19884 жыл бұрын
@@zohichnazirro8640 +1
@zerdagdir19884 жыл бұрын
@@r1pfake521 javid knows how to teach, I wouldn't be surprised if he was a teacher
@Roanokekidstech4 жыл бұрын
iProgramInCpp he has a video called “Creating a doom style 3D shooter in C” I’m not entirely sure but I feel like that was a raycast engine? Correct me if I am wrong. It just seems like he added some more advanced features.
@BudgiePanic4 жыл бұрын
This channel is really something special, I've studied computer science at university for one year so far, and its fascinating to see so much that I learned about last year, pop up here. Looking forward to this upcoming networking stuff.
@Roanokekidstech4 жыл бұрын
I made a little ray casting demo in your game engine before and posted it on the discord. It was a fun process, and makes you think a different way. I can’t wait to check out this code.
@yosipshepard30654 жыл бұрын
You are breathtaking!) I'm just trying create my own udp server/client for fps, by using winsock, and there's your videos about networking is comings.)
@boris33204 жыл бұрын
As always, explanations are very clear. I may have already told you that thanks to your videos & olcGe I came back to programming after a loooong break :) It has become fun again ! Thank you.
@onesketchyguy60504 жыл бұрын
I love/hate how much you trivialized something I fought with for over a week. You're my hero
@3DSage4 жыл бұрын
This is great! Did you see my recent raycaster Game Boy Advance Demo!? I think you would like it. I made it run on the actual Game Boy Advance.
@wowLinh4 жыл бұрын
A-MA-ZING. Fantastic video as usual. Big thumbs up!
@spjewkes4 жыл бұрын
Another great video, David. It really shows off the power of the pixel game engine and what can be achieved with extensions. I really must dust off my old ray casting engine that I wrote (which was inspired by your earlier videos)!
@cheaterman494 жыл бұрын
I hope you will in the future make a video (or a series) about some of the internals, possibly the physics system or something? :-) great video and great extension!
@AJSquirrel534 жыл бұрын
Laughing so much at the creepy archers moving around. This is probably one of your finest creations!
@kettlestew4 жыл бұрын
Can't wait for your take on BSP
@ChupoCro4 жыл бұрын
Extraordinary presentation!
@stephenelliott70714 жыл бұрын
Ah, I know your time is limited this year, but always good to get a Javid video - and a Ray Casting one at that. A subject I find interesting, it's 3D but not really. A quirky anomaly.
@javidx94 жыл бұрын
Thanks Stephen! I find pseudo-3d really interesting, its like magic :D
@stephenelliott70714 жыл бұрын
I completely agree.
@diarmaidmac21494 жыл бұрын
10 seconds in...my God, you are an amazing programmer!
@gasparRaduB4 жыл бұрын
I was wondering how long it would take you to get to this point. People have been asking about the server side implementation of a MMO since you summited your entry for the game jam. I have to say, you moved quite fast and the code is very clear, as always. Nicely done. It's amazing you find the time for such things.
@cheaterman494 жыл бұрын
37:23 Hahaha, the delivery was fantastic :-)
@jsflood4 жыл бұрын
One word: Awesome! Thank you! :-D
@FrostGamingHype2 жыл бұрын
Me:making an graphics engine without any tours from scratch in c++ my family: javid:maks an game engine similarly my family:🤯🤯
@motbus34 жыл бұрын
Best programming channel ever. And I'm subscribed to all of them. Any possibility of gpu programming? Like a simulation with rendering?
@javidx94 жыл бұрын
Thanks motbus - the answer is maybe, the problem is doing something which the viewers can also do for themselves. Hardware 3D is certainly in the pipeline, just need to construct a vehicle that makes entertaining videos.
@motbus34 жыл бұрын
@@javidx9 great to know! Entertaining certainly your videos are! And I only can imagine how hard is to come up with this ideas! By gpu programming I also was thinking on gpgpu, like accelerating that mandelbrot set with SIMD. I haven't found yet a video good enough how to processing in gpu and then rendering in a decent way. If I find or do something useful I will share with you. Thanks for the great work Mr Barr
@ykyjohn4 жыл бұрын
resembles minecraft too Should be a skybox feature!
@joshinils4 жыл бұрын
I’d quite like to see more on multithreading. I just got a new cpu with 8 cores (ie 16 hyperthreaded cores) which I’d like to use. Same with my gpu, but that would be an openbl tutorial, right?
@tezza484 жыл бұрын
Lets get Fish in here adding some more light bounces and PBR materials.
@nacnud_4 жыл бұрын
Fun and games fella. Cheers.
@andrew_lim4 жыл бұрын
Your olc::rcw::Engine::Render() function is elegant. However I'm having trouble visualizing how you texture mapped the floor tiles using Mode 7. If you have time in your next video could you elaborate on it? Thanks.
@GTGTRIK2 жыл бұрын
Ah yes, a static collision resolution I can yoink for my raycast engine implementation! (I got stuck trying to figure out by how much to move the object back on collisions with tiles)
@brianmac82604 жыл бұрын
brilliant javid!
@Eviatarm4 жыл бұрын
Great video as always! I have a few ideas that can maybe catch your interest to make a video about :) I saw your circle collisions video, and was thinking how could you do the same thing but with rectangles, meaning calculating angular momentum, for the rotation. And was thinking about a sudoku generator and solver.
@javidx94 жыл бұрын
Thanks Cain, Collisions with rotating polygons is highly non-trivial. It's really interesting stuff though, but in isolation quite difficult to make a single video for - it may need to be series.
@Eviatarm4 жыл бұрын
@@javidx9 also there aren't many resources online about it. It's either buying a book that was originally designed for 3D physics simulations / video games. or start learning classical mechanics. I encountered a single article about it online by randygaul ( maybe you know it ) that explained it well but still hard to grasp. I would definitely look for a series if it's ever going to come :)
@a123-e6r2 жыл бұрын
Hey Javid! Your videos are the best! I have a question though, I seem to have a problem when I try to texture the walls with sprites. It gives me an error message on the olcPixelGameEngine header file. It says, "Exception thrown: read access violation. THIS was nullptr." What do I do? Thanks!
@avocadopeel75364 жыл бұрын
this is probably perfect for a wolfenstein clone
@GiboonCloudSmoker4 жыл бұрын
brilliant
@0ia3 жыл бұрын
This is really nice.
@lbproductions62154 жыл бұрын
Very cool!
@boyemarc-antoine70274 жыл бұрын
can u do a raytracing tuto pls :D and very thx for all ur works u helped me and my teammates a lot in our school with 3d code like rasterizer and raycast :) thx a lot and keep it up man
@javidx94 жыл бұрын
This is a very popular request, I probably will next year - this year is booked up with projects! :D
@boyemarc-antoine70274 жыл бұрын
@@javidx9 strenght ! and thx for the queek answer
@Ryan-rn3sq4 жыл бұрын
@@javidx9 You're making a networking video soon aren't you?
@RogueShadowTCN4 жыл бұрын
Cool video bro!
@javidx94 жыл бұрын
lol, cheers bro! :D
@Jkauppa4 жыл бұрын
one simple ray tracing (casting) engine, using ready tech, would be use normal raster to get the first z-map, then 360 degrees fish eye raster from each pixel, up to chosen bounces or a light source that consumes the inverse ray, should be done with any accelerated rasterization engine like opengl or directx
@Jkauppa4 жыл бұрын
assume the rasterization of each pixel is fast, because only z-map is generated, no lighting in itself, until the final "tree" is formed, from eye to a terminal light source
@Jkauppa4 жыл бұрын
if you want it to be hyper efficient, you can draw each model multiple times, for every new camera source pixel, for example using geometry shaders
@cheaterman494 жыл бұрын
32:15 YOU drew this? So the tablet isn't just for scribbling visual explanations on Note! Whoa, that's honestly impressive and looks like a lot of work!
@MichaelRichardson-bw5xh4 жыл бұрын
"It doesn't care...it doesn't care...it doesn't care" - He makes the honey badger of game engines.
@PauloConstantino1674 жыл бұрын
Love your work!
@tile-maker49624 жыл бұрын
Cool, the beginning of the LSD simulator.
@linuxnoodle86824 жыл бұрын
Nice!
@tedeusz833 жыл бұрын
Next step? Make the textured floor.. :) thats a bit challenging because depending On the approach it can hit the performance even on fast machines
@javidx93 жыл бұрын
Take a look at first few minutes of this video again!
@peter8814 жыл бұрын
Realy intrested on how to use the gpu amd and nvdie in cpp would love to see a video on it
@DFPercush4 жыл бұрын
There are a few options for general purpose computing on the gpu - CUDA is Nvidia specific, there's also OpenCL, but if you're working on a game or using the gpu for actual graphics on screen, you probably want to look at OpenGL compute shaders and GLSL (openGL Shading Language). You basically send a buffer of input data to the gpu, give OpenGL a bunch of pointers to define your variables and types in your structure and how many elements there are, call the shader, and read back the output buffer. Or you could pass that buffer directly to another shader. You could use Vulkan or DirectX too, either would be faster than OpenGL, but most indie developers don't really need that much power, Vulkan is terribly complicated, and DirectX is not cross platform. Hope that gives you something to search for at least. GL ;)
@bkucenski4 жыл бұрын
kzbin.info/www/bejne/laOToouin8yFb7M
@matthewexline65893 жыл бұрын
At 15:25 why did we choose such a bizarre field of view? Was that just to make a point that we could put any sort of crazy number we want in there?
@GamerSaga4 жыл бұрын
thanks for making this! am curious would you be willing to tutorial making multi levels and stairs with this as well or know of any good sources that teach that?
@cheaterman494 жыл бұрын
SelectSceneryPixel feels a bit like a software-driven fragment shader? It's pretty cool :-)
@undefined_cat4 жыл бұрын
Cool
@wjrasmussen6664 жыл бұрын
Amazing as usual. Is there any chance that in the future we will get the ability to make a 3d world? So you could walk over/under other areas that you can walk on? So you could build multilayered homes, towns, dungeons, worlds, etc.
@javidx94 жыл бұрын
All I'll say is possibly.... ;)
@jktech21173 жыл бұрын
its not a bad idea, it is possible since there is rayca raycasting engine... it is still in dev... but it got pretty nice 3d fetures, i cant wait to the release of rayca
@Xilefian4 жыл бұрын
Mistake at 0:26 Doom is not a ray-caster
@badjumpcuts65994 жыл бұрын
What is it then?
@Xilefian4 жыл бұрын
@@badjumpcuts6599 Doom style renderer. It projects the 2D vertices of each wall into 1D space + depth and uses their "height" and camera "height" combined with distance to stretch them on the screen. The walls are rendered near to far by crawling the BSP tree and clipping the lines against each other. Doom has more in common with modern raster graphics than it does with ray-casters.
@elimgarak35973 жыл бұрын
Correct, it uses binary space partition, not raycasting
@CcanCcaglar4 жыл бұрын
Hey Javid I really like your teaching style and your ideas! I wanted to ask- what uni course or MOOCs would you recommend that cover what you demonstrate in depth? How did you learn?
@javidx94 жыл бұрын
Thanks, I would recommend any engineering course that has a solid maths/physics combination. The programming side of it is the "easy" part, assembling your ideas into something tangible requires understanding/logic/planning and maths/physics subjects such as linear algebra, trigonometry, calculus, geometry, kinematics etc can prepare your mind in such a way to reduce a problem down into component parts, which can then be built back up into code. There are of course specific game development courses, but Ive no experience of them, and Im told by academic colleagues that they are not particularly wide reaching.
@CcanCcaglar4 жыл бұрын
@@javidx9 . Thanks for taking the time to answer this question, it really means a lot for my career trajectory. See you and the 'gang' on the discord sometime!
@Z_Z.t4 жыл бұрын
Why I have feeling, that this will turn out into powerful retro engine?
@javidx94 жыл бұрын
It could be a useful tool once it stabilizes a little. I think it has potential for porting, since it relies on very little other than a 2D vector type.
@GregoryTheGr8ster4 жыл бұрын
Evidently, people really love "PS1-Styled graphics", especially for indie horror games. That's the nice feature about retro: it never gets old, because it already is old.
@Z_Z.t4 жыл бұрын
@@GregoryTheGr8ster oldschool shooters and quests are also in this category
@lucaxtal4 жыл бұрын
Great Work!!! I Love how you implemented the RayCast and how flexible now is!!! Just a question, about this rows: // Calculate distance object is away from camera float fDistanceToObject = vObject.mag(); Shouldn't we subtract also the fRadius from the object vObject ? Sometimes it happens to me that the object diappears when it is near the wall. I thought this would be this: float fDistanceToObject = vObject.mag() - object->fRadius; I hope I understood well, if not, I'm sorry.
@jamdonut3 жыл бұрын
Im thinking of building a raycasted world and got a few ideas in mind of what I want to do... But I am wondering, do you know if jumping is possible with the same techniques in the video? Thanks!
@srglmr4 жыл бұрын
You channel is very helpful , thank you for that I have a question i don’t where to look for its answer , Where can i find the algorithms for audio format, to and from mp3 , i want to use it in C, i want to algorithm it self not libraries , so i can use it anywhere in any programing language
@javidx94 жыл бұрын
Thanks, the place to start for mp3 would be the mp3 official specification, which is a long and complex document that will define all you need to know to encode and decode mp3 files. Playing them back is platform specific as youll need to access the sound drivers of the OS you are targetting.
@srglmr4 жыл бұрын
javidx9 thank you, where can i find the mp3 official specification ? In Wikipedia? Or it has its own site ?
@iProgramInCpp4 жыл бұрын
Hello, Javid!
@javidx94 жыл бұрын
Hello!
@DeathAtYourDoorStep3 жыл бұрын
how did you make the different floors and inside/outside areas like in the beginning of the video. why didn’t you share how you did that too? :(
@javidx93 жыл бұрын
I did! It's no different to the walls! As the ray propagates, it will ask for samples which you supply, and it tells you which side of the cube it is sampling. If it's the top, return a sky colour, the bottom, some floor colour.
@hey29564 жыл бұрын
Hello. What is your favourite programming language?
@javidx94 жыл бұрын
C++
@antonioambrosio20644 жыл бұрын
Someone can link me the video where you speak about the raycast world tecnlogy??
@lysergik74764 жыл бұрын
@javidx9 Hi, I maybe ask a stupid question but how do you define the sprites offset ? I don't understand how you picked up your values. I got a sprite sheet that is 519 x 454, so each sprites got the same height as yours(64 pixel) however I tired to display the first sprite on the top left of the sheet, so I entered 0.0f as a first value and 64 as the second value but didn't got anything. I tried with other values quite randomly and never got any sprite of the sheet displayed by the program or even part of them. So how should I determined the values for the offset ?
@lysergik74764 жыл бұрын
Dont mind my question I just solved it ! It was 0;0f and 0;0f because it's the first sprites on the sheet ^^ I just had to read the definintion of offset online.
@cheaterman494 жыл бұрын
39:07 Well! I suppose if you sampled the texture appropriately on each wall you'd in fact get something akin to screen space reflections? :-)
@abdelrahmaneissa14634 жыл бұрын
Wow
@nolan4124 жыл бұрын
Doors & floor / ceiling portals
@visonred3 жыл бұрын
i finished adding the enemy aka the archer when ever i see it my fps goes down to 10 fps how can i fix this?
@duality4y4 жыл бұрын
did you know that you are awesome?
@beyondcatastrophe_4 жыл бұрын
I find it a bit strange to have the engine handle the objects, shouldn't the objects handle themselves? In my opinion it would have been better to have to make a new object-derived class for every object and have that handle sprites, collision, etc (passing the engine as an argument). To me this seems to take more advantage of object-oriented programming and would remove the need for the large amount of switch/case statements. Is there a reason why you decided to have it as-is?
@javidx94 жыл бұрын
Exactly why you have the choice! Derive from the Object class, disable the physics. Personally I'd rather have a "large" number (4 or 5) switch cases than 4 or 5 similar files of objects.
@beyondcatastrophe_4 жыл бұрын
@@javidx9 Ah, so your engine also asks the objects? Should've looked at the source... Thanks!
@darkengine5931 Жыл бұрын
@@beyondcatastrophe_ In my experience, and your mileage may vary, your codebase will generally be so much easier to maintain (especially against new and unanticipated design requirements) if you decouple your game logic from engine-specific concepts like sprites, audio, and physics. For example, take the D&D rulebook. It mentions everything related to the fundamental game rules: the data that all creatures have in common, the damage and other data fields of every single weapon, consumable, saving rolls, THAC0, spell effects, everything. Yet it doesn't mention any engine-specific concepts if implemented in a video game like audio, graphics, or collision detection. If you can design and implement the rulebook this way completely decoupled from your engine concepts, then you'll have a portable AD&D implementation which can be used to work for any type of engine. You can even do overhauls that would break the designs of the most abstract of abstract designs like porting from a 2D engine to a 3D one without having to rewrite any of this AD&D code. Decoupling tends to be so valuable in gamedev and real-time computer graphics since design requirements are changing all the time with new techniques and even brand new hardware capabilities, and so much so that I think it's often worth creating some leakier abstractions or even turning certain things into just data if that decouples them from the outside world, even from abstract interfaces.
@quickscope36434 жыл бұрын
epic
@FrostGamingHype2 жыл бұрын
make videos for code::blocks ide and with out olc it may help me to make my game engine because i have got all the 2D just looking forward to 3d it will be really helpful you can also install an darktheme for it
@cjdaylight34072 жыл бұрын
question : this is can give better perfomance than open gl
@darkengine5931 Жыл бұрын
It's substantially cheaper than full-blown rasterization with a 2D Z-Buffer and 3D world->screen projections and inputs. But you can implement it in OpenGL as well in a frag shader if you want and skip the cost of the full-blown rasterization pipeline. It's cheaper no matter what graphics API you use.
@cjdaylight3407 Жыл бұрын
@@darkengine5931 thanks for wonderfull reply
@DiamondWolfX4 жыл бұрын
Could you try implementing a Doom-style engine?
@GamerSaga4 жыл бұрын
any chance on a video on ai character shooting and attacking you?
@makiskapa82914 жыл бұрын
Even though it's a fascinating video to watch, it requires some programming experience. Can you do some tutorials for complete beginners?
@firstname43374 жыл бұрын
go and watch his older videos he said he's explains raytracing concepts in two previous videos he also explains some C++ concepts (like pointers) in older videos -- so go to his home channel and search for pointers but he isn't going to do a basic tutorial on how to program C++ and what "if" statements and "for loops" are that are plenty of channels that cover that -- do a youtube search for derek banas c++
@makiskapa82914 жыл бұрын
@@firstname4337 thank you for your advice kind sir!
@Jkauppa4 жыл бұрын
3d ray marching, distance quick traverse voxel matrix
@Jkauppa2 жыл бұрын
2d grid dda ray casting with 3d z-buffer (2d z-image), plot distance when you paint the vertical lines, simple doom or duke nukem 3d engine
@Jkauppa2 жыл бұрын
also direct 360 degree render image, 2d ray cast in 360 degrees with z-buffer, various 3d-positioned vertical lines engine
@Jkauppa2 жыл бұрын
most 3d raster "if logic" complications gone
@Jkauppa2 жыл бұрын
also most 3d engine overdraw rules complications gone
@Jkauppa2 жыл бұрын
just calculate the z-value (distance from the player point, in 3d) of the vertical drawn lines, and you are racing
@bilalakol19594 жыл бұрын
you use opengl?
@DM-qm5sc4 жыл бұрын
Skyrim NPC's!!!
@baze35414 жыл бұрын
after watching 99999 of your videos and other cpp i still dont understand what and why 0.5f or 0.0f means????
@javidx94 жыл бұрын
😂 its a number represented literally as 0.5 or 0.0. The f tells the compiler that the number is to be represented as a 32 bit floating point, as opposed to a 64 bit double.
@DFPercush4 жыл бұрын
^ What he said. But also, the reason you see this typed out a lot, is that the compiler tends to throw warnings when you implicitly down-cast a double (0.5) to an argument or variable of float type, due to loss of precision. Usually it's not a big deal, but nobody likes tons of warnings in their build. It's also common for certain functions to have two separate version for doubles and float, like sin()/cos() [doubles] vs sinf() and cosf().
@GoldBearanimationsYT4 жыл бұрын
I have a simple game idea u could make in a week dm if ur interested