Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

After playing minecraft...

Discussion in 'General Discussion' started by jc_lvngstn, Oct 8, 2010.

Thread Status:
Not open for further replies.
  1. HeadHunter

    HeadHunter

    Joined:
    Dec 17, 2011
    Posts:
    53
    We made snow and rain a little ease way. We just check for player position and enable disable snow or rain particles around player. This not exactle whot you try to make but at least this work fast on mobile and looks pretty cool too.

    Minecraft rain looks wery cool. Any idea how they made it?
     
  2. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Done!



    I use the particle system but don't control particle collisions, instead I control particle lifetimes. I know the height a particle falls from, the height it should die at, and I know its velocity, so: lifetime = (h1-h2) / velocity.

    PS
    Here comes the rain. No code changes, just some tweaked parameters.

     
    Last edited: Jun 20, 2012
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350
    so, unity4 should bring move power to create mesh terrains etc?

    - Geometry data improvements for huge memory and performance savings
    - Meshes can be constructed from non-triangle geometry - render points lines efficiently
    - dx11/gpu stuff?
     
  4. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    It's hard to say what it means, I'm waiting for details.
     
  5. HeadHunter

    HeadHunter

    Joined:
    Dec 17, 2011
    Posts:
    53
    I hope they will fix some shaders dont work right on mobile, and multithreading for Resource.Load

    And i think to upgrade to Unity 4 i need to pay around 1600$ for Pro update, and Android Pro. Unity 3.x dont uodated to 4.x for free(
     
    Last edited: Jun 22, 2012
  6. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    More aggressive weather effects:





     
    Deon-Cadme likes this.
  7. HeadHunter

    HeadHunter

    Joined:
    Dec 17, 2011
    Posts:
    53
    Looks wery cool)
    How fast this work?
     
  8. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    1920x1080, HD6950, i5-2500@4GHz, graphics settings all max except anti-aliasing.

    Summer
    Clear weather: 420 fps
    Rainfall: 330 fps

    Particles update ― 30 µs

    Winter
    Clear weather: 600 fps (no grass)
    Snowfall: 300 fps

    Particles update ― 120 µs
     
    Last edited: Jun 22, 2012
  9. HeadHunter

    HeadHunter

    Joined:
    Dec 17, 2011
    Posts:
    53
    Thanks. I think this will be too slow on mobile.
    But idea wery cool. Have you plan to add water uppearence with rain like you made for snow?
     
  10. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Alexzzzz your works looks great, grats on what you have achieved so far. Good luck!
     
  11. HeadHunter

    HeadHunter

    Joined:
    Dec 17, 2011
    Posts:
    53
    Today we add amazing Boat :D
     
  12. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    I'm still experimenting with weather and seasons.



    I don't know yet how it should look.
     
    Last edited: Jun 24, 2012
    Deon-Cadme likes this.
  13. HeadHunter

    HeadHunter

    Joined:
    Dec 17, 2011
    Posts:
    53
    Dont your water liquid phisicks support this? From video you post before it looks real.
     
  14. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    My water simulation doesn't run in open world yet, and if an active water block touches ocean water blocks, performance drops in geometric progression each frame. I haven't modified the water simulation code much since that demo video.
     
  15. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Incredible!
    My 2 cents: grass looks a bit to "wide"
     
  16. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Agree. This is a self-made texture of something green that was supposed to look like grass. The internet lacks good grass billboard textures, even paid ones.

    Either such textures are very easy to make (as to me, they are not), or it's a market niche for artists that hasn't been occupied yet.

    The only grass texture pack I have found and that looks "normal" is this: http://3docean.net/item/grass-billboard-texture-pack/88229 , but I don't like its regular license, and the extended one seems expensive to me.

    It also may be that I just don't know the proper keywords to look for such textures.
     
    Last edited: Jun 26, 2012
  17. Darkjayson

    Darkjayson

    Joined:
    Jun 1, 2012
    Posts:
    233
    Can you not just scan some actual grass and use that?
     
  18. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    For me tweaking code is easier than tweaking images. I would better write a grass texture generator. :)
     
  19. Darkjayson

    Darkjayson

    Joined:
    Jun 1, 2012
    Posts:
    233
    I was wondering have you decided what game your going to make using what you developed? See i love minecraft got it when it was in alpha but even after it got released its not much of a game, its a great block building thing and fun to play with but after a while it gets boring as there's nothing to do not much game play. And while your version looks a lot better still it only does what minecraft does. You need to think of what game to use it for. Or are you just making it cos you want to? Not sure if you said before but it would be hard reading through two years and 54 pages of posts to find out.
     
  20. Foam

    Foam

    Joined:
    Jun 13, 2012
    Posts:
    322
    Anyone have any tips for speeding up terrain generation?

    Right now I've got:

    a) 1 circular array for noise/density, where finding a neighbor only requires addition
    b) 1 circular array for lights, with a recursive flood-fill algorithm
    c) Perlin noise with Turbulence, but it's calculated per point... which seems rather inefficient (i.e. I feel like it's calculating neighbor noise and interpolating about 8 times more than necessary, per point)
    d) your usual mesh generation... check if a neighbor is air, and, if so, generate the two triangles (3 vertices per triangle).
    e) i'm still using collision meshes, which is just a copy of the displayed mesh

    Depending on how things go, though, that's about 4.5s for Noise, 4.5s for Lights, and 7s for meshes. (16x16x128 meshes @ 10x10 meshes for 3.2 mil points). Actually, sometimes mesh generation can take twice or even three times longer, but I haven't figured out why yet.

    It's not bad, but, at 160ms per chunk, give or take, I'd obviously like to get this down to about 16ms.


    Note: I haven't profiled my code yet. I'm just looking for general insights to things that really made a huge jump in speed for any of you. In particulkar for lighting and mesh generation, as Noise doesn't matter that much as it doesn't really have to be calculated on the fly in the same way.
     
    Last edited: Jun 27, 2012
  21. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Here's a grass texture for you. I can change color, shape, length, density ...
     

    Attached Files:

  22. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    DarkJayson,

    At this very moment I'm not writing a game yet, I'm writing an engine and it's just fun to do per se. I would like to know what is possible to do in block world, and what is not, so I'm experimenting with it, trying to find out how different gameplay ideas might [not] be implemented, what pros, cons, and limitations exist.

    When/if I start to write a game, it will be a kind of survival in aggressive environment game (on a desert island or something like that) with construction, hunting, farming etc. What I can definitely say, giant penises, death stars and magic will not be possible.
     
    Last edited: Jun 27, 2012
  23. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    botumys,

    The texture doesn't suit very well. Its lower part is too much darker than the upper part, it's hard, if possible, to make the grass brightness fit the ground brightness. And also it is not seamless along x-axis, that is a useful feature for a grass texture.

    I tried one of the standard grass textures from Terrain Assets. It doesn't look that nice itself but looks better in the scene. However, it's not seamless along x-axis too.





     
    Last edited: Jun 27, 2012
  24. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Are these total times for the whole scene or you meant milliseconds?

    What are the times per chunk for light propagation and for mesh generation (without assigning it to MeshFilter)?

    Two useful classes:

    MicroStopwatch (taken from http://www.codeproject.com/Articles/98346/Microsecond-and-Millisecond-NET-Timer)
    and
    PerformanceMonitor

    Usage:
    Code (csharp):
    1. var timer = new MicroStopwatch();
    2. timer.Start();
    3.  
    4. // performance-critical code
    5.  
    6. timer.Stop();
    7. PerformanceMonitor.IncrementCounter("name", timer.ElapsedMicroseconds);
    Code (csharp):
    1. foreach (var counter in PerformanceMonitor.Counters)
    2. {
    3.     Debug.Log(string.Format("{0}, total time: {1}, average: {2}, last: {3}, max: {4}, count: {5}", counter.Name, counter.Time, counter.Average, counter.Last, counter.Max, counter.Count));
    4. }
     
    Last edited: Jul 13, 2012
  25. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    I feel your pain about grass. It seems like with grass and ground textures...anything that isn't a simple color ("Bland") tends to look odd. At least when I do it.

    Especially ground textures. Anything that has any variety ends up tiling horribly :|

    Personally, I think the grass01 texture above has great grass pixels, it's just the color...is it -too- green? Maybe if you lightened the color up a bit, like the one on the right.
     
  26. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707

    Maybe the saturation is to high. I can give you a grass texture for the ground matching the grass billboard texture? Or I can change saturation and attenuate the darker part. It's possible to tile the texture in x axis, but when the geometry is cut, you'll see the cut in the texture too ?
     
  27. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    I've desaturated it a bit and now it suits both of my ground textures



    So, two problems left: too dark bottom and seam...ness or seamlesslessness (don't know how to call it:))

    In reality it's barely visible, it's not a problem.

    BTW, how do you create these green areas around stems?
     
    Last edited: Jun 27, 2012
  28. HeadClot

    HeadClot

    Joined:
    Jan 23, 2010
    Posts:
    212
    Hey, AlexZ

    I sent you a PM about your block engine.
     
  29. Foam

    Foam

    Joined:
    Jun 13, 2012
    Posts:
    322
    Seconds---those are total times for the scene. I am generating 16x16x128 chunks/meshes at 10x10, so, 100 of them. For all of those combined, it is ~4.5s for noise generation, ~4.5s for light generation, and ~7s for mesh generation. This isn't on anything special---Macbook Air, so, 1.7GhZ dual-core, but, still...

    I will have to check this evening what exactly is consuming the time in the mesh loop, but, IIRC I took out the assignment to MeshFilter and the CalcNormals stuff and it only shaved off about 1.5s total.


    At 16s for 10x10x16x16x128, that results in about 160ms per 16x16x128 chunk for everything.

    What bothers me now is the mesh generation as the noise generation doesn't matter too much and I'm pretty sure my Flood Fill algorithm is about as inefficient as it can get.
     
  30. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    If you paste some code samples it will be easier to figure out what exactly wastes the time.

    I don't calculate normals, I manually add them to a mesh together with vertices,
     
  31. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Ok, I'll give you the new map this afternoon.
     
  32. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Thats one very pretty minecraft clone! : D
     
  33. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Hi, here's 3 new grass bilb. textures.
    The last one is can be tilled horizontally. I changed a bit the saturation and darker area.
    don't hesitate if you want changes.

    o.

    for the green areas, it's coming from png saving compression, but if you want, I can
    send you images in tga with a blend color around the mask.
     

    Attached Files:

    Last edited: Jun 28, 2012
  34. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    botumys,
    Thanks, I'll try them later this evening.

    Why I'm asking is because I have two or three dozens of self-made leaves textures for trees in .psd with explicit alpha-channel. These textures being used in clip-shader often produce white borders around the leaves. In order to get rid of that undesirable effect I have to create a solid green background under the leaves layer. It changes white borders to green borders which look better, but if I could clone and shift the edge pixels of leaves, it would look just the way it should. The problem is that I don't know and can't find what tool can make this cloning/shifting.
     
    Last edited: Jun 28, 2012
  35. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Maybe this website can help you : http://vterrain.org/Plants/Alpha/

    How, and in this page there is a link for a free photoshop plugin called "Solidify B" include in
    the free plugin pack. : http://answers.unity3d.com/questions/10302/messy-alpha-problem-white-around-edges.html
     
    Last edited: Jun 28, 2012
  36. David Brownz

    David Brownz

    Joined:
    Jun 28, 2012
    Posts:
    4
    Definatly i enjoyed the game a lot but i am quit disappointed with the speed. Animation and video quality is good so if anyone is thinking to play minecraft so i will suggest to play this is very enjoyable.
     
  37. pete

    pete

    Joined:
    Jul 21, 2005
    Posts:
    1,647
    http://docs.unity3d.com/Documentation/Manual/HOWTO-alphamaps.html

    Great stuff, Alex! Lurking a lot and really like what you (and everyone else) have been doing. Anyway, the link above has a download for some Pshop actions that dilate the texture to get rid of the white border. Hope it helps... cheers!
     
  38. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    botumys, pete,

    Thanks!

     
  39. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Botumys, can you give some insight on how you create your grass? It's very nice!
     
  40. JamesPro

    JamesPro

    Joined:
    Mar 5, 2012
    Posts:
    509
    I am messing around with one of the Voxel packages I believe the one that jc_lvngstn started as opensource. Right now it doesn't support unlimited sized worlds and if I increase it by any more then the current 16 chunks by 1 chunk by 16 chunks that it current is set to it crashes with a error saying that the heap is to big or something like that.

    So any hints on how to get it to support unlimited sized terrain? I am sure I will need to load and unload chunks as the player moves around it's just programming that that I am unsure of...
     
  41. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Hi, I'm using maya and paint effects. I created a little library of grasses and by changing one or two variables, I can generate infinity
    grasses maps, the same for little bushes, flowers...
     
  42. Ravart

    Ravart

    Joined:
    Mar 9, 2011
    Posts:
    42
    Well, today i officially announce that i'm joining the fray with my own engine.
    I was building something on my own, when i thought, lets see what other people did. And its really amazing!
    My Engine creates Vertices and Meshes on the run, probably similar to Alexzzzz engine, but I stuck with the random landscape generation.
    How do you create such beautiful landscapes? I don't need code, but im thankful for any hint in the right direction! Thanks!

    Next time I show some screens (when the Landscape generator works)!

    PS:
    Alexzzzz great work, your screens really inspired me in many aspects and I hope to see some more in the future.
     
  43. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    That looks great! Love the grass!
     
  44. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Your screenshots are amazing! Let's all put Notch out of business!
     
  45. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Alexzzz, don't hesitate if you need other maps or objects. I can provide you flowers, bushes or 3d objects.
     
  46. Ravart

    Ravart

    Joined:
    Mar 9, 2011
    Posts:
    42
    @SevenBits: Let's all put Notch out of business!
    Agree, since he more or less abandoned minecraft!!

    @botumys:
    Do you have some tree/bark texture for me? And maybe some leaf texture?
    My trees are build similar to FarCry2, but im lacking a good test texture map
     
  47. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Now I'm trying to implement block physics. There are some bugs, glitches, and wtf's, but the outlook is positive.



     
  48. Foam

    Foam

    Joined:
    Jun 13, 2012
    Posts:
    322
    Alex,

    How'd you handle the highlighting of the block that is to be acted upon? (i.e. the one that is going to be destroyed or the one that is going to be built next to)

    Shader?

    Thanks,
    Foam
     
  49. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Foam, what exactly you'd like to know? Which block to highlight, or how to highlight, or else...

    1. Using a 2D-noise function create a height map for plains and hills. Let's name it h1.
    2. Create a second height map of higher amplitude for mountains. Let's name it h2.
    3. Make solid every block that lies between y=0 and y=h1.
    4. For every y-coordinate between h1 and h2 calculate a value of 3D-noise function. If it's higher than some constant, there should be a solid block, otherwise an empty block.

    It won't give you a gorgeous terrain, but it's a good point to start from.
     
  50. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    I've found a quite easy way to reduce visual tiling of ground textures - just make their mip maps more blurry than they usually are:

     
    Brendonm17 likes this.
Thread Status:
Not open for further replies.