Author Topic: 2 games  (Read 2403 times)

iandi

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
2 games
« on: March 26, 2015, 07:50:24 AM »
I have two different games. Can they actually sync over one channel even if the scenes have different names?

So for example:

Game 1 has scene_1 and Im joining with JoinChannel(1, "scene_1")

and

Game 2 has a scene scene_2 and joins with JoinChannel(1, "scene_2")


I have connected both players to the same server on localhost:5127

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2 games
« Reply #1 on: March 27, 2015, 11:25:44 PM »
Both players will be in the same scene. The first player to join the channel also sets what scene will be loaded, so although the second player will specify a different scene, this value will be ignored and the first scene will be used.

iandi

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: 2 games
« Reply #2 on: March 30, 2015, 11:17:56 AM »
I tried this, but it doesnt work. Both players are successfully joining channel 1 but there is no sync happening.

Is there any playable testing file I can get? I tried everything for a week hardcore now and I never managed to get any connection between two instances even if the game was the same.

I find Tnet is a lot of magic and full of hidden things.

Unity Networking took me 1 hour to set up and sync data, and other products like Remote Variable Call 1.0 as well. I was hoping Tasharen is intuitive.

I never get ports opened, the only location is a special internet cafe and I dont know why.

However, although starting a server which does not explicitly says it has NOT open a port, both games tell me they have joined a scene but then nothing happens.

Even going through your webplayer test I always get some errors like "the server intentionally refused" or "Unitys security policy does not allow". I just want to have a working example ;)

Also its unclear to me if I can use local host 127.0.0.1 or if I have to use an external IP.

Any help is appreciated

Andi

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2 games
« Reply #3 on: April 01, 2015, 11:37:40 PM »
Web player won't allow you to host anything, but you will be able to establish TCP connections provided the server has a policy server active. This is a Unity thing -- they explicitly restrict web player for security purposes.

Did you check TNet's examples? It comes with an example that lets you connect to a server and enter the same channel, communicating between them. If anything, TNet should be much easier than Unity's networking, so my guess is what you're running into is something very obvious. Did you watch the tutorial video with TNet where I create a basic multiplayer game from scratch?

127.0.0.1 is LOCALHOST -- this always points to the computer you are running it on. So if you have a laptop and a desktop, when you try to connect to 127.0.0.1 on the laptop it will try to connect to the laptop. When you run it on the desktop, it will connect to the desktop. You need the real IP address of the machine you are trying to connect to, not 127.0.0.1.