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 /
avatar image
0
Question by Naeim · Jul 24, 2014 at 04:37 PM · multiplayertimerpccheat

looking for an idea about syncing (timing) a multiplayer game

I'm designing a multiplayer game that have a bounce ball.

instead of having a ball and use OnSerializeNetworkView to sync it's position (because it's laggy sometimes) i want to create 2 balls in 2 sides (one ball in player1 field and one ball in player2 field).ball move is deterministic so i need to check it's position every some seconds to make sure players are not cheating and the ball is moving correctly ...

how can i do this? where to start ? i think i can send the position of ball by RPC calls every 1 sec but when the rpc call send from player1 to player2 , player2 will receive it a little later and can't check ...

Comment
Add comment · Show 2
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 koray1396 · Jul 24, 2014 at 04:52 PM 0
Share

I would like to express that this is more of a forum topic.

If this will be a air hockey or pong game, this is nearly impossible.(I have tried in the past) Achievable, but not fun to play.

The best result I could do was, sending information of player object and ball position to other player, only when player object touches the ball. both sides do their own calculations of physics, velocity etc... also you may send information of target points of players to each other.

several methods can be used for that, you should $$anonymous$$imize the data to be sent and received. an example would be sending a header and $$anonymous$$imal information. if you transmit player position, you may do something like this;

lets say player position is a vector of 5.431231, 7.456412,0.

byte[] playerPosition = new byte[5]; playerPosition[0] = (byte)'A'; //header to recognize what information is received. playerPosition[1] = (byte)54; playerPosition[2] = (byte)31; playerPosition[3] = (byte)74; playerPosition[4] = (byte)56;

then in the receiver side, you should be decoding the data received.

I'm not sure how Unity networking works, would not want to give any false information, someone else can help better.

I don't know, if something better can be achieved with current tech, I have not seen a good one tough. And also this is the reason why you mostly see multiplayet in turn based games, and games that latency can be neglected and does not affect gameplay much.

avatar image Naeim · Jul 24, 2014 at 06:54 PM 0
Share

hmmmm tnx . good idea ... i can check position after collisions.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Countdown issue with Networking 0 Answers

Changing Model and spawning player by RPC 1 Answer

Photon Networking: RPC call doesn't work over other clients 0 Answers

How to spawn a multiplayer non-player prefab object and sync with all clients? 0 Answers

Networked if statement 1 Answer


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