Search Unity

What to do after completing create with code tutorial

Discussion in 'General Discussion' started by kmo86, Mar 23, 2021.

  1. kmo86

    kmo86

    Joined:
    Dec 15, 2020
    Posts:
    104
    I have recently finished the create with code tutorials. I have played about with the tutorials and added my own bits in some. But now I’m wondering what to do as I still don’t have a clue how to do even a basic game outside these tutorials. I thought of trying a snake game or a pong game but don’t have a clue how to do a lot of what’s needed for them or how to find out. For snake game I have no idea how to make food appear every time the snake eats any or how to make the snake grow when it eats food. So what’s the best thing I could do to learn what I need to do so I don’t have to keep asking on here? Also is anyone else in similar position who would like to talk and share ideas and help each other?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Break down problems into a series of smaller problems. Try to solve these problems one at a time. For example:
    So you need to have already defined what food is. You'll need to figure out how to make the snake eat the food. Food might be a prefab you instantiate, with a trigger collider. When you detect the snake entering the trigger, you "eat" the food. In that same function which you call to eat the food, you instantiate a new food item. You'll need to determine already how you are going to place food. It could be entirely random location, or a spawn point, etc, but basically you call a function which handles that. After that you call some method you write to make the snake longer. I guess it depends on how the snake is designed as to how to make it longer, but you'd have a function you write which handles that.

    I suggest skimming through the entire Unity manual so you're at least familiar with what functionality Unity offers. When you end up needing a Unity feature, you can go back and read that section more thoroughly. Also the forum here has so many questions answered, that most any question you have is probably already here. Just google it, and you may find a detailed discussion on the topic.
     
    Socrates likes this.
  3. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    If you finished these tutorials, you should know how to detect user input, move game objects, how to detect collision, how to identify objects with tag or getComponent<>(), how to instantiate and destroy game objects. That should be mostly everything you need to make a snake game, or pong, and lots other simple games.

    If you get stuck, you can ask questions on the coding forum or the beginner's forum or something like that, but your questions will need to be much more specific or else people won't know how to answer them.
     
    Socrates likes this.
  4. Owen-Reynolds

    Owen-Reynolds

    Joined:
    Feb 15, 2012
    Posts:
    1,998
    Tutorials tend to skim. You've seen an IF-statement, but don't know how to write tricky conditions or handle multiple cases. You've seen an array but aren't good at using one, you've called some functions but aren't comfortable writing a quick one for yourself. Put another way, they lie. You can learn lots of things by watching a few hours of videos, but coding isn't one of them. It can help to get a basic intro, even "Intro to C#" from the library. Go through some simple non-game stuff or think of very small non-game things to try in Unity. After a bit you'll realize the way you "remember" where the snake food is is the same way you remember the interest rate of a loan in some boring sample banking program in the book. Keeping track of snake parts is the same as keeping track of bank customers.
     
  5. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Sounds like you should look for step by step tutorials maybe not videos but text based ones?
     
  6. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    6,023
    You already have the tutorial, so modify it. Change numbers. Change code. Change meshes. Try to understand where the code to do a specific thing is, and how it works.

    Until then, you haven't really done anything except follow some steps that you don't understand.
     
    Ryiah, Joe-Censored and Socrates like this.
  7. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    I think each person is going to have different advice for you, but don't be overwhelmed. The single best thing you can do is don't give up.

    Keep asking questions on the forums. There might be some arrogant snobby people on the forums, but just ignore them. There are usually at least some people that will genuinely be willing to help you, or try to answer your question.

    I had no experience with game development or programming whatsoever when I first started to learn Unity. I think what I did was think of the genre of game you want to make. For example, first-person shooter, role-playing game, real-time strategy, platformer, etc...... Then start trying to make that game. The best way to learn the game you want to make, is to start trying to make that game the best you can, in whatever way you can. Trail and error was how I actually learned.

    For example, I wanted to make a real-time strategy game. So I asked, how do I even "select" a gameobject in order to move it somewhere on the map? This is actually not an easy thing to do. So I googled how to "select" a unit/character in an RTS in Unity. I found the best tutorial I could on selecting gameobjects and tried to learn how to actually do it. Mouse input, raycasts, colliders, gameobjects, components........ all of these were necessary, and I understood very little about them. I also had to ask a lot on the forums.

    I think "veterans" of programming and Unity often forget just how difficult it is when you don't understand the system at first, and you don't know how things relate to each other in the engine. It actually took me about 1.5 years to finally begin to understand how things related to each other in Unity -- and the architecture they created.

    In summary, try to make the game you want to make, right from the start. Then look up tutorials and ask questions based on specific tasks you are trying to do in your game. Trial and error.
     
    Joe-Censored likes this.
  8. kmo86

    kmo86

    Joined:
    Dec 15, 2020
    Posts:
    104
    thanks for that I think I will start some game that I want to do and keep having a go at building on it see how I get on. I think off top of my head a car racing game is one I want to try. Like I need to at least have some idea about some of it don’t I?

    At least car racing I’ve got a good idea what I need to have and how the game will work rather than making everything up as I go along. Also there will be loads and loads I need to learn and look up. In fact just about everything I know how to add player control to the car the player drives even that will need some looking up to get the camera to show in front of car.

    It will give me something to aim towards and I can still go through tutorials and learn other things.

    There are plenty of other ideas I have for games but I wouldn’t even know where to start at minute.
     
  9. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Games are often more complex than normal applications becasue by their nature systems have more dependency to each other.

    Even in normal programs it's extremly important to always think of abstraction, low coupling and high cohesion. To aquire this mindset is hard and takes time, and it's why usually seniors write more maintainable code than juniors. (it's not a definite rule). Anyway study principles and design patterns. Always have this mindset in the back of your head.

    Now it's time to create the game. Basicly it's just starting to POC (proof of concept). It helps if you do each POC in a seperate git branch. Here are some examples from the early days in our game.

    First test for us in unity ever



    Using a open source framework for VR






    Movement POC
     
    Velo222 likes this.
  10. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Third person avatar


    Netcode


    Then you iterate, polish, and iterate again. Above avatar looked like this a few months later



    I guess game development can be reduced down to polish and iteration :) you just gotta keep writing maintainable code so things stay working :)
     
  11. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Why not start with the Unity learning systems Junior Programmer course should help you get to grips with the basics of programming with Unity. You could also start your racing car game for a fun side project and hopefully the two should complement each other.

    Junior Programmer - Unity Learn

    Or if you like a challenge to focus you on completing something...

    Need 4 Kart Challenge II - Unity Learn

    Side Note: Unity gives developers a fun sandbox and tools to play with but for more development/programming knowledge you might want to try some old school game programming e.g. board games or even text adventures

    By removing the Sandbox and limiting things to simple text or very simple graphics your game programming skills should be the focus and not how much 'sand' you can throw around.

    A more challenging game would be a ascii text based Rogue Like there are lots of resources and websites where people make this retro style turn based game.

    Most of all...

    Have Fun.
     
    Last edited: Mar 27, 2021
  12. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437

    Nice. A car racing game sounds fun. Each genre of game has it's own unique set of challenges, as does every game in general.

    Yes you need to have some idea about some of it, but that is what you will be building upon step by step as you try to make the game that you want. As Joe-Censored said, break it down step by step, just try to do simple basic things first.

    If you want to do a car racing game -- I'm just imagining here but you can do whatever you want -- but maybe try getting a "vehicle/car" model into the game (or build your own simple one). Place it into the scene. Do you want the car to move along a track, or maybe just the terrain? These are things you can decide (that's the fun of game design to me). Then maybe try to figure out how to get the vehicle to move. I havn't done a car racing game for awhile, but last I remember Unity has "wheel colliders" you can use for vehicles. They are very finnicky things, but they can work well if you get the values and variables right. Put the "Wheel Collider" component onto whatever gameobjects you want to be the wheels.

    Or perhaps you want to purchase a ready-made vehicle off of the asset store -- if you have money and want to -- again these things are completely up to you. But for learning purposes, maybe you can create your own basic vehicle with boxes and spheres and wheel colliders first.

    Decide where you want the camera. Then you might have to write a script for the camera to smoothly follow the vehicle. Or perhaps just make the camera a child of the vehicle gameobject. Again, these are not "easy" things to do at first (until you learn the system).

    Then you will have to learn how to make the car move and how the player can steer the vehicle. If you want to have a character driving the car, you will have to learn how to set up a character to do that. Maybe IK solvers and bone chains if you want to the character to actually be driving with the steering wheel......etc. But that is more advanced stuff in my opinion.

    It will be frustrating at times, but those are the learning curves you must push through, and once you get it, it will be a great tool in the future. Take breaks if you get too frustrated -- then come back to it.

    Overall, as Arowx said above. Have fun! Don't forget to have fun. :)
     
    Last edited: Mar 27, 2021
  13. Owen-Reynolds

    Owen-Reynolds

    Joined:
    Feb 15, 2012
    Posts:
    1,998
    It helps to decide which option you prefer. If you just want to make games, be prepared that there are things you won't be able to do. You'll find a script that's close, post it here asking "how do I change this to also do X" and not one word of the replies will make any sense (that happens all the time here). Like a real Game Designer you'll have to compromise to be not what you wanted, but close enough. The other route is knowing how scripts work. That's going to take a lot of time before making any games; and you still won't know enough to do everything you want and will have to make compromises, and some things you spend a lot of time making won't be so great when you see them in action.
     
  14. kmo86

    kmo86

    Joined:
    Dec 15, 2020
    Posts:
    104
    Yea I’ve had that happen where I ask something and don’t understand the answer . Well I’ve started my car racing game. By started I mean I’ve got a free asset of some tracks and free cars and done everything you learn in the first tutorial of create with code. Getting the camera to follow the car and car moves back and forward and turns. So that’s the easy part done. For now I’m sticking to getting free assets as I’m still learning and need to learn a lot more before I can do any good proper games.
     
    ysfwaleed3 likes this.