Another Boring Blog Update. && MineCraft.Clone()

So right what have I been doing, what have I been doing hmmm… well I did go on about uni work and not having enough time for anything it seems very much true, even lost a very beautiful young girl over the matter. But life shall go on.

Right Updates
Coming up to the end of uni, really need to work on dissertation, engines still absolutely terrible and I’m absolutely starting to freak out about the whole deal, but I’m pretty sure that’s the same for most students. As far as the actual engines concerned I’ve done “little” work little in the sense that there’s so much to do at the moment I’ve barely dented the surface. So many problems cropping up, bad code things I regret.

Engine Updates -> About 4 days ago I decided to start making a Minecraft Clone on my engine has been coming together very quickly. Screenshots below from the start to now. Texture Pack credit should be directed to BDCraft.net.

1) Modded/ Hacked the existing TileMap class to add an extra Dimension, For those/ everyone that doesn’t know the TileMap class in my engine used a chunk based system in conjunction with opengl’s diaplay lists (Don’t Judge) to render some pretty large maps.

1956921_10202439013431322_1524535922_o

2) My engine has little in the side of physics at the moment, box2d can technically be used but is not supported, So I added a few new colliders to the engines native physics system, this included an AABB(Axis Aligned Bounding Box) and a Ray. The systems very much brute force at the moment, but is currently not much of a concern as we will be working on a grid area with a limited number of collidable objects. Using these two new objects I went about creating another class to handle the collisions in the world itself a new type known as CubeMapCollider, it takes a reference to the CubeWorld and uses this to basically  work out collisions that may be occurring. When checking for collisions in the world from a ray the CubeMapCollider will work out a set of tiles within the bounding volume of the ray before then checking each tile/ block to see if a collision has occurred, after computing the collisions and distance it will work out the collider object which is first struck. At the stage depicted below, the actual collision algorithm was slightly questionable, at this moment in time I had not worked out how to detect which specific face the ray had collided with on the AABB so for the time being I just added a new tile above which ever tile the ray collided with when the right mouse button was pressed.10001014_10202446571780276_20289126_o

3) At this point I was working primarily on optimizations(reducing memory usage, increasing FPS), I made sure only clockwise winding faces are drawn for a start, then I moved onto culling sides of the blocks that where not visible, and various other optimizations. in the end I managed to render a world consisting of over 2 million cubes-> to quote myself on facebook: “current rendering a cube world of 256X32X256 with chunks of 32X32X32 so around 64 chunks with a total of 2,097,152 blocks in the world and getting between 290 – 320 FPS on my computer. Not bad.”

1622322_10202447888133184_453004971_o

4)The culling of hidden faces left it problematic when dealing with blocks with transparent textures, Its an easy fix but is not fixed yet.

1899559_10202455806291133_1465358359_o

5)By this point I had got the ray AABB intersect perfect next was to work out which face was hit first by the ray and to be able to place blocks attached to said face.1799077_10202455691328259_1619101935_o

6) Just rendered out 4 chunks of 32X32, messed around a bit as I plan to start to think about chunk + world generation. 1397065_10202457575775369_1406873529_o

6) Finally got collisions down flawlessly I might add.. 1956959_10202459074852845_859077590_o

7)Added functionality that makes it possible to destroy blocks.1891349_10202461294628338_428069606_o

comments

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

WP-SpamFree by Pole Position Marketing