Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by akhirrashad · Sep 15, 2021 at 09:20 PM · networkingmultiplayermultiplayer-networkingturn-basedmultiplayer networking

How to decide an asynchronous multiplayer solution for a turn based mobile chess game?

Hello, I am seeking advice on how to best implement an asynchronous multiplayer solution to my mobile battle chess game. It’s the last thing that I need to add in this project before releasing it. I don’t need Realtime connections or to keep track of gameObjects’ transform positions.


The web developer who I paid a lot of money to create a custom chess api and database for this project randomly ghosted me. I’m very passionate about this project so I figured I can learn the multiplayer part in my limited free time. I read about UNet, Photon (PUN, Bolt), Mirror, PlayFab, MLAPI, SmartFox, Websockets, and many other things. However, I was wondering if you could recommend a particular solution for my game.


Requirements for Multiplayer solution:


  1. Allow a player to be matched with another player based off their chess ELO

  2. Allow a player to send a game request to a friend regardless of ELO

  3. Because chess games can last quite a while, the game MUST be able to run asynchronously. I don’t want the game to automatically end if a player closes the app on their phone for a few hours.

  4. I want the find the cheapest solution that doesn’t compromise functionality. I’m a solo indie developer, I’m young, and I just had a daughter. Money is tight, but I understand that every solution is going to have a fee.

  5. Lastly, is there an online database that you recommend to use to save player data like ELO, unlocked assets, friends, etc.. client side. I’ve been looking at Firebase, but from what I’ve heard it’s a far from ideal solution.


Background information:


I have a fully functioning battle chess game. Currently, a player can play against the computer and play against themself (moving for both sides). The legal moves are validated client side by a C# chess engine that is communicated with via UCI I know that multiplayer solutions can be costly, so I’ve made the game such that the only information needed to make a move is a string and two ints:


  1. A string fen (the current board position in FEN)

  2. An int moveStartIndex (index of the square where the move started)

  3. An int moveEndIndex (index of the square where the move ended)


This is how I imagine multiplayer working.

Instantiating pieces and the environment are done client side with a function called SetPiecesByFEN(string fen).


  1. The current player loads the currentFEN board position from the server

  2. The current player makes a move

  3. The moveStartIndex and moveEndIndex are set

  4. The currentFEN, moveStartIndex, and moveEndIndex are sent to the server and are added to a list called moveHistory

  5. The currentFEN is updated to match the board position after the new move and is sent to the server to be set as the current board position.

  6. The other player is alerted that a move has been made

  7. The other player loads the currentFEN board position from the server

  8. The other player makes a move

  9. Repeat until game over or player resigns



Thank you for your time!!


P.S. For anyone who’s wondering, the moveStartIndex and moveEndIndex are used to be able to show a replay of the latest move played. They aren’t necessary for UCI. It’s a feature that I added for the convenience of the player. Imagine returning to a game several hours later, there is a quick replay of the latest move played before allowing you to make your move.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

279 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

UNET NetIDs for Scene Objects Mismatched Between Client and Server 1 Answer

How to find local player gameobject? c# 3 Answers

Unity UNET - Client unable to move 0 Answers

I'm using Unity MLAPI. Why does every client have id "0"? 0 Answers

HELP! Why is my Player 2's camera like this?? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges