Search Unity

After playing minecraft...

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

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

    Arddra

    Joined:
    Jan 15, 2012
    Posts:
    5
    Interesting points. He sounded like a pretty reasonable and enthusiastic guy, so hopefully he'll extend his benchmarking and we'll learn something new.
     
  2. GibTreaty

    GibTreaty

    Joined:
    Aug 25, 2010
    Posts:
    792
    I'm going to try to make my own run-length encoding script (unless anyone has some that they'd like to share). The ones that I've found through google are either over-the-top or we're not allowed to use.

    Edit:

    So I've got some sort of run-length encoding going. It puts the info inside a list of KeyValuePairs.

    Block.Grass = 1
    Block.Dirt = 2

    Code (csharp):
    1.  
    2. Block[] fakeBlocks = new Block[]{
    3.             Block.Grass,
    4.             Block.Grass,
    5.             Block.Grass,
    6.             Block.Grass,
    7.             Block.Dirt,
    8.             Block.Dirt,
    9.             Block.Dirt,
    10.             Block.Grass,
    11.             Block.Grass,
    12.             Block.Grass,
    13.             Block.Grass,
    14.             Block.Grass,
    15.         };
    16.  
    17.         byte[] byteArray = new byte[fakeBlocks.Length];
    18.         for(int i = 0; i < fakeBlocks.Length; i++) {
    19.             byteArray[i] = (byte)fakeBlocks[i];
    20.         }
    21.  
    22.         List<KeyValuePair<int,byte>> lookupTable = new List<KeyValuePair<int, byte>>();
    23.  
    24.         int runLength = 1;
    25.  
    26.         for(int i = 0; i < byteArray.Length; i++) {
    27.             if(i + 1 < byteArray.Length) {
    28.                 if(byteArray[i + 1] == byteArray[i]) {
    29.                     runLength++;
    30.                 }
    31.                 else {
    32.                     lookupTable.Add(new KeyValuePair<int, byte>(runLength, byteArray[i]));
    33.                     runLength = 1;
    34.                 }
    35.             }
    36.             else {
    37.                 lookupTable.Add(new KeyValuePair<int, byte>(runLength, byteArray[i]));
    38.             }
    39.         }
    40.  
    41.         Debug.Log(lookupTable.Count);
    42.  
    43.         foreach(KeyValuePair<int, byte> pair in lookupTable) {
    44.             Debug.Log(pair.ToString());
    45.         }
    46.  
    How would I go about saving a list of KeyValuePair<int, byte> to a file and still be able to read it back into the program?

    Edit2: Maybe I could save it with multiple lines...
    int
    byte
    int
    byte
    ...
    4
    1
    3
    2
    5
    1
    ...
    which would translate to
    4
    Block.Grass
    3
    Block.Dirt
    5
    Block.Grass

    Edit3: I just realized I could also save the int and byte pair as a list of 4 bytes + 1 bytes. Whooza!
    Edit4: To make it worth it though, I would have to save a minimum of 5-6 blocks or else the file would get larger than just saving just the blocks/bytes.
     
    Last edited: Jan 18, 2012
  3. Tsarpf_legacy

    Tsarpf_legacy

    Joined:
    Sep 22, 2011
    Posts:
    17
    Got the trial for unity pro to profile my code... Deep profiling just makes it run out of memory, and non-deep is too basic to contain anything interesting. Also tried adding Profiler.BeginSample("asdf); and deleting all the cpu/memory/etc profilers but it just keeps running out of memory.

    Is there a way to disable all other profiling, but get deep profiling for the part I've specified?

    I'm really stuck with my project because I can't get the infinite map to work smoothly and it's really frustrating. I don't even have shadows or anything... Guess I'll continue poking the profiler hoping I'll find something...
     
  4. Tomo-Games

    Tomo-Games

    Joined:
    Sep 20, 2010
    Posts:
    223
    Well this site looks like a decent place to start minecraft dev. There are various built from scratch project links provided covering most topics. There are some C# libraries that could potentially plug into the Unity Engine after some tinkering. LibMinecraft looks hot off the press. :cool:
     
  5. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Has anyone thought about using light probes to simulate lighting for dynamic objects?

    This is the problem, light probes probably could solve:

     
  6. GibTreaty

    GibTreaty

    Joined:
    Aug 25, 2010
    Posts:
    792
    Finally after searching for so long I've figured out why the errors were showing thanks to this thread, http://forum.unity3d.com/threads/66386-damage-mesh-error . It's so simple that I just want to slap myself. All I had to do was put in one line, mesh.Clear(). So once I'm done solving a few more generation problems there will be a new version. But for now I'll reupload Free Terrain 2 and you can all have at it. It has a few hiccups but I'm hoping the new version will be faster.

    Free Terrain 2.1
     
    Last edited: Jan 24, 2012
  7. GibTreaty

    GibTreaty

    Joined:
    Aug 25, 2010
    Posts:
    792
    Sorry for the double post but I've got the newer better version of Free Terrain ready. It's still got some hiccups when creating terrain. It lags a bit and sometimes it creates cube-mesh-pits which I'll look into fixing.

    Features include -
    Auto-mesh deformation (can be turned off inside the WorldManager script by changing enableMeshDeformation to false)
    Faster terrain generation
    Bump mapping (to disable bump mapping, switch to the Terrain material and in the WorldManager script change generateTangents to false)

    Free Terrain 3

    If you have any errors or problems just let me know.

    Edit:
    Sometimes it stops generating at all which is really frustrating.

    Edit2:
    Nevermind that last line, I had just forgot to change which Transform I was tracking.
     
    Last edited: Jan 26, 2012
  8. Mark-Davis

    Mark-Davis

    Joined:
    Jun 21, 2011
    Posts:
    156
    I'll second that. Very nice work!
     
  9. Mark-Davis

    Mark-Davis

    Joined:
    Jun 21, 2011
    Posts:
    156
    Just in case anyone's interested... I just released a new version of Voxelform to the Asset Store a few weeks ago, now with virtually unlimited multi-material support and more advanced shaders. It's pretty similar to many of the engines seen on this forum but uses the Marching Cubes algorithm for deformable organic voxel terrain.

    There are several new demos located here:

    http://www.voxelform.com/demos.html
     
  10. GibTreaty

    GibTreaty

    Joined:
    Aug 25, 2010
    Posts:
    792
    Hey Mark I have a question for you. Can VoxelForm be used in the free version of Unity? It looks awesome and it's so tempting to buy it.
     
  11. Mark-Davis

    Mark-Davis

    Joined:
    Jun 21, 2011
    Posts:
    156
    Thanks so much! Definitely! The full API and all the shaders are built to work from within Unity Free. There is an experimental editor extension that requires Pro, but it's not required and all the demos (including the editor demo) were built for Unity Free.
     
    Last edited: Jan 26, 2012
  12. Tsarpf_legacy

    Tsarpf_legacy

    Joined:
    Sep 22, 2011
    Posts:
    17

    I'm trying to create something similar to what alexzzzz made here, but for some reason I'm having really difficult time figuring it out. Could someone link me something helpful, or even share the full code? I understand if you don't want to share the full code but even some of it could really help me.
     
  13. Bezduch

    Bezduch

    Joined:
    Jan 27, 2012
    Posts:
    24
    I love what I see here :).
    You guys are doing this only for your own pleasure ( just checking the technology, testing new idea, creating benchmarks etc. ), or are you planning to create full game from this ?
     
  14. HeadHunter

    HeadHunter

    Joined:
    Dec 17, 2011
    Posts:
    53
  15. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    I have been thinking about creating trees from the beginning, and haven't decided yet what type of trees to choose.

    1. Minecraft-style



    Look: primitive
    Implementation: easy
    Lighting: very easy
    Growth: yes
    Physics: none

    2. Blokworld-style



    Generally the same as above, but looks a bit better because of the round trunk, which also makes it harder to create big trees with multiple branches.

    3. My engine 6 months ago



    These palms are combined of two elements: trunk sections and leaves. The bigger the tree, the more trunk sections it has, and the bigger the leaves.

    Look: a bit nicer than minecraft trees
    Implementation: easy for palms, harder for other kinds of trees
    Lighting: moderate, via vertex colors
    Growth: yes, very easy for palms
    Physics: can be applied

    4. Untiy's Tree manually placed on the terrain





    Look: pretty nice
    Implementation: easy
    Lighting: probably hard. Imagine the tree is placed in a cave instead of in open area. Proper lighting must be simulated using a set of point lights or maybe light probes.
    Growth: no; can be simulated with several prefabs of different sizes.
    Physics: I can't imagine how it should look like when a player cuts this tree.

    --
    Do you have any other ideas of how trees might look like?
     
    Last edited: Jan 29, 2012
  16. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Here are my sources but I can't really explain how they work better than I have already done. I can hardly understand myself how DivideIntoRectangles method works :)

    Code (csharp):
    1. public void GenerateChunkColliderGeometry()
    2. {
    3.     var timer = new Stopwatch();
    4.     timer.Start();
    5.  
    6.     _colliderGeometry = Pools.GeometryPool.GetItem();
    7.     var layer1 = new bool[Constants.CHUNK_WIDTH, Constants.CHUNK_WIDTH];
    8.     var layer2 = new bool[Constants.CHUNK_WIDTH, Constants.CHUNK_WIDTH];
    9.  
    10.     ///////////////////////////////////////////////////////////////////////////////////////////
    11.     // Generate up and down
    12.     for (int wy = _y0 + Constants.CHUNK_WIDTH - 1; wy >= _y0; wy--)
    13.     {
    14.         if (wy == 0 || wy == Constants.WORLD_HEIGHT - 1)
    15.         {
    16.             continue;
    17.         }
    18.         int faceCountUp = 0;
    19.         int faceCountDown = 0;
    20.         for (int wx = _x0; wx < _x0 + Constants.CHUNK_WIDTH; wx++)
    21.         {
    22.             int pointer = Data.CalculatePointer(wx, wy, _z0);
    23.             for (int wz = _z0; wz < _z0 + Constants.CHUNK_WIDTH; wz++, pointer += Data.NEXT_Z)
    24.             {
    25.                 // Up
    26.                 var block = _data.blocks[pointer];
    27.                 var neighbour = _data.blocks[pointer + Data.UP];
    28.                 var needsFace = block.IsCollidable  neighbour.IsNotCollidable;
    29.                 if (needsFace)
    30.                 {
    31.                     faceCountUp++;
    32.                 }
    33.                 layer1[wx - _x0, wz - _z0] = needsFace;
    34.  
    35.                 // Down
    36.                 neighbour = _data.blocks[pointer + Data.DOWN];
    37.                 needsFace = block.IsCollidable  neighbour.IsNotCollidable;
    38.                 if (needsFace)
    39.                 {
    40.                     faceCountDown++;
    41.                 }
    42.                 layer2[wx - _x0, wz - _z0] = needsFace;
    43.             }
    44.         }
    45.         if (faceCountUp > 0)
    46.         {
    47.             DivideIntoRectangles(layer1, faceCountUp, FaceDirection.Up, _colliderGeometry, wy - _y0);
    48.         }
    49.         if (faceCountDown > 0)
    50.         {
    51.             DivideIntoRectangles(layer2, faceCountDown, FaceDirection.Down, _colliderGeometry, wy - _y0);
    52.         }
    53.     }
    54.  
    55.     ///////////////////////////////////////////////////////////////////////////////////////////
    56.     // Generate north and south
    57.     for (int wz = _z0; wz < _z0 + Constants.CHUNK_WIDTH; wz++)
    58.     {
    59.         int faceCountNorth = 0;
    60.         int faceCountSouth = 0;
    61.         for (int wx = _x0; wx < _x0 + Constants.CHUNK_WIDTH; wx++)
    62.         {
    63.             int pointer = Data.CalculatePointer(wx, _y0, wz);
    64.             for (int wy = _y0; wy < _y0 + Constants.CHUNK_WIDTH; wy++, pointer += Data.NEXT_Y)
    65.             {
    66.                 // North
    67.                 var block = _data.blocks[pointer];
    68.                 var neighbour = _data.GetBlock(wx, wy, wz + 1);
    69.                 var needsFace = block.IsCollidable  neighbour.IsNotCollidable;
    70.                 if (needsFace)
    71.                 {
    72.                     faceCountNorth++;
    73.                 }
    74.                 layer1[wx - _x0, wy - _y0] = needsFace;
    75.  
    76.                 // South
    77.                 neighbour = _data.GetBlock(wx, wy, wz - 1);
    78.                 needsFace = block.IsCollidable  neighbour.IsNotCollidable;
    79.                 if (needsFace)
    80.                 {
    81.                     faceCountSouth++;
    82.                 }
    83.                 layer2[wx - _x0, wy - _y0] = needsFace;
    84.             }
    85.         }
    86.         if (faceCountNorth > 0)
    87.         {
    88.             DivideIntoRectangles(layer1, faceCountNorth, FaceDirection.North, _colliderGeometry, wz - _z0);
    89.         }
    90.         if (faceCountSouth > 0)
    91.         {
    92.             DivideIntoRectangles(layer2, faceCountSouth, FaceDirection.South, _colliderGeometry, wz - _z0);
    93.         }
    94.     }
    95.  
    96.     ///////////////////////////////////////////////////////////////////////////////////////////
    97.     // Generate east and west
    98.     for (int wx = _x0; wx < _x0 + Constants.CHUNK_WIDTH; wx++)
    99.     {
    100.         int faceCountEast = 0;
    101.         int faceCountWest = 0;
    102.         for (int wy = _y0; wy < _y0 + Constants.CHUNK_WIDTH; wy++)
    103.         {
    104.             int pointer = Data.CalculatePointer(wx, wy, _z0);
    105.             for (int wz = _z0; wz < _z0 + Constants.CHUNK_WIDTH; wz++, pointer += Data.NEXT_Z)
    106.             {
    107.                 // East
    108.                 var block = _data.blocks[pointer];
    109.                 var neighbour = _data.GetBlock(wx + 1, wy, wz);
    110.                 var needsFace = block.IsCollidable  neighbour.IsNotCollidable;
    111.                 if (needsFace)
    112.                 {
    113.                     faceCountEast++;
    114.                 }
    115.                 layer1[wy - _y0, wz - _z0] = needsFace;
    116.  
    117.                 // West
    118.                 neighbour = _data.GetBlock(wx - 1, wy, wz);
    119.                 needsFace = block.IsCollidable  neighbour.IsNotCollidable;
    120.                 if (needsFace)
    121.                 {
    122.                     faceCountWest++;
    123.                 }
    124.                 layer2[wy - _y0, wz - _z0] = needsFace;
    125.             }
    126.         }
    127.         if (faceCountEast > 0)
    128.         {
    129.             DivideIntoRectangles(layer1, faceCountEast, FaceDirection.East, _colliderGeometry, wx - _x0);
    130.         }
    131.         if (faceCountWest > 0)
    132.         {
    133.             DivideIntoRectangles(layer2, faceCountWest, FaceDirection.West, _colliderGeometry, wx - _x0);
    134.         }
    135.     }
    136.  
    137.     timer.Stop();
    138.     PerformanceStatistics.IncrementMeshColliderCounter(timer.ElapsedMilliseconds);
    139. }
    Code (csharp):
    1. private void DivideIntoRectangles(bool[,] side, int totalCount, FaceDirection faceDirection, Geometry geometry, int layer)
    2. {
    3.     int sideSize = side.GetLength(0);
    4.     int faceCounter = 0;
    5.     for (int v = 0; v < sideSize; v++)
    6.     {
    7.         for (int h = 0; h < sideSize; h++)
    8.         {
    9.             if (side[v, h] == false)
    10.             {
    11.                 if (faceCounter == totalCount)
    12.                 {
    13.                     return;
    14.                 }
    15.                 continue;
    16.             }
    17.  
    18.             faceCounter++;
    19.  
    20.             int hEnd = h;
    21.             for (int h2 = h + 1; h2 < sideSize; h2++)
    22.             {
    23.                 hEnd = h2;
    24.                 if (side[v, h2] == false)
    25.                 {
    26.                     hEnd = h2 - 1;
    27.                     break;
    28.                 }
    29.             }
    30.             int hSize = hEnd - h + 1;
    31.  
    32.             int vEnd = v;
    33.             for (int v2 = v + 1; v2 < sideSize; v2++)
    34.             {
    35.                 vEnd = v2;
    36.                 for (int h2 = h; h2 < h + hSize; h2++)
    37.                 {
    38.                     if (side[v2, h2] == false)
    39.                     {
    40.                         vEnd = v2 - 1;
    41.                         goto exit;
    42.                     }
    43.                 }
    44.             }
    45.         exit:
    46.             int vSize = vEnd - v + 1;
    47.  
    48.             for (int v2 = v; v2 < v + vSize; v2++)
    49.             {
    50.                 for (int h2 = h; h2 < h + hSize; h2++)
    51.                 {
    52.                     side[v2, h2] = false;
    53.                 }
    54.             }
    55.  
    56.             switch (faceDirection)
    57.             {
    58.                 case FaceDirection.Up:
    59.                     {
    60.                         float x = v - .5f;
    61.                         float y = layer + .5f;
    62.                         float z = h - .5f;
    63.                         geometry.AppendUpFaceCollider(x, y, z, vSize, hSize);
    64.                     }
    65.                     break;
    66.                 case FaceDirection.Down:
    67.                     {
    68.                         float x = v - .5f;
    69.                         float y = layer - .5f;
    70.                         float z = h - .5f;
    71.                         geometry.AppendDownFaceCollider(x, y, z, vSize, hSize);
    72.                     }
    73.                     break;
    74.                 case FaceDirection.North:
    75.                     {
    76.                         float x = v - .5f;
    77.                         float y = h - .5f;
    78.                         float z = layer + .5f;
    79.                         geometry.AppendNorthFaceCollider(x, y, z, vSize, hSize);
    80.                     }
    81.                     break;
    82.                 case FaceDirection.South:
    83.                     {
    84.                         float x = v - .5f;
    85.                         float y = h - .5f;
    86.                         float z = layer - .5f;
    87.                         geometry.AppendSouthFaceCollider(x, y, z, vSize, hSize);
    88.                     }
    89.                     break;
    90.                 case FaceDirection.East:
    91.                     {
    92.                         float x = layer + .5f;
    93.                         float y = v - .5f;
    94.                         float z = h - .5f;
    95.                         geometry.AppendEastFaceCollider(x, y, z, vSize, hSize);
    96.                     }
    97.                     break;
    98.                 case FaceDirection.West:
    99.                     {
    100.                         float x = layer - .5f;
    101.                         float y = v - .5f;
    102.                         float z = h - .5f;
    103.                         geometry.AppendWestFaceCollider(x, y, z, vSize, hSize);
    104.                     }
    105.                     break;
    106.                 default:
    107.                     throw new InvalidEnumArgumentException("faceDirection", (int)faceDirection, typeof(FaceDirection));
    108.             }
    109.         }
    110.     }
    111. }
    Geometry class source is available on Pastebin.
     
  17. Tsarpf_legacy

    Tsarpf_legacy

    Joined:
    Sep 22, 2011
    Posts:
    17
    Awesome, thanks!
     
  18. Bezduch

    Bezduch

    Joined:
    Jan 27, 2012
    Posts:
    24
    @Alexzzzz

    I'm not a programmer, but is it possible to create trees using bone structure ?
     
  19. chronos78

    chronos78

    Joined:
    Dec 6, 2009
    Posts:
    154
    It is possible to make trees with bones and the technique yields some very good results. The trick however is in how to bake out the weighted vertex positions into a new object if want to batch the trees since skinned meshes do not batch. Unfortunately if you do this you will lose the ability to animated the trees via bone animation, but with some creative use of vertex color you could still animate them with a shader.
     
  20. Lypheus

    Lypheus

    Joined:
    Apr 16, 2010
    Posts:
    664
    I've implemented exactly what your talking about Bezduch - in my case I used two meshes for this and to maintain animations you can use use the full rig on each mesh, not that you'll need it (in my case when the tree what fully 'chopped' I swapped in a prefab of the tree with rigidbody attached, was quite impressive in how it all worked so cleanly imo).
     
  21. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Lypheus, do you have any demo video?
     
  22. martin32

    martin32

    Joined:
    Mar 30, 2011
    Posts:
    27
    Hi all!

    I just wanted to share this project I found which looks amazing!

     
  23. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Thanks, martin32! I haven't seen it before.

    As to trees, I decided to create something like Bezduch suggested just without bones. I prefer my trees to be fully procedural, I tried to use bones, but found them hard to deal with in code. I'd better transform vertex positions manually. Also I want to be able to cut up a tree wherever I want and to get two "pieces" of the tree with exact the same geometry as it was before cutting.

    Procedural tree trunk:





    UPDATE
     
    Last edited: Feb 2, 2012
  24. Bezduch

    Bezduch

    Joined:
    Jan 27, 2012
    Posts:
    24
    Thats looks nice ! I can't wait to see the full tree in action. :)
    You're gonna add some physics to the falling part ?
     
  25. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Definitely yes! Btw, I can't wait too :)
     
  26. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    If you do decide to have the tree fall....
    you'll be unpleasantly surprised to see there is no bottom of the tree (no break with a texture) with unity trees. I've thought about making a script that will close this with a texture. Anyone interested? Not saying it will be in the day or so, but just curious if there is any other interest here.
     
  27. liver9711

    liver9711

    Joined:
    Jan 29, 2012
    Posts:
    69
    Why you always want to do you minecraft-like game as a copy of minecraft? You can do a blocks 2 times smaller than minecraft. Do an other crafting system like you cutting the shovel or anything else by using mouse,create the electrinocs(cabels): wires, batteries, solar collectors, light bulbs... And why you do the shadow system like in minecraft? I dont like this shadows. Better if shadows will be dynamic.


    I can help you with textures and objects(ropes, tables, realistic grass and other high detalised objects).
     
  28. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Unity tree is just not designed to be able to fall, and even if it falls you can't cut it into pieces, for example, and you can't change its geometry in real-time. You can do nothing useful but to stare at it and think how nice it looks.

    There are some objective reasons that make all cube-world engines resemble Minecraft.

    1. You can't make blocks two times smaller, because it will make your visible world two times smaller, or otherwise require eight times more memory.

    2. Lighting:
    a) Imagine there is a passage with no windows and no doors, it is absolutely dark inside. Then you make a window in a wall, and nothing happens if you use standard lighting system. You have to place an additional fake light source to simulate sunlight passing inside. Anytime you make a hole in a wall, you have to create a fake light source.

    b) Standard light doesn't go around corners, however real light does, and minecraft-style light also does. In order to simulate this effect you also have to place fake light sources.

    Finally you end up with either a zillion of fake light sources, or minecraft-style lighting (which actually behaves like a zillions of small light sources), or your lighting will look strange.
     
    Last edited: Feb 3, 2012
  29. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    I alexzzzz, one question. It is possible to add physic to isolated blocs. Like in this picture:
     
  30. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    It's possible. I tried earlier and it worked, but there's a problem:

    $Untitled-1.jpg

    If the isolated piece of blocks is big enough, we can't state for sure that it is isolated, it requires too much time and too much memory.
     
  31. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    And if you propagate the breaking effect time after time with a maximum of 8/8/8 blocs (more or less), a little bit like the sand in minecraft, but with volumes using other materials? You can imagine one guy breaking a bridge but fall because the bridge wasn't attached on the other side, even if the bridge breaks in 2, 3 or more parts :D

    A lot of gameplay added with this system.
     
  32. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Now I can cut my "trees":

    $tree1.JPG



    Next to do:
    - hierarchy of branches
     
    Last edited: Feb 3, 2012
  33. Bezduch

    Bezduch

    Joined:
    Jan 27, 2012
    Posts:
    24
    @alexzzzz

    That's freaking amazing ! :D
     
  34. HeadHunter

    HeadHunter

    Joined:
    Dec 17, 2011
    Posts:
    53
    This really amazing!
     
  35. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
  36. Bezduch

    Bezduch

    Joined:
    Jan 27, 2012
    Posts:
    24
    Omg, this is too good to be real xD.
    Can you now populate your "minecraft" world with those trees ?

    Ohh wait, you still need some leafs :(. Anyway, fantastic job so far !
     
  37. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447


    There is still much work to do.
     
  38. martin32

    martin32

    Joined:
    Mar 30, 2011
    Posts:
    27
    That looks incredible! I think you should sell the tree script once it's finished. I bet many people would be interested in it.
     
  39. HeadHunter

    HeadHunter

    Joined:
    Dec 17, 2011
    Posts:
    53
    Yes, tree awaysome) I first by it))
     
  40. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447


    PS
    I guess I have spammed the thread already
     
    Last edited: Feb 5, 2012
  41. martin32

    martin32

    Joined:
    Mar 30, 2011
    Posts:
    27
  42. alexsan75

    alexsan75

    Joined:
    Feb 6, 2012
    Posts:
    95
    Amazing work you all doing guys! Have a question: any advice how to make that function which allows you to point a cube/object and hilghlight it with wireframe ? Still cannot figure out, worked with highlighting of a color, but cannot find a proper syntax in Unity for wireframe. Thanks!
     
  43. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    martin32,
    Unexpected and impressive use of cube-world engine!

    You don't necessarily have to use wireframe, you can simulate it. Instantiate a cube of size a little bigger than ordinary cubes, with transparent frame texture on it. Use whatever texture you like :)
     
  44. martin32

    martin32

    Joined:
    Mar 30, 2011
    Posts:
    27
    Thanks, i got the idea from Q.U.B.E.
     
  45. alexsan75

    alexsan75

    Joined:
    Feb 6, 2012
    Posts:
    95
    OK, I tried what you suggested, it worked to instantiate on raycast/hit and destroy that object, I used onmouseEnter/Exit, nice wireframe cube,
    but when it didn't worked to use 'remove cube' as before? it's like when two instantiated objects in the same place -> problem. Should I use different layers for objects that already instantiated and for wirecube, or perhaps layermask? Could one use OnGizmoWireFrame or is it just for Editor? Any chance to get some piece of code how it should be done properly.. i'm kind of lost here. Thanks!
     
  46. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    If I understand you right, remove box/mesh collider from that cube.
     
  47. martin32

    martin32

    Joined:
    Mar 30, 2011
    Posts:
    27
    I have two directional lights in my project, for the sun and moon. But the lighting isn't right in a tunnel or cave because the light goes through the walls (I'm already using mesh.colors to simulate block lighting).


    All the textures should have the same level of darkness.

    My question is: has anyone tried having dynamic sunlight by "painting" the light on the texture with a shader? Does it increase performance over having 2 directional lights?
     
    Last edited: Feb 9, 2012
  48. Wikened

    Wikened

    Joined:
    Oct 31, 2011
    Posts:
    271
    Hello guys! Can someone here start making tutorials on Minecraft like world generation? I have looked up code but it is VERY difficult to learn from a completed project. There are NO video tutorials on how to generate Minecraft like worlds so you would probably get lots of views and help a lot of people!

    -Thanks!
     
  49. alexsan75

    alexsan75

    Joined:
    Feb 6, 2012
    Posts:
    95
    Great! Thanks alexzzzz. That was the problem.. Had to adjust my script slightly, but it finally worked! Next step - more mesh optimizing.
     
  50. alexsan75

    alexsan75

    Joined:
    Feb 6, 2012
    Posts:
    95
    Have any one seen this? :)
    http://mythruna.com/
     
Thread Status:
Not open for further replies.