Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Help with a Block-Themed RTS Game

Discussion in 'Scripting' started by cartledgej, Aug 17, 2015.

  1. cartledgej

    cartledgej

    Joined:
    Apr 18, 2015
    Posts:
    4
    Im making a game in unity 5 where you get to build armies from blocks, similar to minecraft, space engineers or starmade, but i need a GUI that will allow this when you select a unit production building, btw, i'm using Voxel's Cubiquity for this.

    P.S. if this is the wrong forum to post this, let me know and i'll relocate it to the proper forum
     
  2. Lorinthio

    Lorinthio

    Joined:
    Aug 7, 2015
    Posts:
    39
    So whats the scripting issue? =D
     
  3. cartledgej

    cartledgej

    Joined:
    Apr 18, 2015
    Posts:
    4
    knowing what kind of script i need for this and how to make it, basically it's like a sandbox builder within the main game
     
  4. tedthebug

    tedthebug

    Joined:
    May 6, 2015
    Posts:
    2,570
    So you are wanting to know how to get the gui to be visible when the player clicks on the block?
     
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    This problem is far too big and unscoped for anyone to give you a meaningful answer. Try starting here:

    http://unity3d.com/learn
     
  6. Lethn

    Lethn

    Joined:
    May 18, 2015
    Posts:
    1,583
    I've been looking into this myself, for a proper RTS, you're going to need to learn about instantiate, using arrays to make the grids themselves, both for building and for unit movement as well as raycasting, that's for just the basic game mechanics as well, you'll also need to look into how to make a decent RTS camera.

    So in short, RTS' are pretty damn complicated, if this is your first project don't do it, platformers are simpler trust me :p
     
  7. SirStompsalot

    SirStompsalot

    Joined:
    Sep 28, 2013
    Posts:
    112
    I've been down this road (I'm working on a voxel RTS as well) and while I hesitate to disagree with @BoredMormon I can give you a little guidance.

    Here's some advice:

    Don't build an in game voxel editor. This is a huge freaking ball of wax. Instead, import from existing voxel editors. My favorites are:
    https://blackflux.com/
    https://voxel.codeplex.com/
    http://minddesk.com/

    Leverage Existing tools:
    https://www.assetstore.unity3d.com/en/#!/content/29779
    https://www.assetstore.unity3d.com/en/#!/content/39877

    If you're using Cubiquity, great. It's awesome tech, stick with it.

    If you've got your heart set on building an in game editor, here's some initial Steps:
    Find a block via a raycast to the mouse position.
    Tell Cubiquity to remove it.
    Figure out how to add a block on one face of a cube. How about the other face?
    Save, reload.

    From there, iterate. Rome wasn't built in a day and RTS games are about as hard as building a content rich RPG. You need to think about AI, pathfinding, mesh deformation and LOD. Cubiquity will do storage and volume deforms for you, but you need to think hard about what you're doing. Break it down into small steps, code from there.

    When you do crack it though, it's insanely rewarding.