C++26 introduces contracts, a standardized way to encode preconditions and postconditions directly in function signatures, replacing manual assertions. Contracts can be evaluated in different modes: ignore (no evaluation), observe (check and call handler), enforce (check and terminate), and quick enforce (check and terminate without handler). This feature helps catch bugs early by enforcing function contracts at compile time and runtime, making it harder to ignore important usage requirements. The contracts mechanism provides a cleaner alternative to traditional assert() functions by allowing developers to specify conditions as part of the function signature itself.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
FPS From Scratch (C++26 & OpenGL4.6) // Physics pt3
Added:welcome Harand Connor. Hello. Hello. Hello.
Hello.
What's this doing?
Right. Quacko.
Hello.
We shall continue to physics today. But first, a small side quest.
Hello.
It's It's super quick. In and out. 10 minutes at at best.
Mystic. Hello.
I just kind of software should be fun, right? And side quests are fun. I try to not let let myself get too carried away, but I got to indulge myself every now and then. It's fun. New C++ 26 feature.
Killer. Hello. Co. Hello.
I've also been busy off stream. I've been a been a busy boy. We'll go through that in a minute.
Nothing really too material like within the codebase, but I guess more infra side.
Betty, hello.
Apparently, I'm live. Got the notification two minutes later.
Absolutely brilliant.
Okay. Right. Where we at?
If I in this first off, what have I been doing off stream? I've been working on the build system. Okay.
I wanted to make some improvements. So, I've got Look at all these. Look at all these. Look at all these commits. So many commits. Um, uh, I feel like I'm missing a stream tag here. I'm pretty sure create rigid body integrate changes add service located. I'm pretty sure that was I'm going to tentatively tag that stream 40 already exist. Oh, I bet I rebased.
Yeah, put that back. Right.
Okay.
So I've changed the linker. So I now use LDD which is multi-threaded. I now use Ccash which is a way of caching build artifacts. So when you're when you constru when you get your translation unit and you hand it off to the compiler what I now do is I first check I hash that translation unit and check to see if I built it before and if I do I just bring the object file back. So this this massively reduces the compile times for like the third party dependencies because Jolt and as like never change.
Uh what [snorts] LDD specifically because it will link a Windows executable like a PD file and it's multi-threaded. So it's better than GCC's LD and I couldn't use mold because that doesn't support Windows binaries.
L I LD's util. You're right. It should be LLD. Yes, you're right. It should That's a typo. Never mind.
Sorry. I just put the same typo back.
No. Right. Um, yes, mold is the other one. You got gold, mold, LLD, and LD.
Um, and this is the only one that I could find that has multi-threading and produces Windows binaries. Maybe there's others. Maybe I'm wrong. Maybe I'm making an absolute hash this. Maybe I don't know what I'm doing, but that's where I'm at. So, Cash is cool because this will massively reduce like re uh compilation time, especially have to re build something.
Uh, minor build improvements. Sure. And then and then what I basically did was I spent some time vendoring effect what um the third party dependencies. So now if we go to our root cmake file there's now no fetch content anymore. But what we do have is all of them checked out at the re at the exact commit I want in third party and these are now checked in as source code into the repo.
So this basically means that configuring is now almost instant because we don't have to I don't remember before what the issue was when we did a clean build we had to configure it. We had to check out everything which was also an absolute massive ball on the CI system. So I took the view to check them in a source.
I'm not a big fan of um subm modules. I really like the idea that the repo is the golden the ground truth the gold standard whatever you want to call it.
like you check out the repo and it has everything in it to build. The only subm module I use is one for a private repo for the assets that I do not have the license to redistribute.
So that is I guess that is like a legitimate use of subm modules. Other than that, I'm not a massive fan. I would rather have a clean checkout and everything build. So uh uh mold definitely doesn't support P because I looked at using that first. Um I don't know about gold. Uh so I did some I did some vendoring which was fun.
Um uh I [laughter] I I toyed with pre-ompiled headers. I then removed pre- compiled headers because I found ccash gave me basically everything the speed up I wanted without having to change too much stuff. Uh yeah so storage is so annoying because I used to be able to say storage is cheap and you can just buy a bigger hard drive. in 2026. That is not necessarily as true anymore. But like just just get a bigger hard drive. I have like I got loads of I got I got gigabytes of free space.
Gold. I'm I'm not big on the link scene.
I don't really know what the latest and greatest is. All I know all I know is that the LL LLVM1 is multi-threaded is probably better than the GCC standard LD and produces P files. Um, and then I added, if you remember, we did the service locator. I've like committed to that now and I've moved texture manager, mesh manager, thread pool, and awaitable all over to that. So, let me let me try and demonstrate to this. If we do make clean, right? So, make config is now pretty much instant like that. That's it now. Like it's it's configured. Uh, and then if we do make build, uh, see we're already at like three the um, translation unit 335, right? 334. So the the first 300 odd translation units were just it just pulled out the cache and just built instantly. So look, it built it already knew it already pulled Jolt out of the cache. It already pulled as out of the cache. All that stuff that takes ages to build is no longer there.
And most of the time now is actually linking. And I've got some thoughts on how to reduce the linking time, but not enough to care about it. Um, I gave up with pre-ompiled headers because I found CC ccash gave me a big enough build improvement without then having to worry about the I guess the potential limitations of pre-ompiled headers. I know CMake has kind of first class support for it and will automatically insert the header file.
And I know GCC has a warning you can set if it cuz GC is really strict on it. But like do you know I mean this already feels like lots of plates spinning whereas like Ccash gave me like a pretty big win. Uh the only annoying thing now is that uh I still have to build the resources and this does take time and this is because of the high IO limit between WSL and Wind32. I could probably off I could probably shift this off and run this natively on Windows and then maybe copy the files back. I don't know.
I'm not sure. I have some thoughts on how to speed this up, but for the amount of times we run it, which is almost never, I'm happy for this to be slow.
But iterative building should now be much quicker.
Um, so questions.
So that's why I abandoned fetch content because I want everything all in the repo all in one. And uh it works it I found did I find fetch content a bit weird with Ccash? I couldn't remember if Ccash worked well with fetch content, but I wanted to Oh, no, no, sorry, it wasn't that. It was the make config time. Every time I did a clean build, I'd have to recheck out all the repos, which is a non-trivial amount of time. So, this is like pucker now. This is this is fast.
Um, have I tried Zigg? Uh, nope.
How do people choose a project language?
There's loads of choices and you have basically it comes down to it comes down to kind of three points, right? Right tool for the right job. So, does the language you want meet give you the requirements that you need to meet your end goal, right? Two, do you have do you have existing knowledge of in that language to hit your goal quicker? or three, is it a language you want to learn? Like with if you ask yourself those three questions, you'll probably find that there's a there's a there's an answer in there for you. But at some point, you just need to pick one and get going.
Like just you just got you just got to start writing code. You just got to start start typing on the keyboard.
Uh it's IO limited because I run the the issue is and this is probably the biggest change I could make is that resource packer the executable is a PE file right because it goes through the same cross compilation as the main as the main game. So I have to when I launch the resource packer in WSL that gets launched as a native Windows process which then has to write that back to the WSL file store which basically goes through a network drive.
Excuse me. So that's why so memory mapping doesn't really kind of work in that case. What I really need to do is change my compilation process to build that as a native Linux executable and run that locally and then I can use mapped files uh and it'll be much faster. But like so doesn't sync use clang right or L lVM right uh how to start you just I mean like there is no other advice than like just start like write hello world build it run it like generally like congratulate yourself because you've taken the first step and then just like start writing more code. This theory will only take you so far. You just you just you just got to you just got to pull the plaster off and start typing code.
I don't want it to be challenging like I want I want to produce something right.
I want the I want the right amount of challenge that there's interesting technical things to talk about and you know a narrative that I can kind of weave through the uh live stream series but I also want to produce something at the end and like an engine will just I'll just not produce anything at the end because I'll be forever writing an engine so there's always a trade-off right um also like I'm kind of stuck with GCC because it has the best Super 26 support. Speaking of, what a great segue. I'm glad you glad you brought it up.
Um, I'm going to when I don't think GCC has SIMD yet, but when it does, I will be using it because uh, if you look at my vector 3 class, it is all this needs tidying up a little bit. It's all constra and the sim C++ 26 SIMD is also constra which means I can then have a constra sim vector class which I don't know how unique that is but I think be pretty cool. So yes, I am planning on using it when it hits GCC. I don't actually know if it supports it yet. I've not looked at it. I've got a million and one other things to do first.
So yeah, I mean like I'm already using trunk, but like using like experimental headers within that I feel like maybe a step too far for my own sanity and stability, but we'll see. Okay. Right.
Anyway, uh service locator, right? I I basically want to remove expect right from my code. Expect is it's old news. expect is basically assert right as a function which takes some other nice bits around formatting and stuff but effectively checks the predicate it prints out the stack trace if it fails and then it like kills itself okay yeah mate it's in 26 it's been sandized that's indeed um this is basically an assert and an assert is affect effectively for testing preconditions or potentially post conditions, right? And I've talked about this at length before, but I'll quickly summarize my points in that if you have a narrow contract as in like your function is not well defined for all inputs, you should assert on those preconditions where you can as a courtesy to the caller, right? Because if you if your function says like I cannot be called do not set the services so you shouldn't set services if the services is already set, right?
that is a precondition of this function, right? Technically, that should be in a comment, but like for you to call that is your bug, right? I've told you don't call this more than once. So, if you call it more than once, that's 100% like your fault. But as a courtesy, I will check that in a debug build, right?
Because that will help you. And by you, I also mean kind of like me on the other side of this. Um, but so what that's effectually a precondition, right? This is a thing that must hold true for this function to be well defined. Okay. Now, you could make the contract wide in which case I could throw if that's not said, right?
But then like this is the whole trade-off between like um narrow contracts and wide contracts. Not everything can be a wide contract. Not everything can be well defined. It's very hard to test blah blah blah blah. I often prefer narrow contracts especially for internal stuff because the the code is simpler. also like not all not all pre like it's not possible to make everything like well defined for every single input. Anyway, I'm kind of getting a bit more into the theory of it. I want this to be a narrow contract. I want you to only call this once. Please only call once, right?
Um and we could there's a whole other way there's loads of ways of doing this but this is the way I've chose to do it.
It's basically say like assert that this has not been called once, right? which means in a release build get stripped out blah blah blah blah. The the point I am laboriously trying to get to is that for this to be effectively good like software engineering somewhere I should be here like you know only call once right but like that's a comment and I I love comments I've not commented this codebase very well which is very against my normal normal style but encodifying preconditions in comments is a little bit tricky because sometimes they don't get updated sometimes they get removed blah blah blah blah C++ 26 I would say solved this right with contracts. I can now as part of the function signature. Okay, I can I can codify the preconditions and the postcond conditions. So I can say uh pre imple gervices doesn't equal n pointer, right?
Uh I don't think format's going to like that.
Give me a second.
Okay.
And this now, not only is this codified as part of the signature, like it's very hard to ignore this if I'm looking at this. Okay. The uh this is constant evaluated. I there was a whole I was there for the I was there for part of the discussion this with WG21 and this this is what they call the constipation and it doesn't have to be constexer it can have side effects but you shouldn't rely on it um so no so you can do stuff like this because it can't be const exper evaluated because you might rely on checking mutable state Right? It's not just necessarily on the input arguments or it could be on the input arguments but the input argument isn't but um a variable can't be constra so like no but there's there's a little bit of nuance there.
You can also do post uh sorry that's wrong isn't it? Should be that should be equals null pointer and should be doesn't equal null pointer.
Ah what a great question. What happens if this is violated? Well, you you choose, right? Let me let me get let me let me get up the code. Uh C++ 26 contracts.
You as a programmer decide the eval the evaluating contract assertion mode. Okay.
So you can have one of four modes. You can have ignore, observe, enforce, and quick and force. Ignore means it does absolutely nothing. Um it and I believe it's not even guaranteed to evaluate it.
No. So I believe it doesn't even evaluate it, which is why you shouldn't rely on it having a side effect. So this is your release build, right? Just basically strip them out like as if they were not there. like they're codified in source code but you they don't get compiled in. Observe means it checks it and if it fails we'll call a handler. We'll go on to that in a second. Enforce means it checks it checks it calls your handler and then terminates. And quick enforce means it checks it doesn't call your handler and then terminates. Right? which sounds a little bit strange, but this is basically the four possible combinations of things you would probably want, right? So, I would argue so for us in a um in a debug mode, I would say in force, right? I want you to call my handler TBC.
Um but then I want you to die. Like if if there's a contract violation, bad things have happened and we should stop.
Okay. in a you could in a release build put observe on so you log the bad things but don't die that's a potential option but I think it enforces what you want right so then basically you have to just expose this function you have to somewhere in your code define this [snorts] just has to be compiled in and the linker will find it the linker will look for this function and that is what gets called on a contract violation so let's let's let's do e uh source. I'm going to try and show this now because I've not not tested this yet. So, because this could all be a total disaster. Let's just do core. Uh is it core or is it a util? I say it's probably core cuz you're going to want it there, right? So, let's do uh handle contract.
Don't like that. uh contract violation handlercp. Okay. Right. So include uh contracts. Don't want it in a name space. I you doesn't have to be extern but you you don't want it in a name space. It has to be the plain function.
So I'm just going to copy this.
Uh so then hashincclude uh u utils log. So what I'm going to do is I'm going to say when this happens right I will log it and then obviously we could we could convert this to an exception but I think we use the mechan the mechanis the mechanisms already provided to us and die.
Um, so I'm going to do uh log sorry UFPS log error. Uh, and then we get if I can find this class cuz it's not always obvious.
Where's the contract? Right. So, this contract violation type gives us a it tells you the uh kind whether it was like a pre pre or post. It gives you the semantic. Uh so like I guess in this case it' only be probably observe or enforce whether it's terminating the detection but but basically the main thing you get is the comments which is what I want. So that would be the text that you put in the pre or post. Okay.
So that's that's so we can print that out and then you get the location. I'm not going to use this. I'm going to print a full stack trace but you can get the you get stood source location from this as well if you want.
Uh, I believe it is thread safe. There is no mention of thread safety with Is it thread safe? Well, great question.
Uh, I believe so, but I'd have to check.
I'd have to find the paper. P2900, I think.
Very controversial paper. Not everyone Not everyone's a fan of this. So, contract. So contract violation I'm going to do CV dot uh comment uh and then uh I'm going to do what we going to do hash include that trace I'm going to do stood stack trace current. I might need to put some numbers in there to make this a bit cleaner, but basically that's how it's going to work, right? So, this will just call that Yeah, I don't It's It's a great question that I I don't actually know. What does it say about threads? It doesn't say anything about threads on CP. I'd have to go back and read the paper. Um, but also like I guess I guess your point is it needs to be fast, but if you're going to die anyway, then it doesn't need to be fast.
But I guess that only depends on what mode you do. So the implementation defined part of this is how you tell the uh compiler which mode to do. And that is via um compiler flags. So there's no way in source code to say what mode you're going to be in because it needs to know kind of a priority to it running what it's going to do. So the implementation defined way is your compiler has to expose some flag to do this.
Uh so let's just uh call Cake uh Cake list. Do I not have core? Must have a core source core.
Everything in core so far must be header only. That's really fascinating that uh fine then let's do copy source graphics to source core source core and what did I call it? I called it like contract violation. Contracted violation handler. Okay. Uh let's just check this builds with this in it.
So I think this is one of the big big sticking points is what do you do if your library exposes this already? I suspect it is a linker error, but I'm not entirely sure on that. That's a really good question.
Uh, is that link error?
Oh, it's because I've not included this, have I? Sorry. cm make source.
So, I will be now that we've got this wired in, I will be using this a lot more because I think it's really good and I want to get a bit of I want to put a bit of I want to put some hours in with it to kind of get the feel for it.
Uh, no pro. I really I need to change this. Uh, not this bit.
For some reason, it wants previous declarations and it's really really annoying.
Have I got to change the flags first?
Now you're going to see where I thought this was going to be a great idea to do and then didn't really test any of it before. The only note I made off stream was what GCC flag I need to pass into it. So target uh and I want dash f contract eval evaluation semantic semantics equals end force. That's what GC decided to do.
Uh oh. See, semantic. There's only one of them.
Uh, I might need to include the experimental C++ lib as well. I'd have to check.
Yeah, this is missing something. I think I might also need uh I've got this is saying it's expecting it to be a const rep, which I wonder if they've changed that.
Anyway, this doesn't really get us any closer to uh uh graphics, but I thought it would be fun.
That's better. Oo, interesting. CPF must be out of date.
Peru, 6 months. Crazy. Thanks very much.
Yeah, great. Glad you're here. Glad you're having fun. Um, okay. So, let's now I mean I guess let's just check this runs, right?
Okay. So, that's fine. So, what we can do now is let's do main. Let's do set uh services. So if we call this twice now, which is obviously Oh, Clang is going to really not like calling functions with the post conditions on, but well, he can suck it.
You cannot let Clang get in your way.
So hopefully this will go bang.
Boom. There you go. Contract violation handler hit. And then you even get the you get the you get the text, right? And then I don't want this.
I don't want this. And I don't want this. What I want is this. I think I need to skip because this is just machinery, right?
One, two, three.
because I want the stack trace to point the first line should be where the contract violation uh occurred. There's also a new assert function called contract assert which we can use instead of assert which will trigger the same mechanism and automatic and means we can automatically toggle what we want. Uh there you go 384 that's what we want.
So we know what failed and then we can get the line on it. So if we go back to main 384 bish bash bash remove that.
I think I want it from the calls. Oh, actually a good point. Should it be from the Yeah, I might want two actually.
Uh because that will give it from the actual handler itself.
Yeah. Okay. I think that's right. But anyway, that's that's contract super contracts in a nutshell. Pre and post.
We're going to be using those a lot more. Oh god, hate fever at the moment.
My face is going to explode. I do apologize.
Uh, right. Let me just add contract. This this physics branch is an awful lot of um like drive by refactoring. Okay.
Um there's a question. I'll get to your question in a second. I'm just trying to think what we're going to do. Right. So, let me just run quick reminder where we're at.
Uh so we've got a little level. We've got some co- routines that handle like repeating events. So that's like the flickering light and the pulsing red light up here. We've also got uh in the logs we should see that there is a invisible physics object falling due to gravity. That's all wired in. We just can't see it. So our next job is to write a debug renderer for the physics engine so we can see those and then we can start adding start extending this UI to be able to build effectively static colliders for the geometry. Then we can add a character controller and then we're done and we can show it.
Uh right sorry there's uh I'm going to backlog of points in one second. Ignore the big open gap here. I'll fill up with something.
Okay. Right. So, I've done I've done the re I did I did a bit of a refactor as a debug render already off stream. We talked about that uh stream or two ago. Anyway, um uh I'm pretty much a perfectionist and I found myself restarting projects time and time again with no real progression.
For instance, I've been restarting a project. I've been working on since December 25 because I find different ways of doing something or I feel like I'm getting too lost in my code. How do you find the perseverance to perseverance to continue through? I find it a massive mind block and I struggle with it's just it's definitely like a um it's a mental kind of it's a change of mentality is what I'm trying to say. You have to accept that code is not perfect and never will be perfect. And the and you just I I'm a big fan of like just doing the next thing that makes progress. Even if it's not great, even if it's a bit hacky, even if it feels gross, you have to make that relentless march towards the end. There's loads of examples. We've done this on stream where I'm like, you know, there's so much better ways we could do this, but like it could take five streams, so let's just do this now and we'll come back to it later. Um, uh, I think someone suggested streaming.
Like that's quite a big jump to [laughter] to do, but I personally I find streaming has helped me keep on that relentless march of progress because I have to show up like it's twice a week. I have to show up. I have to make progress. I have to also have to kind of explain and justify what I'm doing and try and be entertaining and engaging and all that gubbins. But like twice a week, two two to three hours a week, two to three hours each time, like I have to make some progress. And I allow myself a few side quests, but I find that really does [snorts] help me kind of keep the bigger picture in mind.
But here we are. Told you 10 minutes. 10 minutes.
>> [snorts] >> Uh do I prefer templating or inheritance to change behavior based on different things? It in I'm open to any and all paradigms. Uh we use both in this. I've got some small inheritance change for some things. I've got templated code for the other. It's kind of I'll take a view again kind of relates back to the previous point in a certain sense like given given that fork in the road where I need to make that choice I will look at all the all the information I have in front of me what gets me to the next step quickest and also what is fun so normally templates um and then pick one and go with it and if it's wrong [ __ ] it it's wrong we go back and we fix it later Um, it's just you just just every decision has to be in pursuit of the relentless march of progress, right? And you just have to accept that sometimes it's not going to be great.
Anyway, right, let's do physics rendering because I have I have somewhere.
>> [snorts] >> So from the previous project, we wrote a debug renderer which is actually now a terrible class name because we have a debug renderer which means something else. So this will be the debug physics renderer. Um, but basically you expose a bunch of methods and then we hoover up Jolt will feed us lines like individual lines that we need to render and we'll hoover them all up and then we will yield them up into the uh the machinery that already renders debug lines because uh not that not that um Uh we already Oh, you can't see it there. Uh where's another light? Uh this one in here. We already have a debug a line renderer, right? Oh, in fact, actually, if we click any of these, we get uh lines for the AABS of all the sub meshes. So, we already have machinery for rendering lines. It's just a case of just like feeding those lines into it.
Enough gas in more CPPing.
All right. So, let's do e source physics.
I just call it like jolt.
Do I want to call it jolt debug? No, let's call it physics debug renderer.h.
Okay. [snorts] Hash pragma once name space.
Uh, and now we're off to the races. So, let's hash include our physics jolt, right? Uh, which unfortunately is just I'm not a big Jesus Christ. I'm not a big fan of like coalescing all of your headers in one file and then just including that. I'm a big fan of only include what you use. But something something job doesn't play very well with the latest GCC. So, we have to massage the headers a little bit to do what we want to do.
There's something hear some drama going on. I'm out to this for a minute.
Uh yeah, mate. Oh, I'm we're reflecting up the up the woo. Uh all of our all of our YAML serializing all uses uh reflection. Uh so we can just hand it any class and it automatically serialize it to yl which is really nice. So hash include jolt uh renderer debug I don't know what a debug renderer playback and recorder are but sure.
Uh, so I have one of those and then phys. Okay, fine. So, let's do class physics debug renderer public jph debug renderer simple. So this is Jolt.
Basically Jolt is quite hierarchal which is fine. I'm not opposed to that as a as a as a design choice or paradigm. Um and it has an interface for debug render.
Simple. You create one of those. You then shove it into your debug renderer and it would call back to you. Uh I don't know why Nightbot keeps falling over. Like I literally have nothing to do with it. Oh, it's back.
Uh, so we're going to want a auto draw line.
Going to copy these because it's just a lot of typing.
All right.
Uh, sorry.
Okay. Right. So, this is one of them.
Uh, and then we have auto draw triangle override. Uh, sorry, this is I'm just I'm just going to declare these, not define them. these in a these in a good old fashioned CPP file.
Uh and then auto void override. Okay, so this this is the interface. So whenever whenever Jolt thinks it should draw a line, a triangle or some sort of 3D text which we don't really use, it will call these functions.
Uh, [sighs] and then I'm going to want to have a hash include uh I think I've got a graphics line data include vector. Okay.
Uh, and then I'm going to want some sort of auto yield lines which will give you a stood vector of line data.
Uh, so yield what I mean by yield is that so we'll have a just a vector of line data lines. So this will continuously get called during the physics simulation right and fill this up. Then once the physics physics simulation step is done uh we will render the scene and then our debug render will get called and then that will be like pull all these lines out.
So yield so yield here will basically say return me all the line data and reset internally back to like no lines.
So on the next frame we start filling it again. That's what I mean by kind of yield as in like rather than just return a copy like literally give me all the data.
Um I think that would be fine. And then uh I think that's basically it [laughter] because of our kind of macro architecture. Whilst the physics system is multi-threaded it does like scatter gather. So we'll do physics simulation, use load threads, come back together, and then like renderer, maybe use some threads, come back together, update the events, use some threads, come back together. So by the time we hit the debug renderer, all the physics threads should have like like calm the [ __ ] down, right? They shouldn't be they shouldn't be firing. So I I'm pretty sure I'm I'm willing to take a gamble on the fact that this does not need to be thread safe because of the way we're going to call it.
But we will see.
Okay, I need some implementation for this. So source physics that uh KV why am I in physics layer? What's going confused?
Okay.
Physic uh BS source physics debug grinder.
What is source physics physics debug grp? Right. Okay. Sorry, my bad. Right. Include again. Don't really know what I'm doing.
Making up as I go along.
What we call this class the physics debug renderer.
Right. That was a lot of apologies that rando typing. Okay.
Hey Okay. Right. Calm down. Calm down. No one panic. We're there.
It's not that I would suggest you were panicing at all. Maybe I was the one who's panicking. Okay. So, then we need to start. What did I do last time when I did this?
Uh, what does my line data look like when it's at home? So, it's a position and a color. So I want to do lines dot push back to native from to native color because I think you basically push points like Uh uh.
So then we go to jolt.
We realize we've not done all of this.
Uh and then we do to native color and this becomes our own color. And then we do.
Oh, I like how there's a there's getters for the vector, but for the color, you can just just raw raw public values.
Sure.
At least we're consistent.
Oh, the UNATs. Oh, of course they are.
I spelled color correctly every single time.
Apart from that, I spelled it wrong there. I'll give you I will give you there. That is incorrectly spelled there.
Um, okay. So, that's going to be 0 to 255. So let's do con xra auto convert equals the say what was unat v return uh it's going to be stat uh actually no what am I doing can I not just do over 255.90f won't that give will that give me the integer promotion sorry the float promotion I think it will that implicitly convert the whole thing to a float and then divide it yeah thanks good I'm trying to do as much from scratch as possible so I'm trying to not I mean clearly I'm using jolt here but like uh That's good to know and I'll look it up. Thank you very much. Okay. Right. So now if we return from whence we came. Not there.
Absolutely not there.
Uh hate everything. Right.
Why is it Why is it not pushing? Oh, hang on. That cuz that would have to be in place or we construct it. makes no difference in this case whether you perfectly forward the individual components or just push back with a PR value makes no difference. Uh so this is then going to be I think I then basically say draw line between V1 V2 with color V1 V3 and V2 V3. Right? That should give me a triangle. Uh, and then this is going to basically I'm going to leave this unimplemented because I do not care.
Oh, I see what you mean. Okay, cool.
Thank you. Uh, okay. And then what I'm going to do is I'm going to do auto copy equals lines uh equals sorry stood move lines return copy.
So that will uh actually let me let me let me let me think about that. Do I want that? I think actually what I technically want because moving leaves it in a valid but unknown state. I should probably be explicit and do auto uh copy equals uh stood vector line data. All right. And then I should do stood ranges swap copy lines. That's better. Then return the copy.
This should work, right? So we construct an empty vector and then we swap it, which is which is super fast by the way because it's only going to change implementation defined obviously, but effectively it's only going to swap three pointers.
Um, and then we'll get the old one back.
We might even get an RVO as well potentially. So, this could be like super quick.
I think that's about what I want. Right.
Okay. Right. So, how do I wire this in?
How does this work? How did I do this before? Help. Uh, physical system.
Right. This is my miserable physics system from last time. The new one is obviously so much better because I've been rewriting it. Uh the debug. So I had a debug renderer object. Okay. Mhm.
What did I do with that? I called clear.
I'm getting rid of the idea of manually clearing it because it should be cleared from the point that we yield it. So you have to that's it. You basically you basically say to to Jolt, draw this thing using this renderer. So please draw all the bodies. So rigid bodies presumably maybe soft bodies, I don't know. Um and then like we have to do something special for the character controller which we've not done yet. So we can draw the bodies and then we just have to expose some way of this. So what I I think this needs to be optional, right?
So if we go physics system.h let's do hash include physiques debug renderer and let's do ash include optional.
Uh and what we're going to do is physics system is going to take a stood optional physics uh physics debug renderer.
Uh the physics can have variable FPS. At the moment, I've just locked it because I'm using VSYNC anyway. It just make it easier, but that's a future expansion to have to decouple the uh time steps, right? So, we want to the physics to run at a lock step, but the graphics to run, I don't know, at least as fast as your frame rate, right? So, potentially faster. Uh and then we're going to have a stood optional. Uh Physics physics debugger renderer renderer.
Okay. And then this is also going to have then a auto renderer optional physics physics debug renderer ref. Okay, cuz I don't want to return the whole debug render. I want I want a reference to it whether it's there or not. Right.
I should be able to query it whether it's there or not.
Uh so this should equal stud null opt.
Okay. So you can give it a debug render if you want. It's entirely up to you. We could even technically actually have this as just a boolean of whether you have one or not and then make it entirely internal. But there's no reason there's no reason to construct this externally. Actually, I think I prefer that. Take it back.
All fo render equals I know true probably false could be true should be an enum really should be an enum really because passing rando true fine fine fine Yeah.
Heat.
I went on I went on quite a personal journey then um the only pro the reason you should avoid like passing arguments to functions like if you're just looking at the call site you want some semantic you want to be able to glean some semantics from that right so if I just pass in like true or false that could literally mean anything Um whereas if I pass in this at least it's explicit what's going on.
Could template could no.
Could I template it? No, I could template it. I won't template it, but I could template it. Uh okay.
And then this physics system.
[laughter] Uh, okay. So, at the bottom here, we're then going to have the uh debug renderer is going to be uh is there a way I can do this?
Uh, I basically want debug render mode equals debug render mode on uh debug.
Sorry.
Let's just do physics droer render render renderer the not is it going to let me do that?
I got a feel I'm going have to do something like make optional.
There you go.
Oh, is it because it just cuz I spelled that wrong? Oh, it's staying there now.
Why is it not like that?
Uh, okay. Fine. Is that why it's not is I recognize why claim these haven't fit to be fair.
I did have this before.
I do so hate macros.
Well, no. I don't know if I want it in the jolt header, right? I probably want it localized here.
So, should be included. Oh, no. It's going to have to be in the jolt header, isn't it? Yeah, you're right.
Cuz I don't know the order these all included in. Oh, I hate everything.
This should be control. This should be controlled via a command line argument.
But for now, we'll just slap that in.
I don't know why it doesn't like my make optional. What have I done? Make optional physics render.
Is it does it not have C? It probably doesn't have CAD, does it? Uh, because it's not constructor. Okay, fine. So, that's going to be Is it just cuz I had a typo? Can I just go back to doing Can I just get the type inference?
God damn it.
Got to hate everything. Come on, S. Get your act together.
Yeah, sign. Oh, no. It's cuz I'm not cuz I'm not building it. It's fine. Link error. Solve that later. That's the link's problem. Um, so somewhere in update I want basically if uh I don't need that. If if debug renderer lost my code now I lost where I was. God hate everything.
Uh some uh I want static con auto settings equals jph body manager.
Assume I don't actually know what's in here. I assume this allows me to control like what gets rendered and stuff. Draw support functions. Draw support direction support. Yeah. Okay. Fine. So if I want to control what gets rendered, I can use this. So when something doesn't get rendered, and I'm convinced it should be, it's going to be this um physics system draw bodies settings.
Uh hang on. I want to get the I'm not sure if the precedence will will support me with this. Nice. The old amperand star Yeah, I've done a bit of refactoring of him, but not not loads. I did it off stream anyway, so you didn't actually miss anything. It was just me over a few evenings with a few beers.
Okay. Right. So now, uh, let me just wire in this before I forget. Physics. So, we've now got physics debug renderer.
Check that blends.
Uh, no, I didn't refactor that with the oracle. Actually, I tried to use the oracle to refactor all of the managers into the locator and it made such a pig zero of it. I threw it all the way and did it manually.
Undefined symbol.
I feel like I can't find my debug renderer, you know, which must be to do with that include can't find debug.
Uh yeah, there's probably a virtual destructor there, right? But then it also can't find the vable for this. It also cannot find these functions.
I don't think we do. This is basically this is definitely a Jolt thing though, right? It's in the GPH name space something something cached.
This is the only issue now with like we the the Cash is great, but you're forever second guessing yourself about whether it's something's been cached. It does seem like a missing header.
Uh I got so like this as well. Is there something fancy in here? So the so if I haven't got that then this will fail. So it's definitely in there, right? And then it does have the virtual. So where is the debug renderer? Why is that not being built?
Quick look at the cmake file. Did I Is there some voodoo I had to do to get this to work?
Uh I just No.
Nano, thank you for being here so long.
Yeah, I just looking through the old code just to see what I did. I definitely included that.
Was there something else I had to do?
Because the physics system is probably what's going to include first.
Oh no, cuz I pushed it all off to the CP file, didn't I? Curiouser and curisser.
Um, have I Oh, hang on. Have I got like some rando jolt include again in a place I don't expect it to a jolt there.
Physics debug renderer.
No.
I'm cross compiling with GCCW.
How annoying. What am I What am I missing? So, it's definitely You can see here it's like it's in physics. So in physics system CPP and then physics debug renderer then main. It's like I can't find it.
Why just check the C didn't check. I said I was going to set check the cate file and then I absolutely did not. So there's no special in the last project. There was nothing special about Jolt in the CMake.
And this seems to be I could do a clean build, but it just is just a bit of a pain. I'm going to have to do it just to convince myself. So now you'll see how long a full takes.
Yeah, Nightbot is is is really like I'm going have to have a pip, I think.
this now though.
I think this project is going to go on for longer than a year, seeing as we are like within sight of the halfway mark. I haven't even got physics working yet, but we'll see. I only got for an FPS. I still only have a gun. [laughter] And this this is the 41st stream.
There's no pew pew yet.
I was going to say I really hope that wouldn't work cuz then I'll be forever worrying about uh Cash. I'm going to go to I guess the Jolt source and see if anyone else has had this issue.
Yeah, it's an awful lot of dependencies which is why Ccash is made such a big difference because they don't really change issues.
Show me undefined symbol.
Show me undefined symbol.
Nothing in open. Better just check everything in case it's been solved.
Nothing. Okay, fine. Let's just search for undefined symbol.
There's no way that returns nothing.
CL doesn't support contracts or reflection.
It doesn't have doesn't have great C++ basic support yet.
[sighs] So where does we're going to have to go through a deep dive through the sort the job code, right? Because basically as we s let's let's let's let's piece this together, right? Let's let's The the advantage of rendering of of rendering is that I can now super easy go through the source code. Right? So this is a debug renderer.
He says [ __ ] sake that would work. Uh debug renderer and then this has a virtual debug. So I should be able to now g for all code, right? So let's So it's in So it's here, right? So in de So why is debug renderer.cpp not being compiled as far as I can tell. Let's do debug renderer.cpp.
So let's in the debug render [clears throat] hash including a cpp file. My favorite hack to still compile inside the test framework when it was compiled without.
So I did ah interesting one of the other things I did do was I did tweak the jolt um build flags to not build the tests and stuff. So this seems like there's a bug or something they had there, but this is in the test framework anyway, so this shouldn't matter. So wait a minute, wait a minute wait. This is test framework so it shouldn't matter.
So why is why is there nothing else including this? Why is this not in any of the CMake files?
you know, right? Okay, fine. Let's let's do do E third part Q E third party jolt physics. Oh, they put in build and then [ __ ] sake list.
So, where where do they add the source files here?
Don't care. Don't care. Don't care.
Actually, let's just Is there anything in here about debug render?
I know render debug debug rendering distriution will override the setting enable reduc setting to enable the debug grer in all builds. I don't want it in all builds. I just want it in my build now. Maybe that's something we need to revisit.
That's the only thing in there that mentions that.
Uh yeah, we could try building the tests. Let's go to third.
So now I have third party cmake which controls everything, right? So somewhere in here is Oh, I don't Oh, here you go.
H That is a That is definitely a What?
Um, an Oracle inserted comment there.
Interesting because I said to the Oracle, can you look through all the Jolt flags and find any that I should disable to increase compile time? And it's like, yeah, mate, you want all these. Let's just get rid of all this [ __ ] I might have to blap the cash again.
Did I have What do I have on Sim 7?
Oh, interesting.
Yeah, I bet that's it.
Uh, make config.
Don't use arms, kids.
I'll lead you up the garden path.
That's outrageous. That That's what I get. That's what I get. Trying to be clever. I can speed up the build time a little bit without having to think too hard about it. No.
I feel obviously obviously different error now can't build cannot declare build physics system simple broadphase layer didn't we have this four.
Didn't we have this before?
Yeah, we had this before. It's ch look cannot declare face type the fing virtual functions are pure within oh there's some other debug [ __ ] isn't there hang on yes yes give me a second one of these is no. Hang on. There's Hang on. Hang on.
Here we go. Here we go. Here we go. If you have external profile on, then you need to do this. I do need to disable the uh profiling one.
Profiling debugger release. That's what I want.
Uh so the build system landscape for C++ is miserable, right? Um because there's no standard. There's no like this the there's no standardized system. The standard itself does not care how you build your code. In fact, it's very much not concerned with you building your code at all. Just making sure that you follow the letter of the law. Um, CMake is probably the most popular, but it's just because everything is confusing.
It's not technically a build system.
It's a meta build system. You describe in CMake DSL how and what you want to build and how your project's laid out and what connects to what blah blah blah. And then you give it an output. Okay. And [snorts] it will generate you a project in that output format. So to give you an example, you can describe your projects once. You take my CMake project for example which has the the the libraries and the executables and the flags and all that kind of stuff and you can say generate me a visual studio project for that and it will do it or generate me an Xcode project and it'll do that. I'm using it to generate a ninja project and ninja I guess is technically the build system. You could also get to generate you a make file project. So yeah, it's I mean I don't know what scaffolder is, but sure. Sure. Uh the thing is now the way it's kind of worked is because CMake is so popular a lot of tools will directly consume CMake. So Visual Studio and VS Code as well, you can both point you can point both those at CMake file and it will consume that internally and use that internally to generate its own files.
But it looks like it's just reading the CMake file. So CMake has in a way in with certain tools it looks like the build system because they take the the burden of you having to do all the generation off your hands. Um right we've linked we must be working now. Uh let's just check this still runs. What a [ __ ] nightmare that was.
Oh Jesus Christ. I've got the resources.
Let's just chat while this builds.
Yes, CMake is the best of a worst bunch.
There are other build systems. You could write raw make files. You could use scon. I would not recommend it, but you could. Um, I'm sure there's others as well. There's obviously all the platform specific ones like visual like Visual Studio, that big Visual Studio has its own format for project files. The the VS project file, it's all XML under the hood and grim. It also likes to assign random uids to everything and it gets really it gets really weird when they change.
The three big ones are GCC, Clang, and MSVC. Correct. Yes. Because you have to remember C++ is not most languages will give you a reference implementation, right? Like the the creators of the language like you're probably going to want to use this. So we'll give you a reference implementation. You got CPython, you've got Java C, you've got uh Roslin, whatever it's for C#. Like when Microsoft writes C#, like it give you a compiler for it. C++ like [snorts] I guess like C, Cobalt, Forran, whatever uh international standards, right? You just get for C++ you you just get a 2,800 page PDF which explains in miserable detail how the language works.
It's kind of up to you to to interpret that. So because of that, there are now kind of three competing compilers, right? So you got Microsoft one which is MSVC and you got the two open source ones, GCC and Clang. They are all uniquely different in their own weird and wonderful ways. They all implement different subsets of the standard because the standard is so huge they can't they're not yet implementing all of it. They have different warnings, different errors. There's such a thing as implementation uh defined behavior.
So they are in certain circumstances they are allowed to differ in what they do. Um so yeah it's a little bit complex. I try not to get bogged down too much in it. Like I would probably say personally if you're on Windows pick MSVC. Like go get the Microsoft build tools. go get VS Code or Visual Studio and just get something going because if you're learning, you just want to write code. If you're on Linux, I would just app get installed or whatever the latest available version of GCC or LLBM or clang. Clang is better in a lot of ways.
It has better error messages. Uh the design is a lot more modular, although actually saying that GC internal architecture has improved a lot. Um, but if you care about the kind of bleeding edge, at the moment, GCC has the best C++ 26 support, which is why I'm using it.
Um, so yeah, that's kind of like a whistle stop tour of the misery that we have to deal with.
Yeah, I don't really follow Zig, so I don't really know what they're doing, but but writing a compiler is incredibly complex work. The the thing with like Clang, right, or LLVM, because Clang is just the front end, is that you can it's very modular.
So, you have the front end and then you kind of have the the middle end and then the back end, right? This is why a lot of languages start off using LLVM because they only only have to write the front end. You just have to write something that turns your language into a clang a and then from that you get not only do you get all the backends. So not only do you get like the ability to create um x86 executables and arm executables and myips and whatever superh and then for all the different platforms as well. You also get all the optimizations like clang's been going a long time. There's an awful lot of clever optimizations it does and you kind of get those for free. So this is why Zigg, Rust, maybe Odin, I don't know, all use that.
It's a really good question like which version should you start with? I would say the fundamentals probably have not changed. Like I think S 20 is probably a good default now. like it's 6 years old, right? It introduces some big changes like modules, uh concepts, co- routines, like you know, stuff that you would uh pre aspire to using. I think anything I'd say 17 at an absolute minimum because 17 includes uh some really important vocabulary types like optional and variant. It includes file system. So, I'd say 17 is an absolute baseline. now. Um, but I would I would there's no problem just getting 26 in, right? Because it has some interesting bits and pieces. Uh, but if you're learning the language, I wouldn't get too bogged down with it.
Like what you what you what you want to hope to get to is that you can be writing code, realizing some of the idioms and paradigms that get used, and then look at the newer stuff and like go, "Oh, that makes my life easier." And then you can kind of learn it from there.
Um, that is an excellent point. 23 does give you print ln, which is a massive game changer. So actually maybe if you can get 23 and you still print ln then you can remove all the IO stream misery from your life. That's a really good point.
Um yes sorry problem with sort of trying to come up all the stuff top of my head is I do I do miss some key parts. 23 does give you print lm which is yeah an absolute game changanger. So if you can then that which is supported across all the major compilers by the way. So there's no reason you probably couldn't start using 23.
You are welcome. Right. This is not getting us anywhere. Did this run.
I mean, you can use stood puts and stood format if you want. It's just extra typing. Right. Okay. This box still boxing.
So now I need to go to the this is where we see if it all works. debug renderer the actual debug renderer the graphics debug renderer.
It's easier to add stuff to the it's easier as a general rule of thumb it is easier to make a library change than a language change because a library change is just more C++ code. Do you know what I mean?
Like you're just adding extra header files for people to use. Obviously there is it's not not saying it's easy but it is easier right and this is why like going through the standardization process W21 would probably prefer you make a propose a library change where possible and only make a language change if it's really necessary because to change the language to make a language change you tend to you have to change the compiler right you're modifying the compiler which is obviously not a trivial thing to do because they are not trivial bits of code but it's it is infinitely well it's much easier to just write a new header file and ship that.
Yeah, exactly. Yeah. And also like if you don't like the library implementation, you can just like not use it. You know, we can find an alternative one. If you don't like the I don't know the collision resolution method installed on the map, you can just go and find you can use the boost one, right?
Okay. I got my debug lines.
If Where do I Here we go.
I think I want to do here. If service I think Clang has given Oh, it's because I'm recording. uh physics system dot let's do auto uh is this going to work for me auto physics debug lines equals service dot debug renderer dot hang on hang there in a minute what we're doing physics Right. What did What was my in That's Oh, sorry. It's the physics system, isn't it? Sorry. Physics system. I don't think I even implemented this. There's going to be a link error, isn't it? Did I even implement this? I get carried away. I don't think I did. Right.
Uh, I mean, booster has got some like booster's got some good stuff in it, Yeah, I don't think I can just do return debug renderer.
I think I need to do dot transform auto debug renderer.
Sorry, auto e Uh can I do decal type auto return e Uh yeah, boost is a popular collection of libraries. Like there obviously there's as with everything C++ there's politics around it. Like I don't use it in this project, but I've basically every shop I've ever been at has used Boost in some capacity. There's some good stuff in it. There's a good alternatives for a lot of stuff as well.
Ab sales pretty good. Um folly, you know, you C++ gives you the freedom of choice, right? And freedom for you to choose what you want.
>> [sighs] >> Uh oh, you're right. I might need to make Yeah. Okay, fine. What I was hoping is I could promote this. Hang on. What with deco type auto? I was hoping I could prever preserve the value category and effectively yield this up as a reference and then automatically make this work, but I don't think that's going to work for me. Does transform got to return another optional or does it automatically wrap it in the optional? I can't remember this value invokes f with a container value as an argument and returns an optional that contains the result of that implication. That's what I want. So I don't know why this isn't see I think the hasht is pretty good right I think they done a lot of benchmarking on it. rate is released to the hash table.
I don't know if it supports heterogeneous lookup, but um it's pretty good. Uh const. I don't want that.
Where's that const coming from?
Is it because this method is const? I bet that's it. I bet I bet if this works, that is some that's some beautiful C++ there.
I think it might work. In fact, actually, can I just do it without the dec type auto or is it going to I probably try and turn that into a value.
Um, let's try and copy it, won't it?
Yeah. Oh, nice. Often you get to use decel type auto.
That's basically saying reduce the return type using slightly different rules. And if you're returning a reference, preserve that reference.
I mean, stood red X is pretty much the but of all jokes unfortunately.
Okay, so now I've got an optional that which is fine. So now I want to do debug renderer.
Let's just write this normally and I'll see if I can uh so let's do auto ref.
physics debug renderer equals services physics system. might need to hash include that.
Hashincclude physics physics system and hash include physics dot uh debug render renderer.
Oh, have I not got the service location?
I do have the service locator in here.
Why is that being funny?
Pretty sure that should work.
cannot bind non-const L value reference of a optional physics der to an R value of type. Yes, I guess you're probably right, but I should be able to make do that.
Nice. Okay. So, I'm allowed to bind I cannot bind an RV value reference to an LV value reference unless it's const because that will then persist the lifetime of it. But I can bind it to an R value reference. That's what this point because this is this is a PR value, right?
So now I should do if [snorts] physics debug renderer then uh debug lines dot append range physics debug render dot yield lines that if that works that's really nice because this basically just nvo well even if it's not nvo right you're going to get it's going to yield up as an r value sorry the result of your lines will be a PR value which means it then gets perfectly forward into a pend range so it should basically just move those line data straight into the vector the standard approach right as in the only thing that is stand correct in the standard is is the hash include header guards right so hash def if and def whatever prag once is a compiler extension it's not in the standard but it's bas and it is the only compiler extension I really use because all compilers pretty much do what you think it's going to Don't remember yield lines. What?
Uh oh. Is that an option or is that got to be like that?
I think we should have a poll. I think it's been a while since we pulled the room. Do we think this is going to work first time? Do we think we're going to see the outline of a box falling? Let's Let's pull the room. Let's Let's get a temperature feel for this.
Start a poll.
Is it going to work first time?
Yes and no.
Start poll. And then on the for the people on Twitch who like to gamble, start a prediction. Is it going to work first time? Yes.
Uh, no.
Uh, I I'm hoping we can dive through the wall and see. I want to see the out. So, I guess to set parameters for the experiment, uh, I need to see some debug lines. If the debug lines are massively wrong, I might consider that a yes. Um, if the game immediately crashes at the start, I might not consider that a no.
If there's some other issue I've if it's if the issue is not related to the rendering I've just [ __ ] up somewhere else then I would potentially reroll that. But I what I really want to see is a box falling.
Right. Twitch prediction has ended. I will end the YouTube poll and poll. Right. So we got 74% yes on Twitch. I think it's going to work. And we've got uh the poll has disappeared on YouTube, so I don't know how many people voted, but I hope I I hope you remember. Um right, okay. So, it's very close. People believe I'm not not going to lie.
I'm not seeing it.
For a fair experiment, we will run it one more time.
I'll immediately backpedal.
But I see not a box.
Oh, wait a minute. It only does it if the debug layer is on, isn't it? Hang on, hang on, hang on, hang on. That might be my fault. It's You have to have the debug layer on to see the debug boxes.
Uh, no. Still false.
Am I getting any debug lines? We're getting those debug lines. There's definitely debug lining.
H. Oh, I get this is my bug.
So, I think I I have to I have to say that this is uh no because I [ __ ] up.
>> [laughter] >> How have I messed this up so badly?
Pretty sure. Pretty sure that's right.
Yes, indeed. One must opt into debug rendering. No matching for for physics system debug render mode.
Oh, I put in the wrong place. Sorry, I've been been an absolute tit. Sorry.
It's here.
Either way, I still forgot to put it in.
The joy of default arguments. Am I right?
This will work.
Is I don't know to see if he got that arg. I think I think it got that.
Come back. Come back. Why is it really like juttery jittery?
Feels kind of jittery, but maybe I'm just doing something wrong.
[sighs] It's We're doing it. We're doing it, guys.
I guess. Yeah, it is one step a frame, but still like everything else moves one maybe after I think about it.
Yeah, it's true. Okay, fine. Sort out later.
Oh, Jesus. Right. What have I done here?
So, I like how this wasn't saved as well, which is a little bit worrying.
to play time now.
Let's check that works. I'll start committing stuff up anyway as we rebuild the resources.
All right. Okay. So, let's do I just noticed that this diff was smaller. Right. Okay. So, fix jolt.
build flags.
Remove AI guesswork. No.
Um, uh, update jolt.h.
Add physics debug render renderer class.
Uh, create integrate a bug renderer into physics system render physics lines and this is [laughter] enable debug rendering for physics.
Uh still right. What's what's next then? Uh we need to there's a load of other gubbins I need to do around Jolt like I need to integrate it into our thread pool system stuff like that. I that's necessary now. I just don't want to forget it. I should write that down somewhere. Um, I guess the next thing is to start integrating into the ed. So, we need to be able to have we can use that cube to test with, but we need to be the ability to create static objects, but also they're static, but they need to be move movable within the editor.
I don't know. I've lost the to board.
It's it's still gone.
Uh, I can't remember. It's on a side.
It's on another project somewhere, is it? Let me just That's a good point. Uh, I think it's on the I think it's on the secret repo. Sh. Secret repo.
Hello. Thank you.
Right. Give me give myself. I just flail around. Uh, secret repo projects private.
Here we go. Here we go.
Uh let's add uh integrate thread pool into jolt.
Done.
I put that under tech debt. I guess it is kind of tech debt, isn't it? Uh, bloom done, mate. Completed it. Move that over.
Integrate jolt. Done. It physics simulation. Done. It might leave that one. That's what we're currently working on is physics simulation. after that's character controller. Right. So, I think what we need to do next is I need to have a think about how I'm going to integrate this cuz we I think I'm going to just build out level block level geometry to start with. I think that's just the easiest way to get us going. I don't want to have to build like a massive like pipeline like of assets and stuff like that. Bye. So, what we need to be able to do is probably from this view click and drag boxes and then stick one on the floor, stick one for the walls, and do like a basic block out.
So, there's kind of there's kind of two options we have here. an easier one and a more complex one. I'm happy to ultimately ultimately I will make the decision, but I'm happy to discuss it. Uh yeah, stairs, TBC, all complex stuff like that, like ladders. I want to have multiple levels in the geometry. I want to have like vents you can go through. Let's like again relentless march of progress. Like I can't be worrying about those problems.
Now the problem the problem I have at the moment is that in this view I can do this and I don't really want to be able to do this. I want to be able to kind of walk around and make it feel like I actually live within this level.
Um, so we kind of got there's two options, right? One is we just completely separate out physics from entities. So I have like a new physics window here and then I can click it and then I can drag boxes around and we can just slowly block out the level. The problem with that is is if like I don't know, say I want to move this here, right? I now have to move all those all those physics objects and it's going to get quite difficult, I think, to see what's going on.
So, the other option is that we have the top level game entity also own a collection of static bodies and then they parent it to this. So I basically I have to sort of click this and like I don't know draw click this to draw the boxes and then they're anchored to that and then when I move this or I translate it or whatever or I scale doesn't really work at the moment is it? Yeah, I suppose it then does that. And obviously you're going to have to have multiple potentially colliders for it because this is hollow, right? So, I'm going have to have a box here and a box here and a box here and a box here.
That is more work.
Like considerably more work, but it does kind of get us almost close to like the concept of like almost prefabs. I if I go to the effort of blocking one of these out with physics things. I could I I could then use the our handy duplicate button, right? Oh, no. I just deleted it. Fine. Ignore that. I could I can't see can't see [ __ ] So this was moody lighting.
Uh why is it so dark anyway? Um, I could take this and then when I click duplicate, it then gives me a duplicate of all the physics objects inside it.
Turn fog down. Is that it?
That's a little bit better. I think just because I think all these lights are turned down quite low so I could see them. If I just grab this. This light is a real pain to grab, by the way, because it it thinks I'm grabbing the bounding box. There you go. If we That's a bit better, I guess. Anyway, lighting needs to be tweaked. Doesn't help that the background's black as well, I think. But anyway, so that's the other thing to do.
It's going to be kind of like a light ECS. I'm not really that interested in going for a full-blown ECS. Like the entity is just a it's just a container for things that may or may not be there.
Do you know what I There's no like like [snorts] I will always iterate over entities and just check if the thing is in it or not the box did work. Yes.
Yeah. Again, like different frame rates and stuff is all future problems. Like there's all they're all solvable problems, but they're not the problems I need to solve now.
Um, I think the I think we need maybe like an intensity for the uh the ambient light cuz yeah, I won't be able to walk around this. It does seem very dark. I don't know why it's so dark. Like, I wanted it to be dark to start with, but is it just cuz there's probably just no lights in the scene, right? Can I just add a light?
Where's that light?
lights on. But now looks like [ __ ] Anyway, um it doesn't help that I probably need to also as well there's probably other stuff as well here. There's the tone map, isn't there? So I don't Can I uh one of these suppose I could gamma seems a little bit low as well. That should be a bit higher. Uh and then I've also got the uh exposure Yeah.
Um anyway, those are the two options. I haven't decided which one I'm going to do yet. I probably do the slightly more complex one cuz I think it will, whilst I'm not, it does feel a little bit like I'm trying to solve a problem I don't have yet. I think that is the easiest way to kind of get us moving a little bit quicker cuz I'm going to get real bored of drawing all these boxes.
Whereas cuz you have to remember a lot of these in this corridor here are all repeated. So it's kind of just the same object, right? So what I should be able to do is I should be able to add one, right? Then like delete this, duplicate this, move it over, and then we should have like physics. I don't know what happens if you have two rigid bodies like pixel perfectly buted up against each other.
I'm hoping because of the way the the jolt capsule is going to work. We should just kind of slide over it. But anyway, I think that's what we'll probably do next stream is um let's have a think about that and have a play around with that.
Rewashes out the the bloom though is the only problem because I could like re ham that up blooms. Whoa. Yeah, this is this needs much more filtering. Sorry, I'm just fuffing around. It's just fun playing with this.
Like we built like an incredible amount of stuff and it's just really fun just kind of just playing with it.
That's very uh that's very Oblivion bloom. That just like absolutely wang everything up.
But it's looking pretty good. Like I think this is looking I'm feeling I'm feeling confident. I can I can almost see the vision.
[laughter] So yeah, where we at?
So yeah, I think what I'll probably do is I'll probably we'll probably have a play I think it's worth spending a stream elaborating it, right? So what we'll do is on where we at Sunday, we will straight off straight in off the bat, we will start adding physics entities to the physics handles to the top level entity thing and then add something to be able to draw them. And then yeah, we'll make sure the duplicate duplicates that. I think I'm hoping that will work. And then yeah, I think we'll just once we've got something down, we should be able to see that red box hit the floor, which is the most important thing. Uh, and then yeah, we'll just add a character controller. I really don't think we're that many streams of having sort of semi-usable physics. Do you know what I mean?
Like I reckon two or three time two or three streams we'll be walking around a level. Um and we'll we can extend the level a bit so there's like a loop so there's actually somewhere to walk. You know, we can bring in some extra stuff, add some add some visuals chuff. So I think yeah, we're basically I'm hoping we're only last words. I'm hoping we're only a couple of streams away from be able to walk around a level. There's going to be an interesting thing there where we're going to want the debug mode to be able to fly, but when we go back I think we're going to have to have two separate cameras. So, I think we have to have a player camera, debug camera, and then F1 switches between those two modes. So, when you you always go back to where you are. And then we might want the physics paused in the debug mode. I don't know. So, you can see what's going on. Undecided. Lots of stuff to consider. Or maybe a total option to turn it on and off. Anyway, I am just guessing now. Um, that's all I've got.
Thank you very much for coming along and keeping me company. Uh yes, I've already got the Jolt demo built in Visual Studio and I will be basically pretty much copying their example one and then my plan is to find out where all the knobs and dials are and expose those as imi widgets and then we can tweak it to make it feel how we want because I've got I've got a rough idea of like the character feel I want in mind. Um but we just need to be able to tweak it like value wise and then obviously we can serialize that out and save it and reproduce it. Um, I think that's what I've got. I've said that several times now. Thank you. Oh, new video soon. Like, like soon. Like I' i've filmed it. It's in Da Vinci. I've not started editing it yet, so however long it takes me to edit and live.
[snorts] Next week, question mark. Maybe. Let's Let's hope for that. Don't hold me to it. I don't know how many story points it is. Um, but we can I can give you an update at the next uh part party poker planning meeting. Other than that, thank you for keeping me company. Uh, I might try to do some editing now or at least have a beer and I'll see you all and on
Related Videos
LBF101 Creating an XML Changelog
liquibase7511
3K views•2026-06-15
Alta Labs Cloud Dashboard Real time Network & Xnet Insights!
ShinyTechThings
158 views•2026-06-17
Wait... Group Policy Not Applying? Check This First!
keeplearning_iT
144 views•2026-06-15
Leetcode Weekly Contest 506 | Life's boring these days
Pudeesht
2K views•2026-06-14
microJAM: MAKING A MICRO GAME FOR A GAME JAM IN CLOJURESCRIPT AND TOTALLY NOT C
janetacarr
156 views•2026-06-18
Partitioning vs Bucketing vs Clustering: How to Make Queries 100x Faster
thedataandaiguy
194 views•2026-06-16
Design Claude Code Like a Senior Engineer
hayk.simonyan
344 views•2026-06-19
Linus Torvalds: AI Won’t Replace Understanding Code
SavvyNik
140 views•2026-06-19











