2D Roguelike 4 of 14 : Board Manager

2D Roguelike 4 of 14 : Board Manager

100 comments / Add your comment below

  1. Hi, I don't get why we don't set the transform to board for instance coming in LayoutObjectAtRandom and for the exit ?

  2. Comment Section: "This sucks! I should be able to learn how to code in a few hours!! I wanna make my game now! Give me my instant gratification!"

  3. I got two questions:
    1 – I dont know if i miss something but sometimes he not even type a single letter and the code auto fills in. Is it because of his program? I am using MVS but only because it's auto start.
    2 – I completet the UFO tutorial and now doing this one. Now he is talking/typing/go on so fast that its hard to follow. Is there a Tutorial that i should do second?

    ps: Sorry for my bad English, i hope somebody will understand what i am try to say/ask 🙂

  4. My constructive feedback for this whole 2D Roguelike tutorial is that it would be much more enjoyable if we could actually test what we have done at the end of every video.

    It is so frustrating to set up game objects and write scripts without having any interaction with the final product. This is not how software development (and why not game development) works.

  5. What determines whether a GameObject is drawn in Unity? Is this only done when an object is Instantiated? If not, then wouldn't all 'toInstantiate' objects be drawn (at default position (0, 0, 0), as well as the instance objects?

  6. it is better to instantiate individual tiles instead of making a prefab of the "level" and make several level prefabs?

  7. Good video. i've spent over 2 hours on this 15 min video, typing the code, trying to understand it and looking up the classes in the docs 🙂

  8. Good video, thnx to author.
    Also I found a small mistake in subtitles at 2:33: "an integer for rose" when the correct is "an integer for rows".

  9. While copying he's code I made comments with // in each line, to keep track of what each variable would be used for, that helped a bunch

  10. Matt, for future videos please avoid typing scripts on the bottom part of the screen. It becomes very difficult to comprehend what you typed while having Youtube paused. That happened from around 11:20 to the end of the video.

    Besides, thank you, great tutorial!

  11. I had to stop watching this video series. I literally turned my head away, covered my eyes with my hands, and took a couple of deep breaths while watching this video.

    Using an out parameter so you can "return more than one value"? Consistently using the idiomatic style of another language?

    I think the worst was the complete fail on naming variables.

  12. For those who find the pace of this tutorial fast or do not understand the code completely, i will advise (if not already done) to complete the tutorials for:
    1- Space Shooter
    2- Survival Shooter
    3- Tanks
    After you've completed those three you'll find that this tutorial will not spoon feed you but actually let you learn stuff on your own with an amazing pace. Im a beginner at Unity and after completing the other three tutorials i've found this one pretty amazing. I hope after i've completed all these tutorials i will be able to create and publish games of my own. Plus its amazing what these guys at Unity are doing, cheers !!

  13. For some odd reason I had to set my exit column (Last line with text) to 7 rather than -1 as shown in the video anyone have any ideas about that.

  14. Can anyone explain why the tiles are instantiated at X,Y of 1,1 and 1,2 and 1,3 etc… How is it that they are exactly even values. I do not know where this is explained in the videos. How do I know what location to put my objects at?

  15. I found the speed to be just fine. I have never used Unity before. What I would suggest is people first watch the video a couple of times to understand the logic behind the code, and then actually write the code by slowing down the video in settings to half or a quarter of the speed. Good video. Very pleased with what I am learning. Thank you Unity Team.

  16. your BoardSetup() method is so over complicated, it's sooo bad. just do if(){ create wall } else{ create floor }. not all that object passing and transforming…. i know it seems kind of elegant, but it's really inefficient. plus, if you can understand all the crap your doing…. you don't even need this tutorial…….

  17. Thank you so much for this tutorials. You are doing such a great job. Its really cool to watch professional proper coding.

  18. >sees a class in a class
    thinks "hmm, I wonder if that bothers anyone else?"
    >opens comment section

    >slowly walks away from comments section

  19. Great tutorial, thanks! I think people complaining about the jump in pace/difficulty have issues with the syntax more than the content. I'm fairly familiar with java (admittedly not c#) syntax, and I didn't think the procedural generation introduced anything conceptually too difficult. Any confusing areas were explained just fine in the video.

  20. when I try

    GameObject toInstantiate = floorTiles[Random.Range (0, floorTiles.Length)];

    I get a parser error: an embedded statement may not be a declaration or labeled statement

  21. I was starting to feel terrible for not being able to keep the pace while having to constantly stop the video.
    But then I saw the comments and realised this was a general problem.
    Also the video is very funny at 0.5 speed.

  22. So after I read the comments I thought that he just wrote the code really quick and didn't say shit. No he literally explained every line. I guess people just wanted to be coding experts after one video….

    FYI I basically have no coding experience and this was fine for me. I mean yeah I probably couldn't make my own game after just this video but no shit.

    However, I would've liked to know I'd need another program , monodevelop, and how to make a new script…
    like I downloaded this and hit new and there was a lot of options.

  23. This was actually really poorly done, the parts that made more sense were explained more than the confusing ones…

  24. Well, I was watching this on one screen and writing code on another, so I managed to follow without pausing the video, but it did require additional 10 minutes to reread all the code and understand in clearly afterwards 🙂 Nevertheless, it is a lot easier to pause a video than making it 1.5 speed and hearing blurred voices. Good job!

  25. I agree with Kapp. This is an intermediate tutorial, it assumes you're a programmer to some degree. It provies you with a foundation and is well-explained, and yet some people call it linear?

    Wake up – you think a full-time developer gets micro-managed and told how to do things? No. S/he figres it out. Engage your brains people you're all smart, set debug points and learn the flow of the program – nobody can do that for you.

  26. For everyone saying thar this is too fast, or that is not really a tutorial since "he didn't explain all that code".
    Disclaimer: I am a programmer (but no even on C#) and a Unity noob.

    I still agree that this tutorial is at intermediate level and very well done. The code was simple and even had animations explaining "why this loop should be like this, and this should be this way".
    What almost everyone is saying feels bad to me for the professionalism used on this series.
    If you didn't understand any of that code, that's totally fine, just open your mind that maybe this is not yet for your level and you should need to start smaller (which is also totally fine, not a shame as everyone had to do that once), instead of blaming it for not teaching what it expects you already understand.

  27. For all the people saying this isn't a real tutorial I'm not entirely sure I agree. He comes right out at the beginning and says it is meant for intermediate users and expects a degree of understanding how the engine and the code works prior to following the tutorial. I came here with prior programming experience just trying to get some ideas for implementing a roguelike in unity and it worked fine for me. I can understand how some people would find it difficult to follow but if you found it difficult to follow you aren't an intermediate user and this tutorial wasn't made for you. There are plenty of beginner tutorials (I recommend Quill18Creates or any unity official tutorials labeled beginner) for people who cannot follow this one. I started there and worked my way up and would advise that you do as well. Cheers.

  28. I think the problem with this tutorial is the fact that it isn't explained WHY it's being done this particular way. The thought process for getting a solution is just as important as learning the code and the engine. Making mistakes and learning from them is such a useful thing that is missed out here. An effective tutorial would step through the process of "We want to generate a tile grid. What ways can we think of to get this done?" and build it up from there, making mistakes and correcting them, instead of just speeding through the code.

  29. when i read all the comments about the tutorial being too fast i took that as a challenge, i can almost type fast enough, so that is no problem, but i noticed that with tutorials like ball game and space shooter i had a lot of time for guessing the next step and understanding, which i think is an incredibly valuable part in learning a new craft.

  30. XD Watch the segments of coding first and understand what he is doing. Then pause the video and type the code. Otherwise you won't understand the reasoning and logic of the steps. Having 2 monitors is also really productive. People are mentioning that the tutorial is too fast, and some might say it is too fast because you don't have the experience of Object orientated programming or C#/unity blah blah…but I'm familiar with everything he is doing in the coding side and it is still very fast trying to type, listen, and understand the reasoning at the same time (I type around 80 wpm). Make the use of the pause and rewind, you'll need it. There is also the playback speed option is settings that you can reduce. Good Luck!

  31. Great tutorial. I was skimming the comments to see if there was a reason for Vector3 instead of Vector2, but found a lot of people just complaining about the video. I've been a PHP programmer for probably around ten years now, this is the first series that I found the pacing was great. Did I have to pause now and then, yes but it's way better than having to wait for the instructor to catch up to me or explain to me what a float was or how to concat a string. If you have trouble with this video you either need to keep going through the beginner tutorials or you need to take a couple classes on programming.

  32. I don't understand, my script was full of bug so I tried to copy past everything in the one in the completed folder but again errors, but not the same and the strangest thing is that when I start the debug in the original scrpit it says that nothing is wrong

  33. this tutorial is horrible however thank u for ur effort but its so hard to follow up specially that this is my first 2D tutorial for unity

  34. could just skip the 2nd GameObject creation and go straight to toInstantiate = Instantiate(toInstantiate… etc) instead also not really understanding the reason why "as GameObject" is used when it returns a GameObject to begin with.

  35. So how come everything is public in our Count class? No need for Encapsulation?
    I am trying to learn to write clean code, but I keep encountering contradicting practices among different programmers.
    Was [SerializeField] available back in Unity 4.6?

  36. I did have to pause several times, but damn this was the pace I needed, I was tired hearing "By the way in unity you can add game objects in 3 different ways, first in the menu…". Looking forward to and advanced tutorial.

  37. How can I achieve the same except without leaving a one tile spacing around the board to ensure the exit is always reachable? I mean, I still want the exit reachable but I don’t want a walkable path around a procedurally generated maze.

  38. for(int x = 1; x &lt; columns-1; x++) can anyone explain to me why the x &lt; line? Instead of for(int x = 1; x < columns-1; x++)

    Edit : I see in the video he uses my second example, while in the code on the unity site they use my first example

  39. When I make GameManager.cs, the icon changes from the normal "C# on white paper" icon to a sort of grey cog/gear icon. Does anyone else have this (I'm using Unity 2018.2)? Is it a bug or a feature? It only happens if I spell it like this, e.g. Game_Manager and GameManager1 do not produce this effect.

  40. Had to go through all of my code just to find out why it crashed on me xD One little x instead of a y xD

  41. well it's going to take me some time to finish this series. I think I am going to do 1 video a day after seeing how much code i have to go through from now on.

  42. so far so good.
    but what i dont get is that ive written the code exactly like yours but visual studio tells me that the methods we call in SetupScene() are not existing in the current context.
    why is that and how do i fix it?

  43. Great series so far, just learning to apply my C# knowledge to game development and this makes all the sense. If it doesn't, you should probably be watching C# tutorials instead of Unity tutorials for now. You wouldn't watch a tutorial on digitalizing art to learn how to draw, this is the same deal. Learning Unity and learning a coding language are examples of two entirely separate fields that converge to help create the bigger field of game development.

  44. I was typing along with your video and towards the end, I couldn't even remember the variable I was typing as IntelliSense showed it to me. I was like, hmm, is this a built-in function or something? Why was LayoutObjectAtRandom showing in IntelliSense? I paused the video and looked at my code and there it is. hahaha

  45. Watching in 0.75 speed and I still had to pause a couple of times. That's just crazy

    This is super fast, but take a look at the fully completed script within the tutorial. There are comments for every line. It is really helpful to understand the logic of what he is typing

  46. People need to stop complaining about difficulty. If you don't know how to do basic programming, then why are you here? Stop trying to run before you've even crawled.

    Pacing concerns are valid.

  47. Wow I loved the coding in this one. The brain is like a muscle after all, you can only get it stronger by incremently increasing weight to your workouts. The last tutorials were pretty basic and easy (but fun) but my brain is enjoying being challenged in this one. Thanks!

  48. Aside from the fact that my C# skills are obviously severely lacking, my biggest beef with this tutorial is that it was far too *linear*. I would have appreciated bouncing around in the code with justifications (to be fair, maybe he did that after the basic setup; he lost me when he started declaring a shit ton of variables with no discussion on the logic behind them for awhile).

  49. This video, even though it is advertised as being an intermediate video is still too quick. Even as someone who works in c# every day, I have a real issue with someone writing code without actually explaining whats going on. How else do you comment it?

  50. Hmmm been looking through the code, and I'm probably missing something small, but the floor won't generate when I press play. Looked over my BoardSetup function: and that looks fine
    void BoardSetup ()
    boardHolder = new GameObject ("Board").transform;
    for (int x = -1; x < columns + 1; x++)
    for (int y = -1; y < rows + 1; y++)
    GameObject toInstantiate = floorTiles[Random.Range (0, floorTiles.Length)];
    if (x == -1 || x == columns || y == -1 || y == rows)
    toInstantiate = outerWallTiles[Random.Range(0, outerWallTiles.Length)];
    GameObject instance = Instantiate(toInstantiate, new Vector3 (x,y,0f), Quaternion.identity) as GameObject;
    And SetupScene:
    public void SetupScene(int level)
    BoardSetup ();
    InitialiseList ();
    LayoutObjectAtRandom(wallTiles, wallCount.minimum, wallCount.maximum);
    LayoutObjectAtRandom(foodTiles, foodCount.minimum, foodCount.maximum);
    int enemyCount = (int)Mathf.Log(level, 2f);
    LayoutObjectAtRandom(enemyTiles, enemyCount, enemyCount);
    Instantiate(exit, new Vector3(columns – 1, rows – 1, 0), Quaternion.identity);
    Maybe I'm missing an in-editor step?

  51. Who exactly is the audience of this video? Why was it made? At this speed, you explanation isn't even as helpful as downloading the source code and reading the copious amounts of comments. So, its not for beginners, and its too easy to be for experts. Its not explaining anything that an intermediate wouldn't understand better by looking at the code at his own pace…why did u waste your time making this? Not even explaining things like Quaternion.

  52. I've done all the other tutorials then get to this one, although I do follow some of the code and using unity is easy, slow down even on the typing, i'm tying to type the code out my self for good practice AND because I want to learn but you need to slow the pace down for us to actually type without having to pause, start pause start. Glad i wasn't the only one struggling with this.

  53. Worst Learning Tutorials of all by now. Not that i couldn't follow the logic, it's just extremely annoying to hold up with that speed and write along while trying to learn something.
    Total turnoff for newcomers.

  54. I have decent knowledge in OOP and stuff, and i understood everything he said but i'm just not good at creating my own code. So is okay if i keep going or should i improve in coding or something? will i just improve overtime?

  55. I love the pace of the video. I love pausing the vid to catch up, or even repeat some sections, it makes me feel like the video has a lot more practice and knowledge built in it behind those 14 min, maybe a 30 min video, but condensed.

    On another note though. Unity tells me there's a problem with my script and its "[Serializable]" line
    any clue what's going on?

  56. What's happening at line:
    LayoutObjectAtRandom(enemyTiles, enemyCount, enemyCount);
    There's no randomness here, we are passing the same number instead of a minimum and maximum range?

  57. keep getting "no monobehaviour" error even when I add completed script to the object. I'm guessing I NEED the "namespace Completed" crap that isn't shown in this tutorial?

  58. Fantastic tutorial here, thank you so much!

    One thing i cannot stop wondering is, wouldn't it be nicer to use a struct instead of a class for the Count?

  59. Is this a good practice to instantiate and child the instantiated prefab to a parent right away?

    // Instantiate<GameObject>(toInstantiate, new Vector3(x, y, 0f), Quaternion.identity, boardHolder);

  60. Summary of the functions:
    InitialiseList() => Simply creating a List of positions of size 6×6, in the middle of the board. This List will be used to spawn objects at these positions.

    BoardSetup() => Creates floor tiles ( or outer wall tiles if in border) in a 10×10 grid ( game is 8×8 but due to border total is 10×10). Also setting all instantiated objects' parent as the boardHolder.

    RandomPosition() => Chooses a random item from the List created in IntialiseList(). Also, removes that item from list so it's not used again.

    LayoutObjectAtRandom() => Instantiate random tiles from the tile array that you pass, and the number of instantiated objects is between min and max values, that was also passed.

  61. well… i ve been following the tutorial, after seeing people complaining in the comments dont know what to do, can anyone please recommend me some good unity tutorial?

  62. Overall great tutorial and I really really like this series. However, this part of the tutorial is poorly done because it is obvious that the instructor is just copying code from top to bottom from an already completed file. The logical flow of how the code was created is lost.

    For example, the instructor writes out the InitialiseList() function and then immediately writes the BoardSetup() function. BoardSetup and InitialiseList are completely unrelated to each other. Neither of them are used anywhere else at this point. So why write them now? Furthermore, the entire 14 minute video writes a whole blurb of code without once testing or demonstrating (in the editor) any piece of it. This is not friendly to the viewers who are trying to learn, as voiced by some of the comments.

    Suggested Solution: Write the code in a logical and iterative way, and demonstrate the code working in the editor. For example:

    1. First have the Start() function call SetupScene(level: 8). That way we can test the code as we go along.

    public void Start()

    2. In SetupScene, we need to set up the board. So lets write the BoardSetup() function.

    public void SetupScene(int level)




    3. To setup the board, we need a few variables: floor tiles, wall tiles, etc. Set the tiles in the inspector and run the project. We can now see that the board is now set with floors and walls.

    4. Next we need to add some random walls. We need a list to store random positions:

    private List<Vector3> gridPositions = new List<Vector3>()

    Lets write a new function: InitialiseList(), which will initialize the random gridPositions list.

    public void SetupScene(int level)



    5. Now that we have a list of random positions, lets write a new function: LayoutObjectAtRandom that will use the gridPositions we just made.

    6. etc.

    I hope this helps with future tutorials.

  63. alguien sabe porque cuando creo el script de "game manager" este toma un icono de engranaje, pero cuando lo copio de el juego terminado sale norma?

  64. learning in fast forward haha!

    great tutorials! (a little bit of more thorough explanation wouldn't hurt tho)

  65. I am an almost noob in programming from Russia and while this DEFINITELY not easy for the complete beginner, it was not impossible. If you try hard enough you can wrap your head around it, and while this does need a tiny little bit expansive commentary it was at the end clear and logical. Thank you for the effort and video!

Leave a Reply

Your email address will not be published. Required fields are marked *