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 /
avatar image
1
Question by connorb1 · Feb 22, 2017 at 09:16 AM · networkingmultiplayerdatabasemultiplayer-networkingdata storage

How do game devs go about making a user's multiplayer experience persistent?

I come from a web/mobile development and CS background but now I want to dive into game dev. I have looked into services like GameSparks and Playfab which seem to be an entire one stop shop. That is fine and all but I also looked into PUN and UNET. To me they just seem like servers to host multiplayer games. They don't really handle data. How do I go about storing data such as stats, level, inventory and so on?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Nischo · Feb 22, 2017 at 11:05 AM

As many things, there is not definitive answer, i can only tell you how i would approach it.

For the persistent part i would use a database (which one really depends on the amount of user) and a simple server, even a webservice could work for the beginning. The purpose of this server would be to store user account data, players, inventory, avatar customization, etc. etc. And that can be queried like "What items do i have", "Add this item", "Whats my credit amount?" "Where did i log off last time?" etc.

The realtime part i would do with regular PUN or UNET and use "instances" of the same level to load balance the players into it.

Lets say its an agent game, where 4 agents go on to do missions but first meet in the HQ with many other agents to form groups and start missions. I would let my server "host"(a bit like a dedicated server) multiple "rooms" of the HQ Level for players to connect. When the player logs in, the game chooses one of the available HQ instance rooms that still has free space in it and joins it. The rest from here is regular realtime multiplayer, mixed with occasional calls to the persistent server to update or query persistant information.

I hope that gives you a rough idea how you could start working on a persistent multiplayer game.

Comment
Add comment · Show 2 · 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 connorb1 · Feb 22, 2017 at 07:38 PM 0
Share

Thanks for answering. This helps a lot. $$anonymous$$y only worry is the inefficiency that would come with sending data to the database very often due to the real time nature of the game. Say my player was chopping wood and getting experience for it. To send that to a database every time seems like it would be extremely inefficient.

avatar image Nischo connorb1 · Feb 23, 2017 at 12:48 AM 0
Share

Its not as bad as you might think, when people talk about frequent updates in the multiplayer sense, they usually talk about multiple times per frame. Updating the Experience is probably not done on a per frame basis but ins$$anonymous$$d every TimeToChop like 1sec for example, which is in $$anonymous$$ultiplayer not that frequent. But of course that depends on the amount of simultaneous players. You could choose update cycles, like only sending to the persistent server when a mission is done. Otherwise you are looking rather quickly at a more $$anonymous$$$$anonymous$$O like approach, which gets way more complicated and then is out of the scope of my provided solution.

avatar image
0

Answer by GameSparks_Clare · Apr 03, 2017 at 11:09 AM

Hi @connorb1,

When you sign up to GameSparks, you get access to a NoSQL Database with a really simple interface and API for saving, reading and updating player-centric and game-centric information.

For example, when a player log's in, there is a special document in a database for this player that can track things like Level, Stats etc... what's more, you can create entire collections of data for things like Inventory. Not only that but a lot of functionality that is common to games comes out of the box, like Virtual Good management, IAP integration, Achievements, Push Notification config, and is all easily testable through our new Portal. You can find tutorials on these, and more, in GameSparks Learn+ https://docs.gamesparks.com/

If you have any further questions about GameSparks or would like to discuss how best to implement this and other features in your game, please head over to https://support.gamesparks.net/support/home to get in touch with our support team. We'd be more than happy to help!

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

7 People are following this question.

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

Related Questions

Unity networking tutorial? 6 Answers

Loading spawned prefabs upon connecting to server? 1 Answer

Setting up a GUI System for room selection , Multiplayer (Photon/Unet) 1 Answer

Multiplayer game with multiple level 0 Answers

OnStart ___ vs OnLobbyStart ___ methods from NetworkManager and NetworkLobbyManager 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