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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Concepts to Learn?

Discussion in '2D' started by tgpannell92, Dec 13, 2018.

  1. tgpannell92

    tgpannell92

    Joined:
    Dec 13, 2018
    Posts:
    2
    Hi there! Hopefully this is in the right section!

    I'm an absolute beginner to Unity and all that it entails. I have a game idea i would like to create that I think is doable with my skill level, but I need a bit of help with determining what Unity features/code/tools, etc. to use for certain aspects of the game.

    Core game concept: I would like the player to tap/click on one of two choice cards on-screen. Once that has been done, I would like the choice cards to slide off-screen, and for narrative text to type itself out onscreen before moving on to the next choice (fading to the next scene, I suppose?). There are multiple endings depending on the choices made.

    I'm really just looking for the names of concepts to look into for some of the design features I'd like to implement, that way I can learn them for myself. I've added a list of some of the ideas I'm working with below. By all means, don't feel like you have to provide an answer for all of them, but any and all suggestions on what things to look into would be appreciated! Most/all I know are probably self-explanatory, but maybe they require additional points of knowledge I haven't thought of?

    Things I want to do, but don't know what to Google to learn how

    -Branching choice system - Choices made at "major" points in the narrative lead to an alternate ending situation.
    -Way of tracking and displaying statistics on percentage of people who made certain choices.
    -Saving progress on mobile at last-made choice. Reachable by a "Continue" button at main menu.
    -Fade into logo screen on launch, then fade out. (I can definitely google this one)
    -Stopping a player from tapping two choices at once/other issues encountered with this.
    -Animating choice cards idling, as well as on/off-screen.
    -Animating 2D icons, background color/choice card color depending on scene, etc. ANIMATIONS.
    -Best approach for choice cards. Can they be buttons with a graphic, or is something else better?
    -Can buttons initiate a scene change, moving to the next choice?
    -Varying text-type speed, allowing for the occasional slow... typing... of.......... words. or a . . .

    There are plenty more of course, and in typing these out, they seem easily Google-able... but it's also nice to seek out more experienced advice/recommendations. Thanks!
     
  2. DeeJayVee

    DeeJayVee

    Joined:
    Jan 2, 2015
    Posts:
    121
    Well, your Branching choice system can come down to True or False boolean statements. if this choice is made set /Variable/ true/false. Then when a narrative depends on the bool you'll IF statement.

    Code (CSharp):
    1.  
    2. if(Variable == true)
    3. {
    4. //this happens
    5. }else
    6. {
    7. //This happens
    8. }
    Of course, there will be many ways to do it and fancy it up, but simply, that's what it is.

    For tracking statistics it will also depend on your variables, how you display them is up to you but you could have a Canvas GameObject with a UI Text object.

    In your code you'll have something like

    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.UI; // This line is needed to use the UI systems.
    6.  
    7. public class TextStatistic : MonoBehaviour {
    8.  
    9.     public Text Statistic;
    10.     public int Percentage = 0;
    11.  
    12.     void Start () {
    13.        
    14.     }
    15.    
    16.     // Update is called once per frame
    17.     void Update () {
    18.         Percentage += 1;
    19.         Statistic.text = "Percentage" + Percentage;
    20.     }
    21. }
    22.  
    23.  
    24. }
    25.  
    this here, if you put this script on an object, have a Canvas and Text Object you can drag that text object to the script
    and it will constantly change the variable and the text. How that variable changes would be up to you

    Percentage = Variable1 / Variable2. Learning to control variables is fundamental.

    Saving progress is a little trickier in my opinion, but again, it's saving variables and then reading those variables later.
    googling how to save progress unity c#(Or javascript?) you'll generally get an idea.

    Animations are made somewhat simple in unity, easy to learn difficult to master type deal.

    You'll want to have the "Animation" tab open, and from there you can display how your animations look.

    after that, you will want to drag that animation to your "Animator". On the left side of your animator tab is a little plus icon which gives you variables and such like "Bool, Float" I'm not the best explanation giver so I'll keep it simple.

    You call and change those variables inside of a script in order to control when and how your animations are used.

    googling say "How to script animations unity c#" or along those lines should give you plenty of resource.

    the best approach for the type of cards, what they look like or how they are interacted with is up to you and how you think would best suit your game. As long as you keep in mind ease of use for the player, making it a comfortable experience. When youve made them, play with them, do you find it comfortable? do the graphics hurt your eyes?


    Yes, buttons can initiate a scene change, well more precise, your buttons will be objects which will be controlled by a script with if statements and things.

    Actually, the SceneManagement scripting API has a GUI button sample. so I will link that
    https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.LoadScene.html

    Again your text speed will be done with Variables.


    While I'm no pro, and people here may give a more concise and better constructed reply, I just wanted to push that Variables are your games information, it's your gold amount your remaining health or bullets, they are your containers to fill and pull information from.
     
  3. tgpannell92

    tgpannell92

    Joined:
    Dec 13, 2018
    Posts:
    2
    Wow, thank you so much for taking the time to write all of that out! Some of what you've pointed out are things I've seen glimpses of in other tutorials, but other concepts like variables are new to me. I've found that I can watch a tutorial, but I have trouble figuring out how to make the changes needed to implement the feature into my own game, so that's my main roadblock.

    This is helpful, thank you!
     
  4. DeeJayVee

    DeeJayVee

    Joined:
    Jan 2, 2015
    Posts:
    121
    I find that since there is so many ways to do things in programming or in unity c# and the amount of choice available can sometimes feel daunting, I try to keep things simple in my head and break them down to their core elements and go from there.

    Here are some of the people whos tutorials I have watched personally, maybe they will help you.

    https://www.youtube.com/user/KnnthRA

    https://www.youtube.com/user/gamesplusjames

    https://www.youtube.com/user/AwfulMedia

    Good luck :)


    EDIT:

    This tutorial from Diamon in the RGSS community about variables is what helped me understand them.

    It's not unity and it's not C# or Javascript but the variables are basically the same, and understanding what they do may help.