Added support for variable sizes for entities. Think this is probably sufficient for entity rendering for now, and I should start working on collision? Either that, or I should go for full skeletal animation. :/
Alright, I have collision working *mostly* correctly, though sliding along walls doesn't always work properly and it's possible to get stuck in corners. Not much to look at, but I was also poking at worldgen. Made things a bit fancier and fixed some bugs - including one where I had it generating the same chunks multiple times for no reason. Runs way better, now that I have it not doing that. :/
Or, no, actually before I do chunks I should decide how I want to deal with the data for blocks. I want to have most, or maybe even all, blocks be procedurally generated - something like Chisels & bits, except a bit more restrictive and easier to deal with. Like, there are different kinds of soil and rock, and these are procedurally generated, and then there's a process for digging up stone and turning it into bricks and the like.
The downside of all this is I'm probably going to end up with a tremendous variety of blocks, which could pose issues on the data storage front. Like, if I have, say, a couple hundred varieties of stone and soil, and then I have varients of this for each of the 15 levels of flat, plus the 6 possible half slabs, plus the 8 possible normal stairs, the 8 quarter stairs, the 8 corners, the 8 quarter blocks... We get a lot of block types. And that's not even getting into plants, furniture, etc, etc.
Maybe I should store material and shape separately? Or even material, shape, and orientation? Or, maybe I should just look up how minecraft tracks the orientation of stairs? I think they use a different system. Aaargh, I'm not even sure how to gauge the effectiveness or costs of all these options. :/
Hmm... I think I want to have render data, behavior data, and collision data all be separate class heirarchies, and then have BlockTypes that have references to each of these three things. Then, for the actual world, I have ID's for each of these block types, and maybe also store metadata if necessary? I'll have to experiment a bit to get all that working well, I think.
Not a lot to show off today, but I did some stuff behind the scenes, and now I have code for SteppedCube shapes and textures - basically, a 16x16x16 block, except missing some texels of height. See below a whole chunk of the 12 high ones.
Alright, so now I'm looking at implementing Octrees for tracking block chunks. I get the general idea, but I have a feeling the details are going to be trickier. I dunno, I'll write an implementation and then see iabout going back and changing it if necessary. :/
But, hmm. Okay. So, say I've got a solid 16^3 chunk of all one block. Should I just represent this as HomogenousChunk(block)? And, then if, say, 0,0,0 gets changed into another block, should I have a method go and replace that HomogenousChunk with an octree chunk and work it's way down the nodes? Or is this an attempt to over optimize, and I should just load it as an Octree from the start, and only worry about try to optimize to that level when I'm saving to disk?
Though, I guess at some point in my Octree I'm going to want to HomogenousChunks or whatever, even if they're 2^3 or 4^3 blocks. And I will need the capability to go and dynamically replace these with more octrees if a player goes and starts messing with them, right?
The code where it splits HomogenousChunks into OctreeChunks is particularly meh - I'ma need to do some optimization there, I think. It has a lot of unnecessary creating and then destroying of chunks. :/
Not as neat as the Octrees, but more visually noticeable - now some of the blocks are slightly bluish. Internet points to anyone who checks the code to figure out why. XD
Alright, so now I'm messing around with procedurally generated dirt textures (And eventually other textures, hopefully.) Making some progress but it needs a bit more work, I think. Code needs to be cleaned up and rewritten too. Probably looking at generating most things more like the lower left corner, obv.
Still haven't got procedural textures working to my satisfaction, I got distracted trying to figure out how to render shaders to textures. I might go back and take another crack at that, or maybe just move on. Right now I'm thinking about blocks, and whether I want to implement some kind of multipart functionality?
Like, so that you can have tables and desks covered by all sorts of stuff, or fancy woodwork with support beams and platforms, or implement a variety of different kinds of walls, and then have a bunch of different modifers - moss, cracks, scratches, crumbling bricks, bloodstains, etc, etc, and implement each of those individually, and then stack them on top of the different kinds of walls.