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 artfabrique · Nov 12, 2014 at 12:42 AM · mobileserverdatasyncarchitecture

Mobile game data server sync architecture using changesets.

Hi!

I have a huge game data scheme (model classes & hierarchy) populated with data and serialisable to JSON. Player performs an actions that change specific data in a specific places in a specific time. I need to record players action, reproduce it on a server, and then compare resulting data model snapshots(client and server). I can do it by MD5 checksumm or something like that. If the checksumm are equal the model on server acceps an update from a client. If there is some inconsistency i want to rollback model to the last valid user action and then send it back to client authoritatively with "force update client + rollback".

Question:

What is the basic architectural approach for a Model(MVC) on a client-side/server-side and which methods and where sould be implemented by which parts?

Basically i need a more detailed workflow/class hierarchy to be able to create something like this. I'm developting an RPG with time-management mechanics (like Clash of Clans)

P.S. Forget about cheating issues for a while if you think it's a bad idea to have logic on a client side.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by mediumal · Nov 14, 2014 at 04:05 PM

Your question is a bit broad, so I will speak broadly.

I would treat the networking as a second MVC controller. So on the client side would have a local user controller and a controller for the remote server, whereas on the server side you have an authoritative controller and a controller for the remote client (that isn't authoritative so can only ask nicely for changes). In each case, both controllers manipulate the model, but do not talk to each other.

When the server needs to tell the client to do something, this would be done by the authoritative controller, and when the client needs to ask the server to do something, this would be done by the user controller.

Speaking more specifically, I can't give you a list of methods to implement since it is highly dependent on the specifics of your game, and would be very time-consuming to do so anyway. This is something you'll need to do yourself. I think the approach you talked about involving syncing and checking checksums could work.

Checksums seem like an anti-cheating mechanism though, and you said you weren't worried about it. I'm not too familiar with Clash of Clans, but I believe that two players never interact simultaneously. So if you're not worried about cheating then you can simply have the server send the saved local player's state when the building phase starts, and the saved remote player's state at the beginning of a battle, then the client would simply tell the server what happens and the server would accept it.

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

27 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

Related Questions

Game data sync with server 0 Answers

Where will those XML files be stored if the platform of this game is Web Player...? 1 Answer

Best way to obtain assets from a server. 1 Answer

How i could display or use data from another program 0 Answers

How can I get the information of terrain designed in unity? 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