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 /
  • Help Room /
avatar image
0
Question by g__l · Jul 30, 2016 at 10:39 AM · networkingclient-serverdocumentation

Basic Networking Issues - Guidance Required

Hi, I have been trying to simple networking in which i can send a message from one device to another. My first thoughts were 'Would I have to pay to use unity multiplayer functionality?' so I found this [article][1] which seemed clear and directly explained how I would need to do networking in order to maintain zero costs on my behalf. After further searching I discovered [this][2] bit of unity documentation which seems to explain how to do networking simply in the same way described in the previous article and eluded to simple message sending which I desired.

But I have seemed to ground to a halt in this journey of discovery as I have found no further articles or videos to guide me and answer my questions which i still have about how this works.

Hence today i am asking :

A - Do you know of any further articles or videos which would guide me through this?

B - Am i going totally in the wrong direction?

C - Could you answer any of my key questions as below?

  1. When creating a server, i.e below, what port should i listen on and should I worry about 'port forwarding' which is a phrase I see often chucked about.

    NetworkServer.Listen(4444);

  2. When creating a client, i.e below, what i.p address should i use? I presume it is that of the client's device but how do i know what it is?

    myClient.Connect("127.0.0.1", 4444);

  3. How do i get 2 devices to connect, my idea was to make any device by default become a client and then somehow 'check for servers' and if not it would create its own server with local client for a client to connect to, this way there would be no excess servers... ?

Thanks you very much for reading my question and I hope it seems clear, please check the links so that this will make sense to you. Any answers are greatly appreciated so that i can continue on my journey of understanding.
[1]: http://stackoverflow.com/questions/36091976/can-i-use-the-unity-networking-hlapi-without-paying-for-the-unity-multiplayer-se/36092168 [2]: https://docs.unity3d.com/Manual/UNetClientServer.html

Comment
Add comment · Show 3
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 g__l · Jul 30, 2016 at 12:29 PM 0
Share

If you require any more detail or there is anything i can do just say

avatar image toddisarockstar · Jul 31, 2016 at 05:57 AM 0
Share

you kinda have to have a server to make game copies talk. when most machines log onto a router they can be given a different local IP address everytime. (this is called a dynamic IP) so the problem is finding where they are at. the difference with a server is it always stays at the same address and port so people can always find it (this is called a static IP). if you want to learn about networking you should start by setting your pc to a static IP. its as simple as changing a setting in your computer to ask for the same local ip address everytime. then logging into your router and picking a port that is forwarded to your computer. you can google a youtube video and do it in twenty $$anonymous$$utes.

anyways, a lot of game servers only job it to keep track of all the players and there current addresses and then hand out that info so players can directly connect to each other.

I just use port 23466 think its unity's default. you can use any port around there and it will work as long as the server is set to listen to the same port as the client is trying to connect too! there are some port numbers that popular programs use that you want to avoid. you can find the lists on google. but 23466 and 23467 isnt used by anything big.

unitys source code for there basic server is free to anyone. you can down load it off there website. or you can just find a copy of the build. if your on a static ip you simply just click on it and it works. if you need to know what IP you clients need to connect to, just type "what is my IP" into google on your server machine and it will tell you your public IP that your internet provider gave you.

I hope this answers some questions for you!

avatar image g__l · Aug 04, 2016 at 02:00 PM 0
Share

Thanks @toddisarockstar, having been down the route of using this version of networking I found I lacked knowledge and was getting into many complex question so i decided to use photon networking which has free elements but in the long term i may look back into this when (if) my user total grows photon will become costly. Thank you very much for your reply it may serve me well in the future, sorry for my late reply.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by g__l · Aug 04, 2016 at 02:01 PM

An answer by the person who made the stack overflow article i linked can be found here - http://stackoverflow.com/questions/38673176/unity-client-server-basic-questions

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

69 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

Related Questions

How do I make an object move smoothly? 1 Answer

Sending NetworkPlayer object with ClientRpc 0 Answers

Adding Clients after Log in 1 Answer

Please help me with KeyNotFoundException - on NetworkServer.connections 1 Answer

Multiplayer - Host can damage client, not vice versa? 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