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 copypasteearth · Dec 08, 2013 at 01:14 AM · networkingmultiplayermobileserverclient

multi-player android and IOS

im about to start making my first multi player mobile game and i was wondering if it is possible to use networking in a way that the mobile devices themselves could be the server and client without using any other services, actually this is my first networking task, this is how i plan to make it let me know if it is feasible

  1. player clicks multiplayer

  2. mobile devices looks for another mobile device who is server without client connected

  3. if thats is the case connect to that server device as client

  4. if that is not the case connect as a server and wait for a client to connect

i was just wondering if that kind of senario would work where the mobile devices themselves could do all of the server client work

any advice is greatly appreciated, thank you for your time :)

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

Answer by Kiloblargh · Dec 08, 2013 at 01:38 AM

Yes. I'm making an iOS/Android/webplayer game for 2 players, and my networking is already working. "Without using any other services" is a tricky one. The most common noob solution is to use Unity's default Master Server. The problem is, it's only intended for testing, not guaranteed to be online every time you try to connect to it, and not meant to be used at the scale of a finished commercial game. Of course, most people never even finish their first multiplayer game and never achieve any amount of success or popularity if they do, so that never becomes an issue.

If you have the resources to host your own Master Server, it is very easy to achieve step 2. If not, you still have to have your own domain and will have to use WWWForm calls to access PHP scripts to connect to an SQL database. That is what I'm doing but I can't give you much help (I have 11 different PHP scripts that are pretty specific to my game) so you'll just have to read all you can about PHP elsewhere, prepare for a headache and stock up on the coffee.

Comment
Add comment · Show 6 · 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 copypasteearth · Dec 08, 2013 at 01:53 AM 0
Share

thank you for your time, so Unity's default $$anonymous$$aster Server, how does that work, by the package name? to uniquely transfer information?

avatar image Kiloblargh · Dec 08, 2013 at 01:58 AM 0
Share

I'm not entirely clear on what you're asking. You do need a unique string for the "game type" but it does not need to match the package identifier. Have you read the $$anonymous$$aster Server docs?

Also, keep in $$anonymous$$d that all the master server does is matchmaking. Once you have joined a game, one player is the server, one (or more) is the client, and all information is going directly from one to the other, not through the master server anymore.

avatar image copypasteearth · Dec 08, 2013 at 03:30 AM 0
Share

so what your saying is that using the calls to unitys master server cannot be used in a finished published mobile app?

avatar image Kiloblargh · Dec 08, 2013 at 04:01 AM 0
Share

"Should not," not cannot. I'm sure there are finished published mobile apps that use the default master server.

avatar image copypasteearth · Dec 08, 2013 at 04:07 AM 0
Share

ok thank you for your time, i really appreciate it

Show more comments
avatar image
0

Answer by Julien-Lynge · Dec 08, 2013 at 01:15 AM

What you want is called RPC. Please do a search for 'unity rpc', and check out the examples, script reference, etc.

Good luck!

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 copypasteearth · Dec 08, 2013 at 01:49 AM 0
Share

thanks for your time im going to look into this

avatar image copypasteearth · Dec 08, 2013 at 03:43 AM 0
Share

can i use just regular Unity3d code for networking in a published mobile app? only unitys networking code and nothing else back end?

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

16 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

Related Questions

Unity networking tutorial? 6 Answers

Why can't the client move a networked object ? 1 Answer

Multiplayer push object error. 0 Answers

Do i need to have 2 seperate apps communicating for server/client relationship? 2 Answers

Help with multiplayer connection 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