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 /
This question was closed Aug 18, 2017 at 10:41 AM by GnomenxD for the following reason:

Question is off-topic or not relevant

avatar image
0
Question by GnomenxD · Jul 25, 2017 at 06:58 PM · networkingmultiplayerphotonrpcbool

Best Solution for Multiplayer Shooting

Hello, I'm in the middle of creating a small online game, multiplayer is something I have worked with before and it's going quite well atm. I just got had a little wondering which of these solution or another would be the better for doing shooting in the game. The game is a 2D, top down game and most weapons uses a projectile type so it can be dodged, collision is detected on the client side, which might not be the best solution, but it works atm. It is a fast paced space shooter so being a little off, might not have huge consequence.

The thing I am wondering is, some of the weapon can shoot fairly fast around 2~8 (rough estimate) projectiles per second, if not faster. So would you rather use a more precious solution like using RPC sending very little needed data to all clients and make sure everyone receives the messages. Or use a bool which are serialized between the clients and whenever it is true it would fire the weapon.

I constantly think RPC's are expensive to use, and if you would send 5 of them from one client each second or something like that, wouldn't it be a better solution to just use a serialized bool and maybe some of the projectiles gets lost? Especially if you are suppose to be around 6-10 people in a single room. One of the big problem is I wish to add a spread on some of the weapons and using a bool in that scenario I can't figure out how to sync the bullet spread across the server and think that a RPC with the bullet spread would sync in across the server, for much more reliable projectiles.

What would your solution be in such a scenario? One of these or do you have something better I could look into? I am using PUN (Photon Unity Networking) for networking, if anyone would be wondering, since it is what I am most experienced in.

Kind regards Gnome

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

  • Sort: 
avatar image
1

Answer by RF008 · Jul 26, 2017 at 05:32 AM

you dont have sync all the rpcs to all the clients you can check if two players are in radius close enough to see each other. if they are close then you can send or you just dont have to send any data.

Comment
Add comment · Show 1 · 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 GnomenxD · Jul 26, 2017 at 11:23 PM 0
Share

Oh yeah, of course! Thanks for the answer. $$anonymous$$akes a lot of good sense, don't know why I haven't thought about limiting where RPCs are handled. I can see how that could save data. But how about syncing the damage taken, like I see you could either just have the hp as a serialized variable or just wait some time after the character no longer takes damage and then have them send their actually status to everyone.

Follow this Question

Answers Answers and Comments

164 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 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

Photon - RPC Does Trigger but Does not Show Over Network :( 0 Answers

Unity networking tutorial? 6 Answers

[Photon] Restart scene rpc doesn't work 1 Answer

Photon (PUN) Type Serialization Error on RPC 2 Answers

Problems/Errors With Photon Conversion.. [ScreenShot] 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