Search Unity

Minecraft Clone - Skyblock

Discussion in 'Works In Progress - Archive' started by DryTear, Jul 23, 2013.

  1. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    WebPlayer


    Check it out, Ive made it only 2 days, ill be implementing simple multiplayer later on! but yah u guys check it out. The instructions are in the game, and if you click on the Bench, press E to close the crafting menu.

    Video :

     
    Last edited: Jul 29, 2013
  2. TheRealFuzz

    TheRealFuzz

    Joined:
    Jul 17, 2012
    Posts:
    308
    If you've made it in two days I'm sure you're skilled enough to post some pictures ;)
     
  3. C-Screator

    C-Screator

    Joined:
    Dec 15, 2012
    Posts:
    85
    Its really good try working on it a bit more by putting enemies in it(make up your own enemies if possible)
     
  4. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    Sure, im going to have to make an actual floor, add nighttime and daytime sky change, and possibly my own enemies to fight with.

    Ill put some up
     
  5. NoChanceGames

    NoChanceGames

    Joined:
    Jul 25, 2013
    Posts:
    7
    Really Good! I'm Following!
     
  6. Peter Ples

    Peter Ples

    Joined:
    Mar 12, 2013
    Posts:
    237
    It seems when I click anywhere the game freezes unfortunately. And the mouse disappears. Until I press esc.
     
  7. JscriptFless

    JscriptFless

    Joined:
    Jan 8, 2013
    Posts:
    49
    Holy balls, this game has some potential!
     
  8. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    When pressing U, you unlock the mouse, when pressing I you lock the mouse back in the center ( Screen.lockCursor ), in the start up you do what you gotta do, game should run fine though, never froze for me.

    All see what i can do with the game today!

    Thank you, just a question, you posted that at 7 Am in the morning. hah.
     
    Last edited: Jul 27, 2013
  9. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    Screenshots incoming :

    $Capture1.PNG
    $Capture.PNG
    $Capture2.PNG

    mind my building skills, i suck at minecraft
    also the screenshots were taken on a 1GB ram laptop, so many of you guys im sure you have a better PC than mine, so having shadows on, wont be a problem for you!

    Update :

    Added bonemeal ( press F to use on sapling, growssssss big)
    Update some of the textures
    Added FPS Counter
    Bedrock is now ground level ( -100 )
    Added a new sign, instructing on the bench basics.
    Added GenMachine, which generates a random thing every 10 seconds ( can be iron, can also be silver or copper, although not yet usable )
    Added sapling that can be crafted with 20 leaves, the sapling evolves into a tree with a time from 0-20 minutes
    When braking leaves, they drop at a chance of 1 out 2,also a sapling has a chance of 1 out of 7 that it will drop, but u can still craft a sapling from leaves.

    Ill be working on a cobble stone generator physics, ill have add water, and lava, if anyone can point out some ideas on how to make water and lava turn into cobble and some ideas on liquid flow ( im thinking of particles, a ton of particles ).

    Then ill be doing a dynamic skybox ( that will be very easy, shoundt take long ), and then finnally some mobs, because bonemeal is originated from bones, sooo.. yeah.... any ideas on what type of enemies/mobs i should add
     
    Last edited: Jul 27, 2013
  10. iWoundPwn

    iWoundPwn

    Joined:
    Feb 16, 2013
    Posts:
    212
    Going to give some constructive criticism, but before I do that just wanted to say the game has A LOT of potential and is looking great, now onto the constructive criticism. Don't make it too much like Minecraft as it does in the web player, why make a game just like minecraft when most people will just play minecraft, you have to do something different to make it stand out instead of just making a copy of minecraft :p nice game! Gonna follow this project also I'd be interested in joining if possible! Shoot me a PM!
     
  11. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    ty for the judgement, i though of it, but im out of ideas on making it unique, i though of that before, which was to add different gameplay method, instead of having 1K players per server only 10-30, give the people some feel of co-op rather than competition. I will also add different, and maybe more block types such as cardboard, rubber ( i've done that before, bounced around funny), rubber balls maybe also, minecraft main point is squareness, while me, ill add different objects with different meshes, for example an actual zombie (riped from call of duty? bad idea), maybe also a pentagon that summons the mighy portal to mars ( magnificent idea, lets add planets, all though, the planet you play in its a skyblock!). So yah,
     
  12. HCM

    HCM

    Joined:
    Mar 1, 2012
    Posts:
    83
    One thing that I thought Minecraft always could have used was technology upgrades.

    Something like oil that can be found, and pumped up to the surface, and used to develop industrial things, such as vehicles and what not.

    and making an over arching quest that requires the character to have to find something. Like the mysterious land of Bukakah. there could be world bosses that spawn making it neccessary to sneak around, or fight-- and finding the location of the goal could award something like recipes that let your individual character build things that others can't because they haven't unlocked that recipe.

    I think I just described something WoW-ish, but I don't mean it that way. building guns, vehicles and putting a focus on surface travel could open up a new kind of game play that we don't see in minecraft. I can imagine an airplane flying overhead and slowly running out of fuel as it flies... Players parachuting out to land on top of a mountain that's too steep to climb to get a treasure chest and what not... just some thoughts.

    Coding all of this, on the other hand, would probably be a series of headaches.
     
  13. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    magnificent idea, vehicles huh! bosses and lands, how about planets, recipe learning, heck yes. but then, something similar to redstone will have to implement ( ill call it electricity ), and the use of charcoal would be eliminated as electrictity would popin, also the water flow could be used as a power gen
     
  14. Myhijim

    Myhijim

    Joined:
    Jun 15, 2012
    Posts:
    1,148
    Hate to rain on your parade, but did I notice each block is a gameobject?

    This will kill every system if you make the world any bigger than it is now.

    If you aren't using chunking, I'd highly suggest it
     
  15. an

    an

    Joined:
    Oct 6, 2009
    Posts:
    146
    First of all: Congrats for starting such an ambitious and enlightening project, that's awesome!
    But I agree with Myhijim, so here's my experience.

    You've managed to put something cool together pretty quickly, but it seems you're using a wrong approach.
    Try to generate a 1'000 x 1'000 x 1'000 or bigger world (which is nothing compared to Minecraft). You'll have 1'000'000'000+ GameObjects and that will make Unity cry a river the world has never seen before.

    The secret to success is procedural mesh generation, and that's the true challenge at this point. The blocks only appear as small blocks, in reality they're one big mesh containing thousands of them, in a giant World containing thousands of the big meshes.
    Down there, you can rarely profit from Unity's workflow, because virtually everything you do is pure coding.

    I'm working on a Unity-Based voxel system for a highly experimental project but it's far from finished and there's nothing to release at the moment.
    However, I remember having seen an opensource unity minecraft-implementation in the forums. Do a quick search, maybe it helps you. Further, I recommend reading this and this.

    Good Luck!
     
  16. Myhijim

    Myhijim

    Joined:
    Jun 15, 2012
    Posts:
    1,148
    Speak of the devil : http://forum.unity3d.com/threads/192954-CoreDev-Creating-Voxelised-Worlds-(Like-Minecraft!)
     
  17. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    I agree with that, ill start implementing my own occlusion culling system, heres how it is going to work :

    a raycast from each of the vertices of a cube is made, and it is casted towards the player, 8 rays ( 8 vertices ). if at least one ray hit a player, then the block is visible, if all the rays hit something else, well ill then turn off the renderer.

    does that sound a way of optimization, or are raycast gonna give me cpu head aches also? i was planning on making a skyblock, thats where players start off, then they can explore planets ( cant be infinite, has to be round, sooo yah) thats when ill have research move of dynamic mesh generation and deformation, also some UV research, and some how make each planet a cube?

    i feel like like notch now :D

    in the mean time, ill head over with liquid physics, basic enemies ( im thinking aliens and ufos)
     
  18. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    how would i go about that? never experienced with saving and loading except with playerPrefs
     
  19. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    Accidental Double post, sorry!
     
  20. an

    an

    Joined:
    Oct 6, 2009
    Posts:
    146
    Forget your Raycast approach as long you don't own a really really powerful supercomputer.
    The "occlusion culling" you use in this case is that you check if a cube has cubes as neighbors and, if so, the sides of the cube which have a neighbor cube aren't rendered. Further you can employ some octree magic, but that's something i haven't done yet.
    I strongly recommend reading the articles I linked as well as Myhijims thread.
     
  21. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    Well.. thats hard, for my age (14), ill see what happens with raycasting, but then, its gonna be hard making game optimized, i fell so stupid right now!
     
  22. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    looks great, i tried the web player, its fun.

    p.s do you have the pro version of unity cause it looks like you got shadows (or your using the unity free skin) or are you using the latest unity update ( 4.2 sense it makes realtime shadows for the free version)
     
  23. an

    an

    Joined:
    Oct 6, 2009
    Posts:
    146
    Keep a cool head. Regarding what you did so far in your age there's no reason for feeling stupid. If it would be easy, everybody could do it and that would be lame, right? When I was 18 and started experimenting with Minecraft-esque stuff, I started the same way using single cubes haha!
     
    Last edited: Jul 29, 2013
  24. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    went towards raycasting occlusion, here my script so far i made :

    Code (csharp):
    1.  
    2. private var v1 : Vector3;
    3. private var v2 : Vector3;
    4. private var v3 : Vector3;
    5. private var v4 : Vector3;
    6. private var v5 : Vector3;
    7. private var v6 : Vector3;
    8. private var v7 : Vector3;
    9. private var v8 : Vector3;
    10.  
    11. private var cam : Vector3;
    12.  
    13. var castrate = 0.1f;
    14. var renderdistance = 20;
    15.  
    16. function Start()
    17. {
    18.     v1 = Vector3(transform.position.x+0.5f, transform.position.y+0.5f, transform.position.z+0.5f);
    19.     v2 = Vector3(transform.position.x-0.5f, transform.position.y+0.5f, transform.position.z+0.5f);
    20.     v3 = Vector3(transform.position.x-0.5f, transform.position.y-0.5f, transform.position.z+0.5f);
    21.     v4 = Vector3(transform.position.x-0.5f, transform.position.y-0.5f, transform.position.z-0.5f);
    22.     v5 = Vector3(transform.position.x+0.5f, transform.position.y-0.5f, transform.position.z-0.5f);
    23.     v6 = Vector3(transform.position.x+0.5f, transform.position.y+0.5f, transform.position.z-0.5f);
    24.     v7 = Vector3(transform.position.x+0.5f, transform.position.y-0.5f, transform.position.z+0.5f);
    25.     v8 = Vector3(transform.position.x-0.5f, transform.position.y+0.5f, transform.position.z-0.5f);
    26.    
    27.     cam = Vector3(GameObject.Find("Camera").transform.x, GameObject.Find("Camera").transform.y, GameObject.Find("Camera").transform.z);
    28.    
    29.     if(Physics.Raycast (v1, cam, renderdistance) || Physics.Raycast (v2, cam, renderdistance) || Physics.Raycast (v3, cam, renderdistance) || Physics.Raycast (v4, cam, renderdistance) ||
    30.     Physics.Raycast (v5, cam, renderdistance) || Physics.Raycast (v6, cam, renderdistance) || Physics.Raycast (v7, cam, renderdistance) || Physics.Raycast (v8, cam, renderdistance))
    31.     {
    32.         renderer.enabled = true;
    33.     }
    34.     else
    35.     {
    36.         renderer.enabled = false;
    37.     }
    38. }
    39.  
    But it gives me :

    $Capture.PNG
     
  25. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    Ive came up with some ideas on game :

    Spaceships, Planets

    the planets are cubes and they rotate, but the player, will have to keep on moving, so if he settles on the moon makes a house etc, the moon will eventualy turn up side down ( or other way ), and eventualy ur player will be walking on the ceiling! (Spider Man :D ), spaceships will require metal debree, some technological stuff to collect ( from ufos, which can be shot down with a harpoon, or a gun maybe ),sooo yah... i wanted to recreate minecraft, ended up with a space exploration ( hey NASA )
     
  26. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    Update 3:

    Added Sky, Better Moon and Better Sun ( Stars are really beautiful, don't touch them)
    Added Rubber ( Item )
    Added Bonemeal drops from Gen
    Added String drops from Gen
    Added Wool ( crafted with string )
    Added Pages to the bench,
    Bench can now also be destroyed and replaced, use the F key to use the bench!
    Tree's leaves now auto destroy themselves, but if you do it manually( faster ), leaves can drop saplings, and also apples!
    Added RubberBall ( pure awesomeness )
    If you press Shift, you can push rigid bodies ( sand, crate, rubber balls )
    Added latex, which drops from tree logs ( use to make rubber )
    You can eat apples, by pressing F, while having Apple selected.
    Health and Hunger bar shown also as a number.
    Fixed FPS Counter colors ( red = bad, yellow = okay, green = good )
    New shadow projector under player.
    Planets and Stars ( cant go there yet )
    if you type in "D-Items", it will literally delete every item on the floor ( even the emerald )

    Next :

    Ill be using the copper, iron, gold, silver ingots to make more crafting recipes like an engine, which can be used in making a car, or a bike, or maybe a spaceship. and then ill head over to optimization again. any ideas on recipes, i already added Rubber Balls to toy with.

    UFOS, Aliens, Spaceships, Meteors, Asteroids ( all about star trek ), this game will be a mix of sci-fi/minecraft/space survival/et

    Webplayer is updated, you can play the game from original post or from HERE

    Video on the update :

     
  27. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    Update 4 :

    Added planets, that you Can actually fly to
    Added Shuttle :

    WASD To change flight direction on the Shuttle,Q and E to spin the shuttle

    New Items :

    "Shuttle"
    "Frame"
    "Engine"
    "Steel"

    Planets, have different things to them, for example one of them has a Generator, one of the has some sandstone, one has a ton of trees to chop.

    Your island, or skyblock, rotates, so technically, u can walk on on walls or the ceiling.
     
  28. xniinja

    xniinja

    Joined:
    Mar 12, 2011
    Posts:
    230
    This is looking really cool.
     
  29. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    Thank you!
     
  30. xniinja

    xniinja

    Joined:
    Mar 12, 2011
    Posts:
    230
    Also, If you didn't get the Occlusion Culling to work it's because you need to put 'new' in front of Vector3. You're making a new Object so you need to tell it to make a new object.

    I'm pretty sure that should work. Otherwise, I don't know.

    Edit: Oh, nevermind. You're using Javascript.

    This is how I would do it:

    Code (csharp):
    1.  
    2.  
    3. cam = GameObject.Find("Camera").transform.position;
    4.  
    5.  
    I also realized you forgot the transform.postition
     
    Last edited: Aug 1, 2013
  31. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
    Find is actually fairly slow of a process. It'd be better to either define a camera variable to begin with (using a find in the start function would work) or simply use Camera.mainCamera. Using find several times like you showed will slow things down a fair amount when used over and over.

    Remember, when using something over and over again, it's always faster to reference it with a variable then it is to search through all of the variables looking for the one you need.

    I would do something like this:
    Code (csharp):
    1.  
    2. private var c:Camera;
    3. private var cPos:Vector3;
    4.  
    5. function Start()
    6. {
    7.     c = Camera.mainCamera;
    8.     //your other code
    9.     //Now you can use c.transform.position, and if you really wanted
    10.     //you can add make a new variable for camera postion, cPos
    11.     //or whatever inside of your update loop.
    12.  
    13.  
    14. }
    15.  
    16. function Update()
    17. {
    18.     cpos = c.transform.position;
    19.     //Now, in your raycast, you can just call cPos instead of cam, and
    20.     //it's all referenced, and much faster.
    21. }
    22.  

    I'm not exactly sure what you are doing with the raycasting and such. One of the easiest ways to check to see if it should be drawn is to go the route that they do in minecraft itself. Check to see if the block is touching water or air. If it is, then render it, otherwise don't. It takes a bit of processing on the initial load, but you only ever have to check the 6 blocks surrounding any modified block (you don't need diagonals to be checked as they won't update in this type of system), and that speeds things up as far as the culling process.

    As far as the render distance is concerned, I'd just set up chunks with a large trigger collider, and then do an on trigger enter event, if the tag is player, then turn on rendering. On trigger leave, disable rendering. You'd also have to check on start, otherwise, the block the player is in would never trigger the event.

    It's very unlikely that either event would not be thrown, unless you are teleported. In that event, the teleportation code would force the chunk to check if it should render.

    I've never programmed this type of system before, so I have no clue for certain how these will work, but in my head it makes sense. Optimization is key, and only checking what you need to is best practice.

    Also, for loading chunks, I'd look into threads. Threading is an amazing way to do things without slowing down the game much. In multi-core or hyper threaded processors, many times you won't even notice a frame drop if one of the processing cores aren't really doing anything. Great way to load things, or check occlusion while running around in the game.
     
  32. xniinja

    xniinja

    Joined:
    Mar 12, 2011
    Posts:
    230
    True, I wouldn't actually do it that way. That's how I would rewrite that line.

    For the chunks, however. I would probably just keep an eye on the position and load up another chunk every so many units. That way I wouldn't have to deal with placing triggers an what not. In the event of a teleportation it would still work because the script would notice that a chunk that hasn't been loaded needs to be loaded. Also, on the topic of loading chunks, you could simply run the positions of the blocks through the procedural generation system and only save the blocks that were changed. That way you could keep the file sizes really low and not have to safe an enormous amount of data for the worlds.

    On the topic of occlusion culling, the air or water contact would probably be your best bet at first. Then you could add in the occlusion culling later if it becomes too intensive on your machine. Here are a few ideas you could implement for optimization though:

    * Only check the cube if you are facing it. (Or it is in your camera view)

    * Only recheck cubes if you start moving.

    * If possible, only render faces that you need. Not the whole cube.

    * Have different rendering distances, obviously

    * If a block is within a certain distance(5 to 10 blocks), don't check it. You're only wasting processing power. (Maybe, this is only a hunch)

    * Be able to identify walls and how big they are, basically figuring out if you can unload unneeded chunks.


    That's it for now. I have more ideas but the way the would work is probably over complicated for something like this.
     
  33. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    what i am trying to with that troublesome script it is to cast a ray with a rate, there are 8 rays, 1 ray is casted from each vertex, if at least one vertex hits the player, ok then, render the cube! if not then dont render the cube. as xninja said, ill cast a ray if the player moves, and one thing I want to try to do is, how do i check if a cube hits air or water, its a space game!

    also i wanted to share the project folder incase someone wanted to try out the codes : LINK

    i fixed the problem, ty ninja and caliber but since its fixed the cubes disappear and appear randomly!, does the cam need a collider for the cast to hit or no?
     
  34. xniinja

    xniinja

    Joined:
    Mar 12, 2011
    Posts:
    230
  35. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
    The 8 raycasts seems kind of expensive though. I think just check to see if above, below, and the sides are touching anything see through (water/air) would be less processing then 8 raycasts. I would also probably do the raycast at every point one by one instead of in one single if statement. That way if you hit with one, you can skip over the other raycasts. (Not certain how the or part of the if statement works with unity. It may do this automatically, I'm not sure)

    Either way, have fun, and keep experimenting.
     
  36. DryTear

    DryTear

    Joined:
    Nov 30, 2012
    Posts:
    312
    idea, raycast at start upwards one meter and downwards. if the up ray cast hits , turn off renderer. And if a block destroyed, raycast downwards and turn on the renderer on the cube below before destroying. is this a good idea?
     
  37. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    689
    Only checking the up wouldn't work as it's possible to have a block above, but not on the sides. Also, same applies when breaking a block. Just because it's been broken doesn't mean there is only a block below it now visible. Say you destroy one in a hole. The sides also have to be turned on. Or the same, but you dig out of the ceiling, the top and sides have to be on.

    I do like the idea mentioned above that when you get to the point of generated terrain, you only save the changes to that. It does save a lot of data that way.
     
  38. Toggy11

    Toggy11

    Joined:
    Jan 4, 2014
    Posts:
    6
    This is a very good game but I am pretty sure no one will play it if they see "Skyblock" and alot of people will not like it if its a clone of minecraft. If you do decide to change it up a bit I suggest you rename it from "Skyblock" to "Survival Islands".
     
  39. thekrackensmeow

    thekrackensmeow

    Joined:
    Mar 1, 2014
    Posts:
    2
    You should make an alien monster that is all jiggly and wiggly and smashes into a splatter of slime on the ground.
     
  40. thekrackensmeow

    thekrackensmeow

    Joined:
    Mar 1, 2014
    Posts:
    2
    You should probably make a better player model.