Programming a Chess Game in C# | Part 1 - Project Setup

แชร์
ฝัง

ความคิดเห็น • 70

  • @OttoBotCode
    @OttoBotCode  ปีที่แล้ว +5

    *Source code for the entire project*
    If you don't want to write the code yourself, it's available here for 3$ (and free for Patreon supporters):
    www.patreon.com/OttoBotCode/shop/78701
    Your support would be a massive help for me and my channel!

  • @neverbeenoutside4963
    @neverbeenoutside4963 7 หลายเดือนก่อน +5

    Thanks you for this video. This video goes beyond making a chess game. It teaches you how to begin a programming project in visual studio.

    • @OttoBotCode
      @OttoBotCode  7 หลายเดือนก่อน

      Thanks for your comment. I'm glad you like the video!

  • @n__o_m_or_e
    @n__o_m_or_e 2 หลายเดือนก่อน

    love the entire series! i coded along side you and the project works great. i also learned a ton. thank you so much for this tutorial series! i really hope you’ll make a cpu series for this as well!

  • @user-em7pt1ib3s
    @user-em7pt1ib3s ปีที่แล้ว +2

    When I click C# nothing appears. Am I doing smth wrong? 2:22

    • @barhamamerican8003
      @barhamamerican8003 7 หลายเดือนก่อน

      Me Too And I Cant Find Class Library

  • @DrSatti
    @DrSatti 2 วันที่ผ่านมา

    Simply it superb, Thanks.

  • @Another_useless_commenter
    @Another_useless_commenter หลายเดือนก่อน +1

    is it because this video is old or can i not find like anything? the blank solutions etc, i cannot find those things

    • @OttoBotCode
      @OttoBotCode  หลายเดือนก่อน +1

      Maybe you don't have the right components installed in Visual Studio. Try opening the Visual Studio Installer and make sure you have ".NET desktop development" installed.

  • @brock2k1
    @brock2k1 ปีที่แล้ว

    Great video, clear and succinct. Thank you.

  • @Ajamidha
    @Ajamidha 2 หลายเดือนก่อน

    I need help i need you to customise stockfish or any powerful engine for it to play a specific chess variant whose instruction i can provide

  • @rejeanbazinet3844
    @rejeanbazinet3844 ปีที่แล้ว +1

    hi, i'm getting some kind of menu with icon in the title bar, do you know how to put this off ? the first icon said go to live visual tree, the 2nd show in xaml live preview + 6 other icon.

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว

      That menu is not part of your program, it's for debugging purposes. You are probably running the game in Debug mode. If you switch to release mode or run the program using "Ctrl + F5" then you shouldn't see it 😊

  • @jenniferxd8900
    @jenniferxd8900 2 หลายเดือนก่อน

    I was looking for some projects to do in C# for my github portfolio as i'm seeing most of the developer or software engineering roles require some knowledge in C# .

  • @marcoartale
    @marcoartale ปีที่แล้ว +2

    Very informative. Keep up the good work :) What software was used to produce the assets? How did you choose the best dimension for the pictures?

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว +1

      Thank you 😊 I've created the assets in Illustrator and Photoshop. I've tried to pick dimensions large enough that the images should look good in full screen even on a high resolution monitor (without being excessively large of course).

  • @ryanjudd5008
    @ryanjudd5008 9 หลายเดือนก่อน

    Just a quick question, Is this tutorial for a standalone chess game, or is it a UCI compatible GUI for uses with engines like stockfish?

    • @OttoBotCode
      @OttoBotCode  9 หลายเดือนก่อน +1

      This is a standalone chess game 😊

  • @dxdux
    @dxdux ปีที่แล้ว +1

    Very cool project. I know nothing about C# but love everything about chess and programming, I wonder if you will implement the UCI Protocol (that way people can use any engine with your gui). Thanks for the video, will follow along despite knowing nothing about C#!

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว +1

      I had no idea that such a protocol exist, but that's great to know😊If you haven't used C# before, this tutorial might be tough, but best of luck and thanks for your comment!

    • @dxdux
      @dxdux ปีที่แล้ว

      @@OttoBotCode Thank you so much, best luck to you too!.

  • @pfeife21
    @pfeife21 5 หลายเดือนก่อน +1

    Tolles Video.

  • @F.DrKubix
    @F.DrKubix ปีที่แล้ว

    i can't start a program like you in 7:28. Please help :(

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว

      It's "Ctrl" + "F5" on Windows 😉

    • @F.DrKubix
      @F.DrKubix ปีที่แล้ว

      @@OttoBotCode I did as you suggested, but when I open the program, it shows me some kind of exception or something similar. Please help xd

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว

      @@F.DrKubix Maybe the ChessLogic project is set as the startup project. You cannot run a class library. Make sure that ChessUI is set as the start up project.

    • @F.DrKubix
      @F.DrKubix ปีที่แล้ว

      @@OttoBotCode i made it, idk i'll try do this later. Thanks OttoBotCode

  • @AliBakhshi-cw1vd
    @AliBakhshi-cw1vd 8 หลายเดือนก่อน

    Do you also have a video of how to make a chess game like this in p5.js? I really need it

  • @domagojskara
    @domagojskara 5 หลายเดือนก่อน

    I do not see a WPF Application project option on VS for my Mac. Which other option should I use?

    • @rohitkumar-ku4ki
      @rohitkumar-ku4ki 4 หลายเดือนก่อน

      xmarian forms should work,

  • @mensiuscho
    @mensiuscho ปีที่แล้ว

    very nice, thank you. but I think when it comes to move gen, search, hash etc, this structure will be very slow.

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว +1

      It will do perfectly fine for two human players playing against each, but you're right, it's not optimized for speed. My focus has been to make the code as simple and easy to follow as possible.
      Computer controlled players typically generate many states searching for good moves. For these types of players, it would be massively beneficial to use bitboards for representing the game state. The bitboard representation allows for much more efficient implementations of move generation for example.
      Thanks for your comment 😉

  • @AliBakhshi-cw1vd
    @AliBakhshi-cw1vd 8 หลายเดือนก่อน

    Can you do this project in p5.js?

  • @bohemegribb1
    @bohemegribb1 ปีที่แล้ว

    Great videos, thanks! The blank solution is not an available template in my Visual Studios 2022. Have you installed some specific tools or features to be able to choose it?

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว +1

      Not that I'm aware of.
      I read that some people with the same problem solved it like this:
      1) Open Visual Studio Installer
      2) Click the "Modify" button for your Visual Studio installation
      3) Go to "Individual Components"
      4) Check the box for ".NET Framework project and item templates"
      Let me know if it works!
      If not, you can just create a C# Class Library project, and then add a WPF Application project to the generated solution.

  • @SabaterWeshleyC
    @SabaterWeshleyC 4 หลายเดือนก่อน

    What application do you use?

  • @eslamabdelwahid7051
    @eslamabdelwahid7051 10 หลายเดือนก่อน

    What i need to learn before building this project?

    • @OttoBotCode
      @OttoBotCode  10 หลายเดือนก่อน

      Sorry for the late answer.
      You don't need anything particular, as I show you all the code and explain what it does. That being said, it won't make sense unless you know C# basics like Classes, Methods, Arrays and even some more advanced topics like Inheritance & LINQ. If you are new to C#, I'd recommend trying to learn some basics first and then follow my Snake tutorial which is easier. Best of luck! 😊

  • @Buutyful
    @Buutyful ปีที่แล้ว +2

    Hey! Great videos, it would be nice if u used git too in this projects tutorials, git is not user-friendly and u are a great teacher :))

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว

      Thanks. I'll keep your suggestion in mind!

  • @holyshit922
    @holyshit922 ปีที่แล้ว

    This is 2 player only version or play versus computer also possible ?

  • @omeraslanw
    @omeraslanw ปีที่แล้ว

    Great tutorial my friend. I have a question about the video: why don't we just create the project as a C# Windows Form (.NET Framework) instead of a blank solution project?

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว +2

      I prefer WPF over WinForms but I think you're asking me why I made two seperate projects.
      Doing it this way decouples the code for the chess rules from the code that renders the game to the screen.
      Let's say you wanted to use a different GUI framework, like WinForms or something completely different. With our seperation, that would be easy to do because you could simply use "ChessLogic" without any modifications. If we just had one "Chess" project where the UI code and the Logic code were mixed together, then that would be much harder! I hope this makes sense 😉

    • @omeraslanw
      @omeraslanw ปีที่แล้ว

      ​@@OttoBotCode Thank you very much indeed. I get the main idea, your explanation has been quite helpful

  • @NikitaGamer64
    @NikitaGamer64 ปีที่แล้ว

    How to make these movements smooth?

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว

      I assume you're asking how to make the pieces move smoothly from one square to another.
      You would have to replace the UniformGrid for the pieces with a control that let's you position the images wherever you want, Canvas would probably be the right choice.
      With the Canvas you would have to change InitializeBoard to place the image controls correctly (we get that for free using a UniformGrid).
      When executing a move, you would get the image for the moving piece and update its position over a certain time interval. You could achieve this with an asynchronous method and Task.Delay, or perhaps using one of the built in animation classes! 😊

  • @Consteyy
    @Consteyy ปีที่แล้ว

    what is the purpose of the icon png

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว

      It is the icon we use for the game. It will show up in the upper left corner of the window and on the taskbar 😊

  • @shades3692
    @shades3692 ปีที่แล้ว

    The icon is not turning blue for me and is causing errors. Am I missing a download?

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว

      Can you explain what you mean about "not turning blue" and also, what error do you get? Maybe I can help you 😊

    • @shades3692
      @shades3692 ปีที่แล้ว

      @@OttoBotCode I fixed it thank you for offering to help.
      I however have a much bigger issue now. I posted a comment on part #7 of your series describing the error. If you could take a look at it that would be great thank you. 😊
      I just have to say the quality of your content is immaculate. Thank you for making and sharing the world I've learned a lot.

    • @abinb6200
      @abinb6200 9 หลายเดือนก่อน

      Most probably u didnt see the ">" at the end of the XAML ,try to put the icon inside it

  • @sameernasir1
    @sameernasir1 ปีที่แล้ว

    can you provide a zip file link for this game

    • @jshorts9152
      @jshorts9152 7 หลายเดือนก่อน

      Dog the point of the tutorials is to show you how to do it

  • @AliBakhshi-cw1vd
    @AliBakhshi-cw1vd 8 หลายเดือนก่อน

    In what language are you coding?

    • @OttoBotCode
      @OttoBotCode  8 หลายเดือนก่อน

      C# for this project!

  • @TheOddOne2
    @TheOddOne2 ปีที่แล้ว

    Morphy vs Count Isouard huh? :)

  • @andergarcia1115
    @andergarcia1115 ปีที่แล้ว +1

    awesome

  • @yroryrizz3520
    @yroryrizz3520 ปีที่แล้ว +4

    Please add AI

  • @protibadimon4169
    @protibadimon4169 ปีที่แล้ว

    My big hope develop chess game with online multiplayer

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว

      Best of luck! I hope this series will help get you started 😊

  • @akashgite905
    @akashgite905 ปีที่แล้ว

    Upload more videos fast

    • @OttoBotCode
      @OttoBotCode  ปีที่แล้ว

      I'll do my best! 😉

    • @akashgite905
      @akashgite905 ปีที่แล้ว

      @@OttoBotCode loved your to-do list project love from India

  • @CandiceSaffield
    @CandiceSaffield หลายเดือนก่อน

    hi

  • @infinite7708
    @infinite7708 5 หลายเดือนก่อน

    lifu

  • @infinite7708
    @infinite7708 5 หลายเดือนก่อน

    unalive yourself