Author Topic: UI Starter Kit: Starlink (NGUI + TNet)  (Read 53508 times)

LightSky

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 56
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #30 on: July 05, 2013, 12:45:05 PM »
@LightSky: Via TnTcp? Do you mean just TCP? All connections are done via TCP. UDP is an option for frequent data that you may or may not use. Timing out is most often caused by forgetting to choose "run in background" when building Unity.

Yes, I meant TCP, which you call TnTcp in your script for TCP (as seen in pic below).  I already had it set to "run in background" and I have not changed any code in the project, all I did was enter my external IP into the TCP script in the inspector.  It knows the server is running because It connects but it has trouble maintaining a stable connection. The TNet example scenes work fine as well, so it is something with this scene.

http://i.imgur.com/vBNR3uz.png

Edit: Thanks, that was it.  It is working fine now.
« Last Edit: July 10, 2013, 12:21:45 PM by LightSky »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,149
  • Toronto, Canada
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #31 on: July 05, 2013, 03:21:47 PM »
TNTcpLobbyClient is meant to connect to a TCP-based lobby server. You are running a UDP-based lobby server, and instead you have your TCP Lobby Client trying to connect to your game server. This isn't going to work.

Port 5127 = game server.
Port 5129 = lobby server.

You need to launch your server with -tcpLobby 5129 instead of -udpLobby 5129, and have your lobby connect to port 5129 instead of 5127.

brianbraatz

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #32 on: July 06, 2013, 05:10:42 PM »
Question!:
I purchased the UI Starter kit + the game

trying to get them working together- and digging.. and digging and digging..

hopefully this is a quick quwstion-
One used TNmanagwer to connect and the other uses TNAutoJoin..

I havent figured out the difference between these yet--

my basic question is- from the UI Starter kit code- what would be the recommended way to kick off the game with the multi-players enabled etc?

I am going to be digging into this for the rest of the day and all day tomorrow- but thought it wouldnt hurt to post the question while I dig..

thanks!

Brian

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,149
  • Toronto, Canada
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #33 on: July 06, 2013, 09:57:21 PM »
Starlink UI Starter Kit doesn't use Auto series of scripts. It connects directly using TNManager.Connect. Auto series of scripts are for convenience purposes -- they simply automate certain aspects of TNet if you choose to use them, but TNet is more robust when you use it directly (like Starlink does).

brianbraatz

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #34 on: July 09, 2013, 10:01:47 PM »
Question-
I have spent all weekend digging through this code

1- I love it!
but
2- I am still struggling a bit

question- on the youtube video the "server list" screen WORKS!- but on the package I purchased it does not

I am *******HOPING********* to get this functionality:

a- user can start a game
b- other users can see the game show up in the lobby
c- users can just click on the game in the lobby to JOIN it
*** AT NO TIME SHOULD THE USERS HAVE TO TYPE IN AN IP ADDRESS***

NOW- here is how the code works:

a- user can start a game in the lobby- other users can see it - but NOONE can join it- it just beeps at you when you try
b- a user can start a game via the "direct" screen- but the OTHER users have to type in an IP address to join
this DOES work- nicely- but making them type an IP is not going to work for me

(I am targetting the Ouya- so typing in a ip address is extra , extra painful since its controller based with no keyboard)


I am HOPING to actually get both of those things to work together- so user's dont have to type IP addresses..

I am curious- why have the lobby screen with the nicely populated game list if the rest of the screen doesnt work?
is that just an example to get us started?

It seems weird though- that clever things like the low power mode and stuff would be implemented but the lobby not???

or am I doing something wrong?

I am continuing to dig on this- I have a day job- so I end up staying up very late - I have already spent about 18 hours on this specific issue- testing and digging.. I will sneak out again at lunch with two laptops and frantically hack on this at lunch.

I am a little frustrated since I THOUGHT the lobby support was a part of the package-maybe it is and I am doing something wrong? Is it intentionally not complete- or am I just an idiot?

In any case- ANY advice or guidance appreciated.. I am having to tunnel through the code and put hundeds of log statements to try to figure out how to get the lobby to actually allow the user to join a game.. A little guidance might save me many future hours ...

ANY help- even evil taunting- appreciated :)


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,149
  • Toronto, Canada
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #35 on: July 09, 2013, 10:12:04 PM »
I am assuming the video you're referring to is Starlink -- the game itself.

Starlink has a server hosted on an Amazon EC2 micro instance that players connect to for multiplayer games. This is also the server that actual game servers register with -- and what allows you to see the list of servers.

It wouldn't make sense to have the UI Starter Kit connect to actual game servers, but if you run your own TNServerInstance somewhere (for example locally), and connect to that, you will be able to see a list of servers to choose from.

Going into the LAN gameplay menu also lets you host your own LAN servers, letting other people on your LAN see this game and join it without having to type in an IP address.

brianbraatz

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #36 on: July 10, 2013, 08:17:19 AM »
"I am assuming the video you're referring to is Starlink -- the game itself.
"
No, I am referring to the video where you demo the unity package

"Starlink has a server hosted on an Amazon EC2 micro instance that players connect to for multiplayer games. This is also the server that actual game servers register with -- and what allows you to see the list of servers.

It wouldn't make sense to have the UI Starter Kit connect to actual game servers, but if you run your own TNServerInstance somewhere (for example locally), and connect to that, you will be able to see a list of servers to choose from.
"
right- all I am saying is 50% of the networking functionality in the "UI Starter Kit" unity package - I cannot seem to make it work.
should it work? or is it just a beginning and not intended to be complete?


"Going into the LAN gameplay menu also lets you host your own LAN servers, letting other people on your LAN see this game and join it without having to type in an IP address."

Ok - that functionality doesnt work for me.

I am trying to figure out 1- is it just me\do I have a config problem or 2-is the "LAN SERVER" part of the package just not complete

video:
UI Starter Kit: Starlink (NGUI+TNet)
http://www.youtube.com/watch?v=nNDKr716MT8&feature=c4-overview&list=UUQGZdUwzE8gmvgjomZSNFJg

go to about 8:30

in the VIDEO, you start a lan server and JOIN it-

YEAH! THATS WHAT I WANT!

When I saw that video, it inspired me to purchase everything ..

but it doesnt work ...

I have tried re-importing the package and double checking everything-when I make a lan server and try to join it myself or have another computer join it by clicking on the server (LIKE IN YOUR VIDEO)- it just beeps and does nothingt

if I make a server via the "direct" menu selection- it DOES WORK- BUT THE USER HAS TO TYPE IP ADDRESSES

I THINK the code you put in the package is incomplete- thats my current theory..

I am having to dig deep into your code and learn it to debug it - and unfortunately I am not a NGUI or Tasharent Networking expert so its taking me a bit..






brianbraatz

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #37 on: July 10, 2013, 09:49:39 AM »
Michael,

I am beginning to think that your package from the unity store is broken.

I have done a clean import of the project a few times and tried several different computers, and still have the same problem.

The screen where we can find a lan server that's being broadcast and click on it and JOIN it-

*** in your video- you click on it and it goes to the join screen ******

*** when I try it- it just beeps and doesnt nothing- but it DOES seem to start a server **

** in the package I got from the unity asset store- THERE DOES NOT APPEAR TO BE ANY CODE TO LAUNCH the join screen!!! ***

I am thinking the source of my problems could very well be just a broken unity package

Michael, so when I click on the server in the LAN screen (where I discovered another server on my lan) WHAT code should cause me to connect to that server and view the games he is publishing?

maybe if you can tell me what code that is supposed to be doing that last part- I can doubly-verify how you think it should work vs how the code I got from the unity asset store works..


thanks!

Brian




brianbraatz

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #38 on: July 10, 2013, 09:51:18 AM »
I go to lunch in an hour- so will spend some more time hacking on that then- hopefully I will be able to give you more informtaion

brianbraatz

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #39 on: July 10, 2013, 10:48:21 AM »
here is a much more clear \ succinct write up:
-----------------------------------------------------------

Here is the functionality I need:

1- a computer on the local network hosts a game (Ip is assigned by local network)
2- other users can go to a lobby screen to find any games being hosted on the local network
3- users can click on the game they found in the lobby to join the game- local network only

with the package I purchased

1- the direct connect works (yeah!) but they have to type in an IP
and
2- the lobby screen works for broadcasting games (yeah!) - but that screen does not allow users to join the server they selected (*********code appears to be incomplete, or broken?? or doesnt run on my computer?**************)


My main question is:

"Should the lobby screen WORK? (in the video it does) Or is that intentionally not complete?"


LightSky

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 56
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #40 on: July 10, 2013, 11:27:14 AM »
My main question is:

"Should the lobby screen WORK? (in the video it does) Or is that intentionally not complete?"

Everything in the video is working as shown (at least for me).
-It could be that TNet is required for the networking aspect, I didn't use it without TNet so I don't know, I am assuming this is the reason.
-Or that his package is broken and should reimport.

Edit:  Tried a fresh project install of Starlink and it won't even allow you to create games without TNet.  Also the LAN worked instantly upon importing TNet.
« Last Edit: July 10, 2013, 11:36:19 AM by LightSky »

brianbraatz

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #41 on: July 10, 2013, 11:36:22 AM »
hmm...

what the hell? maybe my computers have gremlins..

lightsky- when you go to the lan screen- start a server- and then CLICK TO CONNECT TO IT- does it connect?

I am talking about the LAN connect screen NOT the direct connect screen

brianbraatz

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #42 on: July 10, 2013, 11:42:04 AM »
note:

UI Starter Kit: Starlink (NGUI+TNet)
http://www.youtube.com/watch?v=nNDKr716MT8&feature=c4-overview&list=UUQGZdUwzE8gmvgjomZSNFJg

go to about 8:30

he clicks on play-then lan- then he CLICKS on the name of the server found

does that part work for you?

thats the part that for me- it just beeps and does nothing

also looking at the code- there doesnt seem to be any code to launch the "join" window- in the video he clicks on the server- and the join window shows up




ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,149
  • Toronto, Canada
    • View Profile
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #43 on: July 10, 2013, 12:11:57 PM »
Did you import TNet and the tnet_integration package that comes inside the Starlink UI kit?

brianbraatz

  • Guest
Re: UI Starter Kit: Starlink (NGUI + TNet)
« Reply #44 on: July 10, 2013, 12:13:14 PM »
hah

learning more ...

ok - the LAN screen appears to be using UDP- whereas the direct is using TCP-

that would explain why if you host a game with direct - you cannot find nor join with the lobby..

OK

Michael,

The UDP lobby support in the package on the unity asset store appears to not be functional

though in your VIDEO - it appears to work:

UI Starter Kit: Starlink (NGUI+TNet)
http://www.youtube.com/watch?v=nNDKr716MT8&feature=c4-overview&list=UUQGZdUwzE8gmvgjomZSNFJg

go to about 8:30

he clicks on play-then lan- then he CLICKS on the name of the server found

PART of the problem in making the code work - is the place where that click on the server happens
UIServerListItem- has no rational access to the other windows etc

I TRIED putting a hack static in exposing the UIPanel channelListWindow from the UIDirectCOnnect screen- but that did not work :(

I need to learn more about all the parts here . clearly, and how to make them work..

in the MEANTIME:
!!!!!!!!!!!!!!!!!!!!!!!!
************
REQUEST FOR MICHAEL
**************
!!!!!!!!!!!!!!!!!!!!!!!!!!!
can you either
1- share the code of how to get the UDP lobby code working like in your video? (for those of us who purchased :) )

OR

2- Provide some guidance on how to get the UDP lobby working like in your video- PLEASE?!?! :)

for YOU- you wrote the code- so its "easy" for you-

but for me I am slower because-

I am learning 1- the ui tookkit, 2- ngui, 3- tnet ALL AT THE SAME TIME- so for me the debugging \ hacking etc has been slow and painful

I had a four day weekend-

I was hoping to finish my game over the four day weekend-

INSTEAD I spent the entire time wrestling with these things.. :(

welp my lunch is over- now I need to rush back to work

I am hoping michael responds to this by the time my day ends- when I get home tonight will have a few hours to hack on this some more..