Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 khalidhex · May 07, 2016 at 10:51 AM · uinetworkingmultiplayer

Multiplayer basic guidelines for a card game

I'm working on my first multiplayer game (via Lan) , it's a standard card game , right now all the game is based on ""unity UI and drag& drop mechanism only "" .... for the last two days i was reading and watching tutorials about multiplayer and networking in unity , but I'm still confused about some basic stuff , so this is actually not a single question . The only difference between player 1 and 2 is that neither of them can't see the other hand (the card should be face dawn) , they both share the same deck of cards , is it necessary to make a player prefab and spawn it ? .... I already created the draw an throw methods should i change that (split it) to a some thing like a Server draw and Client draw when it's basically do the same thing ?

alt text

capture-20160506-071547.png (101.6 kB)
Comment
Add comment · Show 1
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
avatar image adrien_unity24 · Dec 11, 2017 at 09:46 AM 0
Share

Hi @khalidhex,

Do you find a find a way to solve the problem ? I'm also trying create a multiplayer card game but I have the same problem. Thanks

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Briksins · May 07, 2016 at 12:05 PM

Hi @khalidhex

This is difficult and long topic, however, I'll try to guide you a bit, basically, you have 2 options:

  1. P2P

  2. Authoritative Server

Both of them have pluses and minuses

P2P - where users connect directly to each other and play directly without server in the middle

Pluses:

  • Players play directly and you dont need to worry about hosting server and all problems related to that

Minuses:

  • P2P games more vulnerable to cheating

  • One of the players who randomly will be selected to act as a server will have to allocate extra performance for handling server logic

  • It is much harder to connect 2 players directly because of routers, port forwarding (search for NAT punch-through)

Authoritative Server

Pluses:

  • Easy to control game flow and prevent from cheating

  • Allow easy statistics and analytics gathering

  • Easy to connect 2 players with each other

Minuses:

  • You need to host it

  • You need to solve performance problems as your "the only one" server will have to handle thousands of clients or more

There much more pluses and minuses for both of them, i just highlit main pros and cons


From that, you decide what type you chose and go for implementation

Implementation logic for Authoritative Server:

  • Server holds entire game session details, main deck, and exact cards per player

  • Clients should know only own cards - and see only selected opponent card which he used/revealed right now and all others which were already opened in the past. don't keep in memory full opponent cards list, only the one which was used right now or already were discovered

  • Result of all players movements and final decision made on the server, and the server just notify players about own final decision.

  • Clients trust to server decision without questioning

Implementation logic for P2P:

  • Each of your players should contain 2 logics: Server and Client

  • One of your player selected to act like a server (randomly or based on hardware or network specs or else...)

  • For player the same logic as per Authoritative Server

  • For another player who selected to act as a Server need to implement server logic and client logic together.

Comment
Add comment · Show 1 · Share
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
avatar image khalidhex · May 07, 2016 at 01:32 PM 0
Share

Thanks for the tips :) .. i will go with p2p because it's just a Lan game no need to dedicated server , I saw that unity have a build in " network manger" with a simple interface that handle the Lan connections , but i have struggles with it :( i think it's directed to 3d games like fps ,cars and that type of games where you have the player control only his character and the rest is just an environment objects , plus i cant find a tutorial that focused on 2d games .

avatar image
0

Answer by Goku007 · Nov 25, 2016 at 08:09 AM

i'm also creating my first multiplayer game in unity is LAST Card game i'm also facing all thses problem please can you help me

Comment
Add comment · Share
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

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

91 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

Related Questions

UNet - sync child transform scale 1 Answer

Photon Voice chat and Speech to text plugin not working together 0 Answers

TrailRender not showing in all clients using Mirror networking 1 Answer

How to sync RPC function Photon Network? 1 Answer

Unity 5.2 - How can I keep other players from using a menu? 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