Chess Game in Unity Tutorial! Part 1: Architecture and Board Generation - creating3dgames.com

Chess Game in Unity Tutorial! Part 1: Architecture and Board Generation

GameDevChef
Views: 10318
Like: 205
Because chess popularity is on the rise lately, let’s try to make our own chess game using Unity. In this video, which is the first part of a series, we will learn how to design a good game architecture using layers of abstraction and how to generate pieces on a board based on previously created data. Let’s begin!

——Project on Github——

——UML Diagram——-

——Assets——

Low Poly Chess Pack:

Wooden Floor Materials:

Table with chairs x3 Free:

28 Comments

  1. After watching the video, I felt that it was difficult for me) Since everything is done very professionally there.
    How to learn to do as you do?)I seem to have problems with OOP … It's hard to navigate.

  2. Why do we create a private class and not a public one in the "BoardLayout" class after the [Serializable] attribute? 5:42
    After all, the fields of this class are still public…

  3. can't add script behaviour Iobjecttweener. The script class can't be abstract…..help..

  4. bro you are amazing………..very very nice stuff………………..but we want more and more…………….keep helping

  5. please make any video about setting up an enviroment

  6. Please make Multiplayer/onljne version tutorial ^^

  7. I got an issue on 8min 50 sec.. Get the error that CreatePiecesFromLayout is not avaible in the current context. Same thing with piecesCreator. Need help

  8. Holy Banana, I learned so much from this video, thank you for showing us your workflow and describing everything so clear. Your code architecture is an eyeopener and took me to another level…

  9. you are a literal life saver thank you so much for this.

  10. I have a question: Did you design and write the diagram first and then build this strait from there, or did you kind of do both as you went? It seems it would be difficult to create this diagram from scratch with all the fields and methods, but I'm also sort of new to the Unity APIs.

  11. How to download file projects. May I have the project file, for my reference in making games

    Gmail: adholfien@gmail.com

  12. When you type `StartNewGame();`, you are able to click select something to insert a skeleton function code for the `StartNewGame` function. Do you mind sharing how that is achieved? For example, is that done by an extension in Visual Studio?

  13. In this file ( https://github.com/GameDevChef/Chess/blob/Part1/Assets/Scripts/Utils/MaterialSetter.cs ), we can see that we are using the following code:

    private MeshRenderer _meshRenderer;
    private MeshRenderer meshRenderer
    {
    gets
    {
    if (_meshRenderer == null)
    _meshRenderer = GetComponent<MeshRenderer>();
    return _meshRenderer;
    }
    }

    The aim of the above code seems to be making sure that we have MeshRenderer component associated with this class. If that's the case, can we use the below code instead?

    private MeshRenderer meshRenderer;
    private void Awake()
    {
    meshRenderer = GetComponent<MeshRenderer>();
    }

  14. Remember to add “using System” on top of the “ChessGameController” AND “PieceCreator” scripts, everyone. Else you will be like me, wondering for a few hours why referencing “type” always gives errors… 😅

  15. So can someone help me out with something? So I'm not following this step by step because I'm doing a twist on chess. I have three teams in my game. In the PieceCreator script in the GetMaterial method he uses a ternary conditional saying "If team color is white use the white material and if the team color is black use the black material. Now why does it work this way, but I can't get it to accept 3 values? I've done it in the past basically A ? B : C ? D: E but it won't work here. Says that type cannot implicitly convert type "TeamColor to bool". So why does this work with 2 values but not 3?

  16. Thank you! You're a great help. Great to brush up one some OOP (because I forgot most of it), I don't see a lot of that in YouTube tutorials.

  17. Aie, I did it in 2D, it was a little more difficult to convert the materials to sprites, and I have 12 different sprites, 2 separate sets for each team. But, great tutorial! This is not a criticism of your tutorial, just happenstance lol

  18. I had a grid designed, but I scrapped it to follow this tutorial without having to adapt my whole script. Basically I just had a 2D array for the board and a series of if statements on board generation that checked where a piece was using the mod operator, so if it was at x mod 7 == 0 and y mod 7 == 0 we can assume it was a rook, etc etc. It's a little less flexible, but at least you don't have to go through a 32 item scriptable object and assign each spot individually lol

  19. Hey! Great tutorial! When I get to the part at 18:30 where I am supposed to assign the script to their respective pieces, I get the error: "Can't add script behaviour IObjectTweener. The script class can't be abstract!"
    Just wondering if you had any insight into that!

    Thank you so much!

  20. Hi , Great Job! We are looking to develop 3D chess, please let me know how can we get in touch. I have already emailed you. Thanks

  21. pleas how can i increas numper of boxes to make them not in 8×8 in 14×14???pleas answer

  22. bro you need to chill out with the speeding up. if you want people to learn, go a little slower. I know you want to fit this into 20 min but you don't have to.

Leave a Reply

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