Can I get a voxel up in here?

Hello everybody! First time posting on the unity forums, so forgive me if I’m a bit droll and foolish.

Here’s the deal: I’ve been working for several days now on creating a minecraftie-clone. I am well aware that this has been done before, and I’ve been trying to study other people’s work to get a better handle on what to do, and while I’ve pulled together a far greater understanding than I had before, I’m still running into a bunch of walls.

Initially, I looked to Minepackage for help, but out of that (seemingly discontinued) project, all I can manage to find is an ocean of un-commented code. My biggest focus for the past few days has been translating this javascript code entirely into C# because I’m much more well versed in C#. Here’s the place I got the code: http://unitycoder.com/blog/2012/02/1...k-renderer-js/

I translated everything into C# and linked my code to a first person controller, allowing me to destroy voxels with a mild amount of success. There are two main issues though: First, the code (in C# format) has a massively rough time properly approximating what block you’ve clicked with the raycast, and likes to occasionally give out of bounds errors. Second, unlike the webplayer (and unlike the downloadable unitypackage from that link) there is a massive lag spike when a block gets deleted; the game locks up for a full 2-4 seconds before resuming, with the block gone. For the life of me I cannot ascertain why.

I guess what I’m asking here is this: Does anybody around here have any measure of experience with voxel-ie stuff like this? Is there some better code I could use as a basis, or is there something that can be done or fixed with this to make it…well…work? All I’m trying to get down right now is a proper chunk generation and some raycasting that will completely reliably target a block.

Really sorry for the wall of text guys, and sorry I’m such a noob at something that has obviously been done before

Massive thanks to anyone who can help, or is even willing to read this! XD

Here’s some light reading for you.

I’ve already crossed paths with that thread quite a few times XD I will admit that I’m looking for some somewhat more to-the-point resources; I’ve read the first and last several pages, and it largely seemed to be people sharing their projects. I suppose that, seeing as I’m stuck now, I will finish reading the thread, but anything else would be greatly appreciated.

http://coredev.makingforum.com/f18-voxel-engine-development-blog

I started out slow, this was made when I was a complete noob.

I now know quite alot about voxels, PM me if you need anymore help!

I’ve been to your webpages as well, Myhijim! I appreciate the link, though :slight_smile: Your step-by-step walkthrough of the link I posted was one of my major starting points, so I’ve gotta thank you for that. The things that are murdering me is that it’s hard to entirely wrap my brain around the process of creating vertexes, then triangles, then the UV’s. I feel like in the code I’ve been looking at, there are a bunch of inefficiencies that I’m missing because I can’t quite grasp it all. I may be PMing you in the near future :stuck_out_tongue: