Hello guys and welcome to my first devlog video of the game that i’m currently working on well it’s not actually really a game yet it’s very bare bones at the moment as you can see this is literally all the code there is for the game at the moment And there isn’t much yet the rest here is the source code for the engine in this series i will be focusing on the game but maybe i’ll do a separate series on the engine too if that’s something that people would be interested in so first up i should probably tell you What kind of game i’m making i’m making a 3d action adventure game that takes place in a procedurally generated world kind of like minecraft but more focus on the combat and progression elements i think their area is probably closer to what i’m trying to make than minecraft So this video is going to cover my first week of progress on the game which is basically world generation and generating voxels using purlin noise and creating meshes from that using marching cubes it’s not much yet but we gotta start somewhere so in order to be able to have very Large or possibly infinitely large worlds i’m going to be dividing the world up into chunks each chunk will be saved to a separate file and we can load and unload chunks as we need them each chunk is further subdivided by a number of sections or batches as i’m currently calling them And each batch consists of 16 by 16 by 16 voxels the chunks themselves contain 8×8 batches in the x and z directions and a variable amount of batches in the y direction this way we can always adjust the world height if we would need higher worlds later on The voxels themselves are simple 32-bit structures we want to keep this small as we’re going to have to store a lot of these the structure itself consists of a 2-byte index into a voxel definition table each table entry here contains some some more information about a specific type of voxel for example it’s Color whether it’s grass or dirt or maybe some other physical properties the two remaining bytes in the voxel structure i’m using as arbitrary state for each voxel this can mean something different depending on which type of voxel we’re talking about for destructible voxels for example you can use this as an hp Value that keeps track of the damage to that particular voxel so now that we’ve got that out of the way let’s try to actually generate something that we can visualize for this i’m going to be using purlin noise there really are a lot of good videos on youtube explaining how purlin noise Works so i won’t go into a lot of detail but i’ll give you a quick overview of what this is basically berlin noise is a type of coherent noise coherent meaning that samples close to each other will have only a slight difference in value as opposed to just random noise where every Sample is just random so how portland noise works is you have a grid of randomly generated unit vectors called gradients and when you take a sample at a specific position you first determine the grid cell where the sample lies so you know which gradients you will be using Once you have this you calculate the dot products of the gradient in every corner with the vector pointing from the sample point to the corner point then you interpolate these dot products based on the sample position so first we interpolate horizontally leaving us with two values remaining and then we Interpolate those two vertically giving us the final result if you create a texture using this and you do this for every pixel you get something like this it doesn’t look too bad but it also doesn’t really look like something that we could use to generate terrain however if we do multiple iterations of This algorithm per sample and choose different cell sizes and use different weights to add all the results together we get something like this so what i’ve just explained is the 2d variant of perlin noise but it can also be generalized to 3d or even n dimensions For now i’m just going to use 3d brilliant noise to generate some voxels but i’ll end up changing this to a combination of 2d and 3d later okay so now the only thing that is left is that we need to generate some geometry around the voxels If we would for example generate a cube for every voxel that has a value higher than some threshold we would get something that looks a bit like minecraft this is however not really the style i’m going for so instead we’re gonna use marching cubes with marching cubes you iterate over Your grid of voxels each time taking the eight voxels of the current a few moments later i have a total of 2 to the power of 8 or 256 different configurations each configuration results in a different set of triangles made up out of connecting the center lot Of boring math later we calculate and generate all of those shapes or cells it’s actually much easier to just grab a pre-made triangulation table for this off the internet and just use that So when you put everything set in this video together it looks something like this now bear in mind it doesn’t really look like terrain or anything like that yet because we’re basically just using berlin noise and nothing else we’re not like scaling the results or like shaping Them into something that we want all of that stuff will come later but now we have the foundations upon which we can build so that’s it for me for this video i hope it wasn’t too much information i don’t know yet if i’m going to upload a Video every week uh next week is mainly going to be back-end stuff where i won’t really have a lot of footage to show so depending on how that goes it might be one week or two weeks in any case i hope you enjoyed the video if you did please consider subscribing And stay tuned for more thanks Video Information
This video, titled ‘Indie Game Devlog #1: Voxel World Generation’, was uploaded by Giant Sloth Games on 2021-08-12 16:44:57. It has garnered 9778 views and 481 likes. The duration of the video is 00:05:57 or 357 seconds.
First devlog video of the voxel-based action adventure game I just started working on. It’s really, really, really, really early in development so there isn’t a whole lot to show yet. Nevertheless, I hope you guys enjoy the video.
——————————————————————–
Discord: https://discord.gg/39rerbXU8b Twitter: https://twitter.com/GiantSlothGames Videolink: https://www.youtube.com/watch?v=CLKUiZ_xSG8 Subscribe to my channel: https://www.youtube.com/channel/UCowfd_6TBOYVwuYh1ux2fQg
——————————————————————–
#devlog #indie #gamedev