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
1
Question by berting01 · Feb 07, 2012 at 01:51 PM · networkingmultiplayer

how to test your multiplayer game

I want to ask on how to be able to test if my multiplayer game is working before building it. is this possible? if yes, how?

Comment
Add comment · Show 6
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 Fattie · Feb 07, 2012 at 02:33 PM 1
Share

Hire a number of top-flight $$anonymous$$P developers, buy a tremendous amount of equipment, formulate a healthcare plan, take care of local government regulations for employees, deal with unions, get a good accountant and secretary, and get to work. :-/

avatar image berting01 · Feb 07, 2012 at 02:36 PM 0
Share

:) ok hahaha

avatar image marcfielding · Feb 18, 2014 at 12:54 PM 0
Share

What network library are you using, Unity, Photon?

avatar image sun_spider · Feb 21, 2014 at 01:24 AM 0
Share

Can you please post the line of code that sets up your network and the one that connects your client? I have no idea what I'm doing wrong here, but it just won't seem to connect to localhost.

avatar image jose-araujo · Mar 07, 2018 at 01:12 PM 0
Share

Hi @JustAGuy, I was have exactly the case you mention with the server in one project and the client in another project.

For some reason, when I set the host in one project and the client in the other project, I get the error message "Failed to spawn server object, did you forget to add it to the Network$$anonymous$$anager? assetId=10a722dbb60160542b789e20d437496e netId=2 UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()", while if I run just a single project in the editor and build the same project, then everything works. I tried also running the editor/build in one project and the build in the other, and I get the same error. I also set "run in background" as you suggest but no effect.

An interesting thing is if in each of these projects I use the NetworkClient and NetworkServer without a Network$$anonymous$$anager, then I can do message passing between the two projects without any errors.

Any idea why I could be having this problem?

avatar image meat5000 ♦ jose-araujo · Mar 07, 2018 at 01:16 PM 0
Share

Dont ask questions and post them as answers, especially on old threads. Write a new question

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by senad · Feb 07, 2012 at 02:08 PM

I have a multiplayer project and I test by using two instances on the same computer using the localhost ip address. One I build and run, the other I run in the editor.

I can currently only debug the one running in the editor however. So maybe I will soon start testing with two separate machines/PCs.

Comment
Add comment · Show 5 · 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 sun_spider · Feb 17, 2014 at 11:42 PM 0
Share

@senad: I am trying to figure out how to do exactly that. Can you explain in detail or point me to a place that shows clearly how to do the 2 instance localhost thing? I am relatively new to unity and stumped!

avatar image senad · Feb 18, 2014 at 09:20 AM 0
Share

So I have separate builds for the server and client. I build them as executables on windows and can start each in its own thread on the same machine.

The process that I need to debug I keep in the editor.

When connecting the client to the server ins$$anonymous$$d of a IP address I use "localhost". You could use 127.0.0.1, too.

Unfortunately, I can not direct you to online tutorials, because I learnt this at Uni. :)

Edit: Corrected the IP.

avatar image sun_spider · Feb 19, 2014 at 12:46 AM 0
Share

Is your machine connected to the internet? When I set up a server it always uses my internet connection IP. So 1.0.0.127 doesn't seem to work. Part of it seems to be the port... what port do you use for your client and server?

avatar image senad · Feb 19, 2014 at 08:59 AM 0
Share

If you are using localhost, it does not matter, what your computer is connected to, as long as you have a network device. The server is listening to your local IP of your computer. That would normally be the IP you get from your DSL router, if you are in a home network. (but it does not really matter)

On the client you type in 'localhost' as the IP. This will connect you to the server on your local machine automatically.

The port you need to chose, but I use a fixed IP on client and server. It should not be used / reserved and should be the same on client and server. I think I use something like 25000.

I hope it helps! :)

avatar image CrunchyPudding · Jan 22, 2015 at 08:37 PM 0
Share

@senad You have the loopback address backwards. It should be 127.0.0.1. @sun_spider that is why you cannot get it to work, but don't worry about it because using 'localhost' does the exact same thing. No need to try both.

avatar image
1

Answer by UScripter · Jan 24, 2015 at 11:22 PM

A mulitiplayer game can be tested by building the project and play with the build and with unity's editor(If u have one program for server and client).If u have two programs just play the server in the editor and play the client in the editor each in its project(and build the client and play with it too if u want two clients).

NOTE:when testing networking in the editor make sure "Run in background" is checked on (by opening Edit-> Project Settings-> Player then check "Run in background" from the inspector)

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

11 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

Related Questions

Unity networking tutorial? 6 Answers

setup a php master server 2 Answers

Network Tutorial Interpolation - TPS Auth 0 Answers

Instantiated objects does not appear on clients when connecting 1 Answer

hovering usernames with photon 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