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 frankyboy450 · Jan 13, 2015 at 10:19 AM · instantiatenetworkspawnsynczombie

server and client sync

Hi Trying to make a simple networked zombie game for my school project. I've setup so you can open the game and host, then open another one and connect(so I can have one run on an empty scene and no screen etc...)

What I'm trying to do is allow people to join and then bring them up to speed about what has happened.

The game is just simple, zombies spawn from the middle of a pit and the players have to build barricades so I was thinking that letting the server spawn the zombie in the pit and using network.instantiate for that. but when a new person joins, there's no zombies in the scene. They haven't been instantiated for him yet.

How would I do so the barricades built, items changed, zombies spawned would be synced with new players?

Comment
Add comment · Show 5
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 softrare · Jan 13, 2015 at 10:36 AM 0
Share

Its quite the generalized question you ask. But I know the pitfalls when working with Unity networking quite well. If you know how to handle them its the best networking engine there is. I have made some API calls easier and automated a lot in u$$anonymous$$$$anonymous$$O: https://www.assetstore.unity3d.com/en/#!/content/13867

avatar image incorrect · Jan 13, 2015 at 10:37 AM 0
Share

When a player connects, he should get the current state of game. I've no experience with networking in Unity yet, but you should learn about serialization and have a look on Photon Unity Networking. Hope that helps.

avatar image frankyboy450 · Jan 13, 2015 at 11:07 AM 0
Share

I don't have any budget unfortunately. Is there some method to instantiate objects on newly connected players? then I could set the server to make lists of all items created and instantiate the prefabs on the new client.

avatar image incorrect · Jan 13, 2015 at 12:57 PM 0
Share

Btw, have you had a look on Network Reference Guide?

avatar image frankyboy450 · Jan 14, 2015 at 09:12 AM 0
Share

Haven't seen that no. Thanks for the share I started the project a while ago and had a break for a month and now I can't remember how I did with the players. if 1 player joins and moves then another one joins and he can see player 1.

Edit. I set the network view State synchronization to unreliable on the zombie and the observed target to the zombie. now when a new player joins he can see the zombies already spawned.

I'm guessing that this method is unreliable and bad for performance. But i could try and disable the sync after a player joins and have a script handle everything like animations, position, rotation etc.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by MidgardDev · Jan 13, 2015 at 11:21 AM

I think there was an option with RPC calls that you could set messages on the history, that's just to let newly connected players know that there was something going on in the network before they connected.

In the documentation, you can see this page: http://docs.unity3d.com/ScriptReference/RPCMode.html that refers to the RPCModes. The option I was talking about is RPCMode.AllBuffered. This option immediately sends the message through the network but also stays buffered for when new connections or slow connections to grab the message.

This will be valid if you use Unity's builtin networking. I don't know if Photon also has this option.

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 incorrect · Jan 13, 2015 at 11:51 AM 0
Share

It's not the best idea because a player has to load every event and recreate it ins$$anonymous$$d of loading objects and their states. It will cause overhead in both transmission of data and it's processing.

avatar image frankyboy450 · Jan 13, 2015 at 07:16 PM 0
Share

So calling that RCP function as AllBuffered and using the regular instantiate? or what would be best do you think?

avatar image
0

Answer by sumit9236 · Jan 13, 2015 at 12:03 PM

For school project,you will use any gaming server just like photon or smartfox server.All gaming server are free to use for 100 or 50 user.Your project is school level,you easily use these server on local school system.All these server are capable to store data to server and specific data to any player.

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 frankyboy450 · Jan 13, 2015 at 12:22 PM 0
Share

I don't like having to rely on an external hosting tool like that. I'm also writing about the use of Unity networking so that wouldn't work for me. Thanks for the suggestion though!

avatar image softrare · Jan 13, 2015 at 12:30 PM 0
Share

Email me, I can send you a free feature-limited version (code in DLL) of my u$$anonymous$$$$anonymous$$O package (which as said uses native Unity networking and no other external libraries): http://softrare.eu/contact.html

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

28 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

Related Questions

Network.Instantiate Problem 1 Answer

How to avoid spawn delay on client? 0 Answers

Network.Instantiate spawns multiple objects 2 Answers

zombie network spawn! help" 0 Answers

Network.Instantiate players at each spawnpoint? Don't use the same spawnpoint? 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