Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Attempt at minecraft clone  (Read 2973 times)
PaulTheAxeman
Community Member
*
Posts: 37


« on: November 03, 2010, 09:38:19 AM »

OK, I am not under any illusions of creating something as good or even close to the original with my limited skills. But I thought I'd take a crack at it and see how far I got before I got bored or used up my limited knowledge!! So far I have got some stuff displayed and working on collisions.
Logged
micmanos
Customers
Community Member
*****
Posts: 526


WWW
« Reply #1 on: November 03, 2010, 10:05:43 AM »

Looks really squppy (square and crappy) like the original Grin
I bet you can do a lot better than this but since you're replicating,  Undecided work.
Logged

PaulTheAxeman
Community Member
*
Posts: 37


« Reply #2 on: November 03, 2010, 10:33:53 AM »

Yes, as you say, square and crappy. Although saying that it is strangely addictive.  Grin
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #3 on: November 03, 2010, 12:43:47 PM »

Neat! Framerate seems acceptable too. Keep it up!
Logged

LeChuck
Community Member
*
Posts: 5


« Reply #4 on: December 14, 2010, 06:29:02 PM »

Looks very nice!!
Logged
PaulTheAxeman
Community Member
*
Posts: 37


« Reply #5 on: December 27, 2010, 06:58:02 AM »

I'll tell you something. Been working on this now off and on for a few months and I can appreciate how well the original must be coded. Obviously I'm limited to the functionality of TV3D but that's ok. But getting all those meshes onto the screen is good stuff. I have had to limit the amount the player can see into the distance compared to the original otherwise I basically run out of memory! I really need to think about using some sort of octree/bsp but the thought just makes me shudder. Cannot find any good examples in vb.net
Still trying to keep the framerate above the 60 fps mark.
But I'll carry on.  Grin
Logged
arnienet
Customers
Community Member
*****
Posts: 263


WWW
« Reply #6 on: December 27, 2010, 08:40:08 AM »

Interesting stuff. Out of interest how many cubes are you drawing at the 60 fps mark? I got about 80 fps on a 8500GT with your 1st release. I must admit that I've found TV3D the most unlimited 3D engine around. You can just about achieve anything that's possible with DX9, and at a high fps.

With the cubes, are you just drawing each one as a separate mesh, or using the duplicate mesh function (using: shareGeometry] = true) or have you tried mini meshes yet? Are you culling cubes hidden under others? Have you seen Zak's example on batched mini meshes?

I actually wrote to Notch suggesting some of these options, but no answer Grin, but it'd be interesting to see if you get a performance boost with any of them. If you're not using mini meshes for distant cubes, it'd be interesting to see what performance boost you get by switching to mini meshes.
Logged

Total Dev time = 50% to code, 50% to test, 50% to find errors, 50% to fix, that's why it takes twice as long.

Dawn World MMO
PaulTheAxeman
Community Member
*
Posts: 37


« Reply #7 on: December 27, 2010, 05:38:46 PM »



As you can see from the pic there are about 131k mini meshes being drawn. the way I believe Minecraft does it (as do I), is display all the blocks that have either Air or some transparency adjacent to them. So, if a block is in the middle of 6 Rock blocks it doesn't get displayed however if one of those blocks was say Air or a flower it would be displayed. As a consequence of this a lot of the blocks underground have to be displayed even if you don't see them from the surface (because of caves etc). I assume thats why when playing minecraft and the landscape is first being loaded/drawn you see a lot of lava/underground water etc.

I didn't even go down the road of using standard meshes because I knew there would be so many of them. Admittedly you lose a lot of functionality using minimeshes but you just have to take the hit.

Quite a big hit I have is the multi textured cubes. If you look closely at the pic you can see cubes that have a grassy on top and a grassy/soil effect on the side, what you cannot see is the soil effect underneath the cube. These are three seperate minimeshes for one cube because it needs three seperate textures. Obviously using a standard mesh I could create using sixgroups and texture the sides to suit but not with a minimesh.

The landscape is loaded in (16w x 16d x 128h blocks) and roughly 7x7 of these are loaded at any one time and as you wander around the world 16x16 blocks get removed and replaced by new ones as head in different directions.

I'm just completing the animated mini's now for things like fire and water.
I'm having to use normal meshes for certain things such as collisions etc. eg. I continually look at all the blocks surrounding the player and place transparent full meshes over the minimeshes which allows the player to walk over/jump on the cubes. A bit CPU intensive but can't see another way of doing it at the moment.

I do think I can get a bit more speed out of the application by optimizing my code, I have used the minimesh shader (not at the moment though) which does improve the FPS a bit by about 15-20%. But to get any major speed boost I will have to use batch enable/disable of meshes, I don't think there is any way out of that. So far all the processing is in the display/selection/deletion and player placement of the cubes. There is nothing in there yet for actual background gameplay as such.

Also bear in mind that I am a very old-skool VB coder. Ok, I'm doing this in VB.net but even the concept of collections and arraylists are reasonable new to me. I originally started coding this using a massive 3D array  DIM map(6000,128,6000) as INT32 !!!!!
That didn't last long before I realised that I would probably struggle with an infinite landscape.


Anyway, onward and upward......

Logged
arnienet
Customers
Community Member
*****
Posts: 263


WWW
« Reply #8 on: December 28, 2010, 10:49:20 AM »

Thanks for the details, I can see you have put a lot of thought into the work, nice Smiley I have a 2 or 3 casual suggestions which may be of help:

Quote
These are three separate minimeshes for one cube because it needs three seperate textures.

You could create a texture containing all 3 separate textures, create a single mesh for each variation required, then I'm sure you can create a mini mesh from a standard mesh, this may make a performance difference, although I think mini meshes don't cull back faces, but you could accomplish this in the shader.

Quote
I continually look at all the blocks surrounding the player and place transparent full meshes over the minimeshes which allows the player to walk over/jump on the cubes

Good idea, as you process the 7x7 grid every time the player moves by 1 unit, you could thread it if it becomes jerky during the update. It might be worthwhile replacing the mini meshes with standard meshes for collision testing if drawing transparent meshes over the mini meshes causes a drop in fps due to alpha testing. Also if you disable the mesh group it won't be drawn (I think removing the alpha test), but will still be detectable for collisions. Also TV3D Newton Physics collision detection is quicker than the scene collision detection (tedlin01's has experimented with that recently).

Quote
As a consequence of this a lot of the blocks underground have to be displayed even if you don't see them from the surface (because of caves etc)

You could extend your 7x7 grid to cull any batches of blocks which are not visible in 3D space (7x7x7) and update as you get within 7xn of that grid along the preferred axis.

Anyway good work and all the best with it.
« Last Edit: December 28, 2010, 10:51:33 AM by arnienet » Logged

Total Dev time = 50% to code, 50% to test, 50% to find errors, 50% to fix, that's why it takes twice as long.

Dawn World MMO
PaulTheAxeman
Community Member
*
Posts: 37


« Reply #9 on: December 30, 2010, 05:30:55 PM »

Good suggestions. Especially like the 7x7x7 3d space idea. Currently got the physics engine running and trying the collisions out. Trying to implement new things as quick as possible so I don't get bored !!

Will keep this thread updated on my progress for as long as possible or until the project runs its course anyway  Wink

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks