 So, what is, needs to get done at this point. So obviously I have that collision bug, I should almost certainly fix that first before doing anything else. Why do I stream so rarely? So I'm streaming all development work that I do on this project, so far, and so I have to both be in the mood to work on it, and it has to be at a time when it's reasonable to stream, and I can't, I don't like the idea of streaming after 10pm because that's the time when we're supposed to be quiet in our apartments and not bother neighbors. And I doubt talking at this volume would bother the neighbors, but I don't know for sure and I just like to not take chances. And so unfortunately for the last couple weeks my sleep schedule has been messed up and I've been sleeping during sort of prime streaming time, so I haven't really had a chance to do it and that's why I'm doing it this early because I've got to go to bed after I do this. So one of the things with the collision stuff too is that even if I get this particular thing working I don't actually know like how accurate it is like, you know, it looked reasonable from first person, but I can't actually see that I'm like bumping right up exactly against things. So that's going to be the thing to work on I think after that is either a third person camera or having objects in the world that collide, you know, not necessarily objects that do anything interesting, but they'll just be cubes, but they'll collide. So more some kind of non-first person collision for checking, collision is working right. And right now the collision system is kind of tied up with the first person, not first person with the player physics, I kind of didn't really do a separate thing. So if I, so third person may be the easiest way to do that or I'll have to write some non-player physics, yes indeed this is a good time for Europeans, it's just usually I haven't felt like streaming at this time of day, it just isn't one I really felt like doing work. Partly it's been getting hot here, like I have my, I had to set up my air conditioner now and so it's just all a pain. So anyway we'll do it some today, I don't know if I'll do it more this time in the future or not. Alright so, physics, okay so it's not really physics probably so much as, so it could be that the gather is broken or it could be that the stuff that's cached in the chunks is broken. And I was thinking maybe I should render them, oh here right, here's the comment. PCR for negative 65, negative 20 is not at the same point as you're still being created in the mesh chunk creator, right so, right so I could do a memory break point if that's a consistent behavior. So I want to look at this, MC is the mesh chunk, the mesh chunk is getting copied so that I can't do a data break point on it, right and so I was saying maybe I need to stop the way I'm currently copying that so that I can debug that. So I guess I'll do that work. I'm going to change how that is stored. So that's a pretty straightforward refactoring I hope but it does involve memory management so it does require a little care. Where's my header file and what's the header file for this, oh OBG folks, oh data, right okay data. So the whole thing right now is that the mesh cache directly stores mesh chunks and I want to change it to store mesh chunk pointers that way I can allocate the pointer somewhere and then just store it in here instead of copying it in here. That way the pointers inside the mesh chunk will stay in the same place in memory and that means this, specifically it means this fizz chunk will stay in the same place in memory which means all of this will stay in the same place in memory which means that particular column will stay in the same place in memory and therefore I would be able to do a data break point if that's the issue. So let's just compile with that change and find all the places to break and fix them all and this is all just mindless. I'm assuming I don't have to do any smarts so here we do that. Now it's going to call free mesh chunks so free mesh chunk clearly needs to do something different and then here is the tricky one. Here we have to say mesh cache slot Y of slot X equals new MC and now the caller needs to not free it as well. Okay so let me write down this stuff so I don't forget. So set mesh chunk for call caller. Let's actually do that over here so I don't forget because it gets buried away in the code somewhere. Caller doesn't free and then what was the other one? Free mesh chunk does. This is the old single threaded one I think so it needs to actually allocate it at that point and I'm just going to make it fail because we don't actually use a single threaded path. Oh that's right that was the other way I was going to debug this was go back to a single threaded path. And with a single threaded path I can hopefully have a much simpler time debugging it. Okay if the chunk is wrong then we do that that's all fine because that will internally take care of it. So this now needs to check if it's null. Packed a bunch of places need to check if it's null in fact we probably can use that rather than the vbuff to test rather than vbuff being null but we'll leave them both for now. Okay now I have to do these two things. Free mesh chunk and then we're free I'm going to set mesh chunk for reward what did I say it needs to not free now which is that one right there just let's just do this mc null although it's just going to get overwritten here so there's really not need to do that let's do it just in case it's to be on the same side all right so now I'm going to have a bunch of null mesh caches that break when I run this so I just have to have them all guard things yeah right so this whole way I initialized it doesn't need to happen this way anymore it can just set them all to zero and free them if they already exist because in case you reinitialize these I don't know if you do probably should separate these out to separate functions so let's just actually do that and we'll do that by not actually implement the other function see the next place it crashes if mc and I never do shoutouts are they actually watching well now he's checking the trunk so if mc is null or these things are true now the only thing about this is if we what is this code doing is this the old single threaded code yeah it's a single thread okay because it never frees the old one but that's fine that's what do you mean you can't so what it does mean is that by doing all this hello JJ and Austin so what this does mean is that by doing by doing this perilous thing of just running and finding the places that it crashes I could easily be missing places in the code that we're still checking it and that I just haven't hit yet however this project is currently very simple and doesn't have a lot of conditional logic so there probably aren't a lot of places accessing the mesh cache that I haven't exercised it's certainly possible there's one or two but because it's so early it seems pretty unlikely okay so now I keep running into things and okay yeah look this is just totally mismatched because my head is not supposed to be in the ground so I don't know if this is the same mismatch it was before or if it's a different mismatch because I didn't actually make it out to the place where it was crashing before they are satisfied well that is good because that's all they're going to get I'm not going to say JJ and Austin's name ever again except that time okay yeah so here's where it died before somewhere out here somewhere out here yeah there goes okay so it is still dying in the same place hang on let me do something somebody's clean my windows so so we're we're we're we're JJ and Austin block size is smaller no yeah so it's arbitrary and the only thing that really implies the block size right now is the player height the eye height and I remember what the eye height is well that was something we did when we did the physics I think size oh it's passed in in Maine I guess physics move walkable a camera velocity camera bounds camera bounds so for so yeah so the player's height is player is apparently narrow one is half a voxel wide and and thick because this doesn't rotate and four voxels tall well his eyes are 4.25 so he's probably 4.5 voxels tall I didn't say their names again if I were to say their names again that would break my rule before about not saying JJ and Austin anymore so obviously I'm not gonna say their names I was talking about Austin the city in Texas because I lived in Texas for a couple years and I went to Austin once maybe twice and you know one of the things obviously is that you know you have an index variable like I and then the next one that you use is J and then the next one uses K but you can't use L because L and uppercase I in some fonts are too similar so you have to stop there and M and N get used for other things and is the number so you could go backwards for counting variables but that's kind of dumb too so I tend to use I and then JJ and KK so that's where JJ and Austin come from is from index variables and from living in Texas so so where were we yeah yeah so that's why the player I picked this height yeah because I wanted to be different from Minecraft so yeah you could be it could be that maybe these voxels are actually Minecraft sized and you're a giant so who knows but you are definitely four voxels off the top of the ground except when I had that bug what except that do that bug you saw I was only seemed to be one thing tall okay so so this was happening at the same place so now we can say that the one for negative 65 negative 25 so we can look where the fist chick chunk run gets created again run and that is build physical yeah so here we go so x y is that the world space x y coordinates no that is the local coordinates yeah because it's within the partial but build this junk I do have the WNX right explicitly for this here we go so we can break point here and see it get generated I need to also enable it in the other spot too so here we go so first we see it get generated and we step here and step and that returned to this or can I not copy it can I not copy it the whole line okay so that was the variable there and let's go ahead and go ahead set the data break point just in case so we can get this variable then we say break points data star with star 0x 1740 to see zero star void stars your X how's that an invalid expression star okay I don't know why the word star doesn't work but okay okay so I'm not in the data break point go over here try to get a chunk that has that there we go okay like sir the a is the world space coordinate there are just based on x zero I don't even know much chunk size I these are in chunk word it's okay yeah so that is correct okay so I believe that is all actually looking at the right thing and PCR is different there was the one that it thought it was but we know we didn't hit the memory break point so odds are the emcee pointer is different but I didn't think to check that so we got to try that again okay so here what why is my pointer oh this is the stupid SDL bullshit try it again okay so now we want to make sure we remember what mesh junk was as well let's also kind of what the other one is maybe it'll be the same what did it return no it's different 0x1145 dd50 and then emcee is 11486850 okay that's PCR and emcee fix that one up we need the address of that thing that I just erased so that's the address of 11489088 why that bumped into something there too far this way there we go alright PCR emcee emcee is the same I don't need to type those I have them okay right emcee is not the same so it's a different emcee so somehow I've ended up with a different emcee for this coordinate that I had before so either the math is wrong in fact and I'm looking at the wrong mesh chunk or I've built it more than once or I've overwritten the slot in the cache but if I'd written if I'd actually generate the same spot more than once I would have trapped in that other place so does emcee carry around its actual coordinates yes it does carries around its chunk x and its chunk y and I can see those are negative 1 and negative 1 and that's not right is it x is 0 shouldn't the chunk that's negative 1 go from 64 to 0 how many of my mesh chunks size are my mesh chunks 128 by 128 or 64 by 64 I've forgotten so what happens when I don't work on this often enough mesh chunks are 64 by 64 so let's look at CX0 CY CX1 okay so I must be right on the border yeah so it's supposed to be going so for this chunk I and J the chunk at negative 2 count negative 1 x0 should be negative 128 our x1 should be negative 64 a next 65 is at negative 2 yeah right get mesh chunk for cord I think this is the bug I'm calling mesh chunk for for cord with the wrong coordinates it's supposed to be world coordinates mesh junk for world and I go and I compute the world coordinates and then I don't pass them in I was passing in the chunk coordinates so it would only be correct for the chunk at the origin and I just exit because I have to at work and I don't have to at home and I don't I forget what did I want to do I want to get rid of the azimuth rays I have a bunch of those in the code don't I know alright yep that's fine so hopefully that will fix it it's also tweaky though but that was a weird why am I what am I colliding with there I'm like just is that just because the ground it's you know like why am I colliding with the ground there it does let me pass it eventually but so that's just a bug in the physics walking code doesn't actually isn't checking something correctly like maybe maybe when I'm going into a corner or something this is why I need to get the third-person view or something so yeah I guess let's do a third-person view so let's that was a trivial bug fix but let's go ahead and check it in I want to get in the habit of checking in more frequently oh and they stopped cleaning that window so I can turn my AC back on hang on a second it's 83 degrees in here so it was kind of it's kind of a little little important to be comfortable when trying to program all right so that's fixed don't even know which if that was from the same one or not that is from the same one so let me go ahead and check that in random other stuff wait why is all that other stuff not check for commit oh that is all the stuff I just looked at that fix collision all right now that's 83 Fahrenheit for you Europeans yeah I'm pretty sure they didn't think it was Celsius all right so so I put in the to-do I did this all right so I was saying let's do third-person all right so let's see camera so it doesn't really want to be the camera anymore it wants to be the player all right so first of all I keep talking about this whole Vek 3 business I'm already sure there's a Vek 3 somewhere in this case maybe it was in the other code that I didn't preserve mesh builder Vek 3 I let's go ahead and from now on try to use a Vek 3 instead of just saying that every time and because this is a 3d engine let's just call it back because I'm crazy this is just stuff where I choose it to do it different ways at different times and you know I'm still just trying to figure out which ones right or wrong you know this is funny but let's and actually I'm gonna switch it to this case convention because because making it look like it's C++ is misleading so you know clean up your code you know make a decision on our tree like this decision like this that when you're in the middle of doing something else and fix it that's totally fine you know if if you think it's the right decision so and of course what I was saying is I'm still experimenting still always trying different things to see what the best strategy is and this is another case of that that where I've often done this the uppercase way here and so I was like when I started this I didn't know if I actually said it I don't know what I said but certainly in hindsight I would guess that it was a well let's try doing it that way so I tried doing it so it looks the same as C++ and changed my mind okay so let's go ahead and get to show you that so what was I saying yeah a player so Vec3 so Vec so I'm just calling the player for now maybe it'll be an object in the long run but let's just have player position and angles because orientation probably should not be Euler angles for objects but maybe you can always be Euler angles for player I don't know and so now we're to world space shouldn't be camera to world space anymore camera to world space needs to be we need the player to have a velocity as well okay so let's spell it out spell correctly let's not spell that one out zoom up here rotate views probably dead code from when I had to animate the thing yep okay so now we do want a camera angle and camera location in the long run because that's what we need to render but for now I'm gonna comment them out so that the code breaks so that I can fix these all up to be player based and for now we'll just have one player objects and we'll hard-code it to a global variable which is done and we'll have to fix leader but one thing at a time so so X Z and I'm not gonna fix these vectors to actually use VEC where they're currently threes I'll do that incrementally over time X is not a player position dot X and this is now player space player mission X cambell I need to get rid of that because I didn't close compiler I think there is no more camera our camera is not gonna have a velocity because it's just gonna be glued to the player so then this is player dot velocity X how is it dot X it's an array and I'm entering the array so we take the address of the first field of it not the ideal way to do this ideally I'd have once all these things get turned into effects we can do it the right way so then this is player velocity X or player why do we have this code what is it doing oh it's doing why can't it just always do this like that to start with you know I should just have a square function velocity all right sorry check the chat so syntax error dot yep that's clearly wrong again a lot of this is in some sense poor programming practice all the global variables is kind of terrible and the fact I'm hard-coding this to a specific player I could very easily have made this a little function that's parameterized on the player however I can do that later just as easily when I change it so there's no global variable player and I pass a player into this and I have to change all the dots to arrows you know that'll be extra typing that I have to do that I could do it correctly now but and sometimes maybe I would do that but right now at least on stream I'm kind of oriented towards trying to get stuff done as fast as possible have something to show in some sense and so I lean more towards the small incremental things like I'm not going through and changing all the backstop like you saw I did go through and change all the look at that there's a bug you saw I did change all the true false but that's because I knew there weren't very many so I know it wouldn't take very long okay and here we go now physics move lockable on a player not on and this one we're going to make take a vector right because I want to do a little bit of that improvement and we'll just leave this being called camera balance even though it's that and then we say player dot velocity and here's the other place where we can infer was it minus equals forgot all right yeah minus equals where we can infer this scale because the right if this is meters 10 meters per second so because it's 20 per second squared because it's 20 that implies that it's two voxels per meter instead of one box of meter just basically half you're twice the resolution of minecraft okay so now we of course have to actually change the physics code to take the vex and by vex I don't mean that just the guy who makes minecraft levels vex and now that will break the implementation did I not pass in the right thing function incompatible types camera bounds I've deleted DT was DT DT camanglayer.x.z seems odd oh x is vertical and okay yeah that seems to allow you to look straight up and straight down when and maybe it should reserve a little bit let's leave that one now let's make that be the player player zoom is now player dot zoom and here is where we actually want to preserve because we do want the rendering to actually use the caming and the cam lock so and that we should use a cam lock and that should update player we may not need it anymore camera to world space lightbulb so that should come out of player it's a debugging thing really so it doesn't matter and now we have to fix this okay so now we can go back to this file caming and uncomment vex pause vex and then somewhere at the end we'll write them back we have to update that oh and by the way if you do say stuff to me it does help to try to remember to put the the at symbol and my name and spell my name with the two at the end so that I actually when I look over there quickly I'm likely to see it because I trying to not spend too much time looking in the chats unnecessarily so alright so now the only thing that I can think of offhand that's broken is that I haven't actually initialized the player lock but I did up initialize the camera lock cam lock so player location is going to be where the old camera location was and camera location will x y z we'll move it negative 10 y and we'll put it at 80 because I don't know how high the ground is and we'll see where that see if any of that works okay so why would the gather fail or is that the collision no that's the collision test so did I like pass the wrong thing in so like presumably I broke something when I did this stuff maybe I passed but maybe z of 150 is too big oh am I let me know height of 128 but that was set to 150 already cg of z only goes up to 144 why does it only up to 144 am I falling super fast I might be falling super fast dz yeah I'm falling at a pretty high rate Bell Z must be huge so some somewhere I didn't clamp that properly LZ equals zero these should equal D not DX this just be pause okay so there's a couple problems here one is that I'm not actually rendering the player yet so there won't be anything to see and two obviously the camera did not get positioned somewhere that could see anything and I can't control the camera so what I actually want to do instead of trying to get the camera right is I want to go ahead and have a thing where the camera for now just to start with let's go ahead and snap the camera what is this good oh that's the old collision tests for now let's just go ahead and snap the camera when do we render here's where we render let's snap the camera to and what we'll do is we'll in a second we'll go ahead and move the camera away from the player but to start with let's just put him in the same spot and make sure we didn't break anything not tight that hang that was so hopefully this is totally unchanged no okay so what did I break I can see X is Y is 0 Y 0 and Z is 104.25 but that doesn't explain why I can't see anything did I comment out no is that changing when I look around okay if I look up now I break yeah 90 looking straight up okay am I like under the ground no I shouldn't be under the ground so why can't I see anything I guess oh wait so what are the stats printing is it claiming to be drawing stuff yes claims to be drawing tons of stuff cam so currently camlock and camming should have the exact same values they used to have and I didn't change did I which files have I touched yeah and I haven't changed the rendering code so right but these get copied back out and they looked reasonable so player zoom is not getting initialized zoom but it was never getting this oh it must have it was a global I must have had it being initialized as global don't don't don't I don't know where to initialize this so we'll just stick it in anywhere that'll probably fix it okay yep so now the camera is stored separately but it's just being copied so now we use player space to world space where that go go it's gonna go here near space to world space so that takes the output and then it takes what this thing is and we want to be looking along the player's vision and I don't know which direction the player's vision is so let's be way back and see what this does let's leave that code around just in case I want okay that's not along the player's vision that's vertical why would that be for vertical Z is always the vertical that's also under the play well welcome to having the light that light source that's always secretly zero zero zero which is a little suspicious as if this were computing the coordinates relative to zero zero instead of relative to the player position well let's do this because that should that should just put it good to the player again and if it doesn't then I got a bug hey it doesn't I got a bug that's putting me at zero zero zero I'm never adding wait what what what why was this this was supposed to be angle and it also only seems to be relative it's not including the translation it's only applying the orientation which I don't want to change because that's used for the physics the player physics so clear space to world space so what we have to actually do at this point is let's see all right now let's try an anger 20 along why again because it's a Z up facing why my camera normally faces along why so that should be behind the player but of course I can't really tell where the player is for sure so let's drop go ahead and draw the player instead of wasting time so where do we draw the light render objects okay here we go so camera bound which are gonna be the player size eventually let's go ahead and make that a global for now so we can also access it whoops I must have an init function right render in it this isn't really part of render in it but alright and then for that all right and then I need to finish writing that code to draw the player to actually use those bounds and we're not gonna rotate it now we'll just drive not the size so camera player position x once look at that sbgl I assume it draws no it draws it centered around that okay which is good because that's kind of what we want except not vertically so it's not really what we want at all why is this got two branches oh clockwise or counterclockwise let's just commute it and use the same function okay so it's float x size size x equals camera zero zero one of zero okay so now you have the actual size which is what we need to pass in straw box except that we don't have the correct positions yet because player we're the coordinates that we track for the player are the bottom of the player and we need the center of it because that's what this draw box expects so that's average of these that work I don't see it I do not see it anyway let's see if we can get our head inside this tree or not our head but our camera why can't I move oh yeah getting inside the tree doesn't help I need to get inside the terrain there we go no no I don't see it anywhere don't know where it's being rendered did I get something wrong in that code is the code being run code is being run false x y z z is it negative 2 well that's not right because player oh I used camera bounds player position is player position plus really need a vector library so that I don't have to write all this stuff out stupidly and have a little typos like that all right so now hopefully we get it there it is see that is not a very plausible player shape obviously but all right so so right there we're so yeah this doesn't seem particularly right like it's hovering above the ground let's get out to somewhere flat it's hovering above the ground which could be a bug that I'm not computing the position correctly here it's like it's one voxel above the ground all right so let's fix that first so first of all what is the cam bounds cam so the smallest point is that the largest point is that so it's at the feet but not quite at the feet which is kind of a weird choice so I'm gonna change that to zero which isn't going to make any difference because everything is getting offset okay I see I wonder what that was in response to okay so all right so that shouldn't have changed anything except made it a little bit less tall all right so right so it's probably just a bug because I do this code in this walkable physics where I try to find that I'm on the floor of the current box so yeah so probably I don't do this stuff right I'm supposed to hover z eps on above the box all so I collision test there doesn't this just make me fall instantly why doesn't this you know this is the falling case oh but I can't move further than DZ but this code doesn't test the DZ this why does this do I just never hit this code yeah okay no okay there I hit the code oh I hit the code if I get a collision okay I see what's going on right so if this move would collide then I check if I run into side walls and if I wouldn't collide if there are no walls to collide with wait check if I check if I can keep falling that full distance with no walls see this all needs to be commented and that's just the streaming I need to take some time to comment when I'm not streaming so bottom to floor of current box so okay so this is when the DZ we know we collide after disease so we don't have to chest this okay right and we assert to make sure we didn't fall too far right okay now I understand what this code is doing so the question is why does that code end up where it ends up because it seems to end up one box will tall one box will higher than it should so it could be because the collision to test test is off or why do we subtract sizes 0 to that doesn't make any sense what was I trying to do when I did that why was I taking or this is to decide how much to gather so I find the center of the guy that's how much I gather that's why I need to offset by those but here I don't understand why I'm offsetting by that maybe I meant to be offsetting by the floor man that would make sense I'm trying to get the floor to be at the right spot but it was only point two five so minus DZ that's what the old die of Z was now we've moved Z down and since it didn't collide at the old coordinates we assumed it wouldn't collide at the new coordinates so the question is why does it collide at the new coordinates so first let's test that it doesn't collide before we move it and this could be dependent on DT so alright so as long as I'm working on this I'm just going to force the physics to run at a fixed frame rate just so I can make sure this is consistent okay so which one did that die on does down the first one at the second okay it dies on the second one so it's claiming that moving the Z to the floor this should be zero didn't work so why does it fail to move it down by that much let's look at the closing okay which one does it claim it collides with that one so hi okay zero negative 199 okay and where are we supposed to colliding Min Z it's not supposed to be going down to 99 why is zero to zero on well it's this is claiming that the top is at 104 oh the my coordinate is Z is up all this stuff is confused right okay so this is the bottom player the it's off center because I made the XYZ not be the bottom of the player made the XYZ be the I location in the player and so then the player stands 2.5 higher okay which means that this computation that is zero before was correct because zero is the side that's the bottom okay so now that I've done that now we go back now it won't assert but it will still fail and be one voxel too high for unknown reasons okay right so I want to break here and figure out why we don't go down further okay so there we fail so Z is at 104.25 so we set next statement right so we have to be careful about numeric precision here because if this value isn't represented accurately this can blow up but at the moment it is act represented accurately because it's only 0.25 so I picked a number that's exactly representable so it's to avoid any random problems okay so then what are these Z0 99 Z1 104 are these and I use them as exclusive bounds so I am testing at 99 and that's the one that breaks right it's the one at 99 okay so I'm not allowed to have it at 99 and then when I render it okay the voxel at 99 extends from 99 up to 99.999 so the feet should be at 100 according to this so now when we render it according to this the feet should be at 100 so positive Z size Z size Z to yeah so yes the bottom of this is being rendered at 100 and there's a voxel extending from 99 to 100 so it's a couple possibilities one is that all the meshes are being drawn one voxel too high that's actually plausible because of the way I work from top to bottom when I build the meshes and the fact that I only have 255 not 256 I hope that was all still audible while I was sitting let me make lunch make a sandwich real quick well I'm thinking about this so what else how else could this happen the mesh gathering could be wrong that seems unlikely I'm not sure how you end up with a off by one error in Z only whereas the mesh being off by one seems pretty plausible okay I can see how the mesh being off by one happen so let's take a look at the mesh builder where does that happen our Z starts at 256 minus 16 so input range Z0 to Z1 Z1 starts at 255 so it looks like it ought to actually be correct some mesh coordinates world chord XYZ generate mesh for chunk set I assume we always pass in zero world coordinates yeah zero so the transform is getting a zero the output coordinates because of the way the coordinates are packed are at most 255 so you can only represent you can't represent the voxel that extends from 255 to 256 so that's why there's only 255 voxels because I can't generate the coordinate 256 because of precision limits because they're stored as tiny integers and so the voxel should extend from zero to 254 voxel number 234 should be the largest one and this all seems reasonable so I don't think the mesh is drawn one too high unless there's like a further off by something error so let's see this how do we initialize this we fill in the top two rows so zero to 15 yes I think we do actually emit the bottom row this is a thing that I think I meant to fix and never did check if it's on the to-do and then I can just stop thinking if I see it in the to-do so so right what happens is we're building we set up as valid 18 something 18 tall and then we generate 16 of those voxels so that there's always the boundary is defined so that the generator has the boundaries and to see that we see the top two rows with empty and then build 16 things but that means that very first one we build only has 15 valid 14 about 15 valid because the bottom two rows sorry the top two rows are empty the top most row is padding the neighborhood padding and the bottom row it's the neighborhood padding so the one of the things that we generated doesn't get used it gets copied around for the next time and does get generated the next time but on the very last time we generate zero into the bottom most row and we don't generate it so in fact all this stuff is off by one and we need to subtract one here and now they're actually at the correct coordinates except that I need to add one not subtract one because I'm calling I'm generating at the very end sub one here is getting the mesh that's at row two and so it renders is it off by two like it might be off by two but on the screen it only looks like it's off by one yeah okay so get a little z fighting there oh because we can see we're drawing the wrong side of the cube now clockwork clockwork clockwise so this apparently needs to be likewise all right there we go okay so let's move the camera in closer and of course the way it pops makes it confusing but so yeah let's move it in closer let's just do that all right there we go now in theory we could make them yeah that looks that seems reasonable I mean obviously I don't want it to pop when it comes up but the whole point is is that it didn't pop it would have to inter penetrate because it's not going up until it's right up against the thing okay and then the question is why was a gang stuck some of the time like that why did that one decide not to step up it's because I'm in midair and the step up doesn't take place when you're in midair so I need some kind of special role when you're near enough to the ground that the step up rule should stop by even though you're in midair because you're not really in midair right you should have feet that are moving and as long as you're close enough to the ground so that whole walkable logic needs to change pretty significantly to handle that case I don't know why that builds with so soft there you go it's a glowing whitekeeper that doesn't rotate and I can make it rotate but the physics is not going to rotate the physics is always gonna operate on this shape so now we can check the hole that the physics correctly handles even though this thing is wider than wider than a box will should there's nothing specific to that size so that's not where the back is there's back there we go that's a good that's a good test fits in the two-wide thing but not in the one wide thing yeah alright so there you go that's all working that seems pretty reasonable and by making it bigger it is actually smoother at dealing with those small bumps because it doesn't fall into those little pits as much but it can still break a little bit if it if it while it's falling it hits something so I do stop to fix that that case that doesn't handle and I do need to have it smoothly move up or something up here we go finally found a too tall thing which prevents me from stepping up there's no jump so I can't jump to get over that but I can go around it course but anyway so yeah I can rotate it on screen very easily because I'm just using GL immediate mode so I can just slow some throw some rotates in but but I'm not gonna rotate the physics shape and so as long as what we're looking at is the physics I don't want to rotate it and not see the physics shape why did that it's not textured so it's and there's no shadows it's really hard to see sometimes what's going on there and see why I guess stuck on these trees and it's because I don't have slide along code so until I add slide along code I have to actually turn all the way to the side before it will let me move so I probably should work on slide along code so let's go ahead and check that in so that was me changing to the third-person camera for what reason did I fix something else because of that now I think it was just to have it so that I could see what was going on with the physics what what's going on here when did I do camera and I'm working on the master branch oh I'm hiding that I need to get something to drink I'll be right back dr. dr. someone in the stream is asking about the shadows so let's go ahead and take a look at what the status of that stuff is so you'll notice if you look under the trees there are no shadows due to the trees instead I'm doing just a very simple fake ambient occlusion where I guess it's not fake ambient occlusion it's real ambient occlusion it's just ambient occlusion is fake inherently let's go out here and take a look so all I do is add each voxel I compute I store whether it's solid or not I guess and then the vertex each vertex looks at in the direction it's facing so the vertex you know has a normal at you know for given face there's a normal from that vertex and it gathers the force around it the lighting from the force-rounding voxel so if I had real lighting here stored in the space it would gather up the lighting from that space but all I'm storing is whether the voxel is present or not that looks like a jumped how do I go backwards as I go off a ledge yeah so that gather operation means that if the direction it's pointing at so like look this vertex here all the way at the ground say for the say for the one that's facing me right now down in that corner it looks at four voxels it looks at a voxel up here boy this is really terrible to try to point out with this thing it looks at the four of voxels around it and three of those are solid and only one is open so the lighting that gathers only comes from the open one and three of them are dark so it comes down and is only one quarter as bright as the stuff that's facing open areas where all four are so it just causes a darkening around corners which is the ambient occlusion effect and the gather operation is built into the sb voxel render because it is necessary so that if you supply lighting values per voxel the vertices are continuous that they share the same lighting values so that you don't get gaps you can actually see some sort of triangle artifact that the the lighting is sloped in a particular direction that's just because we draw the causes triangles and it's interpolating the four lighting values at the corners with negotiating and the quad is triangles so the triangles independently crocheted but anyway so yeah so the the lighting is just sb voxel gathers up those lighting values and stores them in per vertex per polygon and those vertices are totally independent even where they're shared so it does that gather operation because it is convenient for this look and because it lets those vertices be have continuous lighting values so that they don't stand out as having lighting artifacts if you use the color capability where you can recolor individual voxels and individual voxel faces those colors will not be smoothed across voxel boundaries you'll see those as sharp edges and there is no way to actually do colored I can't do colored lighting like minecraft actually does have two colors of lighting and I have no actual way to express that in sb voxel render that was just a compromise where I was like well I don't want to be minecraft so all right so yeah maybe I'll stop there I mean I could do more I'm just not super have something specific I want to do at this point there's these there's a bunch of tweaks to this moving movement system but I think I kind of want to save those for another time I'm working something else and if I'm gonna work on something else maybe I'll just do it on a different day rather than try to keep going here because you know I have other things to do other than work on obbg unfortunately so perhaps I will do some of those other things all right so I'll check out chat real quick for any things but for those of you watching the archive see you later