• 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 Opeth001 · Nov 25, 2017 at 05:49 AM · multiplayersynchronizationclient-servergamesserver-hosting

How to Sync Non-Players Actions in Multiplayer Games

Hi All, Im new in Unity so i need some help ^_^.

Im creating a multiplayer Game for android everything is ok with my players sync (Animations , Positions ...) but for exemple if i instantiate a Non-Player Objects like a monsters or zombies ( with auto Command Scripts like Attacking Players ... ) how can i sync their actions with all the other players ??

at the begining i was thinking about making one of the players the host client and will execute the monsters scripts and update for the others, but let's say if i have 100 players and 10k zombies i think the android devices cant Manage all the monsters secripts at the same time no ?!

For Example, https://youtu.be/StJM39WBLFo?t=42s

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
Best Answer

Answer by Opeth001 · Dec 30, 2018 at 03:52 PM

hi guys ^__^ .

sorry for this late response, ill respond to my question in case someone is having the same question in mind.

so to have this kind of feature in your games there are 2 ways:

1) the cheapest way is to make a client between your players being the authoritative one and drive all NPCs ( Non-Players, bots ) but this way your game will be open to cheating and the authoritative client will be the server, that means he will be favored by the network latency ...

2) using a headless authoritative instance of your game as a serve and run it within your pc or vps this way is secured and all your players will have 0 authority, they will not be able to see other players Ip Addresses and you have 100% control over your game logic. ( for production releases you wil certainly need to rent a VPS or a dedicated machine ).

to handle 1000s of NPCs you will need to think in a specific logic which is not updating all the NPCs every Tick update, but each NPC have to be driven by a certain logic that is executed in server & client side like NavMesh in unity, and updating only the NPCs that changed their behaviour ( the focused player or destination ) .

Good luck Guys!

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

124 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

Related Questions

How do I create a multiplayer turnbased game server? 0 Answers

How to communicate from clients to server? 1 Answer

[PUN] Sync gameobjects layer over network 0 Answers

[UNET] Connection between Client and Server dies without message 0 Answers

Multiplayer - Parent's children not syncing 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges