Members | Sign In
All Forums > Development
avatar

Trivial local network configuration would be nice

posted May 30, 2013 23:59:06 by kurt
It would be nice if Artemis supported zeroconf/bonjour for local game discovery.

http://www.zeroconf.org/
https://developer.apple.com/bonjour/
page   1 2 next last
17 replies
avatar
stonefish said Jun 12, 2013 08:18:31
Bonjour? No thank you.
Don't most game clients just send out a simple broadcast packet (or three) and wait for all the available LAN servers to respond? Bonjour isn't suitable for that simple bit of functionality.
avatar
kurt.werle said Jun 12, 2013 15:16:21
Bonjour is just Apple's implementation of zeroconf, which they happen to make available on windows, too.

The functionality you describe is exactly what zeroconf is for - zero configuration. It's a library. Why reinvent the wheel?
avatar
stonefish said Jun 12, 2013 15:40:18
I don't describe zero configuration. Everyone's LAN is already configured, via their router. If someone's isn't, that's not really up to Artemis to fix.
The service location features of zeroconf are another matter, and are a heavyweight solution to a problem that can be fixed with about three lines of code. No need to bring in another library/prerequisite/complication to solve such a small problem.

But hey, Thom can do whatever he wants. So far, everyone's been fine with connecting via IP.
avatar
kurt said Jun 13, 2013 15:31:25
I'm thinking that writing a service discovery mechanism is heavier than using a well tested and maintained library.

I am not fine with manually entering IP addresses.
avatar
RussJudge said Jun 13, 2013 17:06:42
The problem is that if you are using Artemis over a WAN, such as across the Internet, which a few of us do--then any method other than manually entering IP addresses cannot be made to work. If every Artemis server broadcast itself across the internet so that the clients could automatically find it, there would be no way of knowing which server you'd be connecting to.
Russ
Author of Artemis Mod Loader.

Sign up for a free Dropbox account.
avatar
stonefish said Jun 13, 2013 17:32:56
Well, you could build up a server browser system, but that's a whole other can of worms. We're just talking about LAN stuff here.
avatar
kurt.werle said Jun 13, 2013 18:46:34
The WAN solution is the same as many internet-wide multiplayer games have used since quake. Someone sets up a game registry server. Servers register and clients grab a list. The server would have to specify game name, probably the person running it, and whether or not there is a password.

There are plenty of obvious options - public vs private (where the client would have to know the game name ahead of time), etc.

But I started this topic for what I imagine is the 90% case: a few users on a LAN want to play. Could be some of them are not tech savvy. The server should use zeroconf or something similar. Clients should be able to just click 'join game #somename#.'
avatar
LawsonThompson said Jun 16, 2013 03:02:03
The core logic for LAN game discovery is conceptually easy; the simplest requires UDP support. UDP is listed as one of the "time permitting" parts of the 2.0 release.

Quick summary: TCP and UDP are two different protocols which ride on top of IP networks.

A TCP conversation sets up a direct connection between a Client and a Server, and includes things like ensuring packets arrive in order, detection of lost connections, acknowledgment of packets, retransmit of packets which didn't arrive in time, etc. This is a very solid connection which ensures all the traffic reaches its destination, eventually.

A UDP conversation is more like "let's just open a channel and blast packets at each other on those channels as fast as we care to." We don't care if packets are acknowledged--and in fact don't even try to--and just assume all the data is getting where it needs to.

Bonus: UDP can send a packet to "everyone on this network listening on port X". That's where service auto-discovery comes in.

So: for Artemis, the server could start up and just send out a broadcast UDP pulse every 3 seconds saying, "Anyone listening on UDP port 2010, the Artemis server is at 192.168.1.14."

The client starts, listens on UDP port 2010, then sees the server UDP broadcast go flying by. Server found!

.... aaaand that pretty much taps out my knowledge of IP, TCP, and UDP in this context.
avatar
stonefish said Jun 17, 2013 07:03:33
Yep, that's more or less exactly how I had it figured.
Although it might be quieter if it were the client doing the broadcasting on demand, and the server just replied once.
avatar
JanxJelantru said Jul 01, 2013 18:29:24
I'm not sure what the problem is with entering in an IP Address.

Assuming we're all on the same LAN (we all plugged into the same switch or are all on the same wifi network), the server PC puts the IP address in nice big letters.

The client side asks for the IP address of the server, which anybody in the LAN party can see by walking over to the host PC and looking at the screen.

how hard is it typing 192.168.1.113?

this is actually pretty simple stuff that anybody using a networked computer should actually what an IP address is, how to look theirs up (ipconfig) and how to verify they can reach a server (ping).


Whats a bit harder is setting a WAN game if you aren't in control of your firewall and have NAT setup (most people do nowadays). That's where some of this auto-discovery/game directory stuff would be useful.


avatar
kurt said Jul 01, 2013 18:41:13
You are comfortable typing in IP addresses. And you seem to all start at the same time. And all your friends are also comfortable typing 'em.

But I think that local network discovery should be automagical. It should just work. There should be no typing because it is possible for there to be no typing. That's what computers are for, right? To do things that are easy to do without direction.

What's more, we sometimes have folks come in late to a game. What was that IP? We were on 192.168.1.103, but we switched, didn't we? Is it 192.168.1.107, now? Why is that even a thing? Why not do it automagically?

And, as I said, for remote access the thing to do is the same as every quake game has had for about the past two decades - a central server with a list of available games. But that's a different issue, and not so much the one I'm interested in solving, right here for the 90% case.
avatar
xavierwise.tsn said Jul 01, 2013 18:49:45
Hosting a server over the internet is something that is regularly done on a Saturday night by a lot of different players. I am able to run a server and people from across the world can connect. It didn't take me much effort to figure it out, if you do a little bit of research you'll find that all the information is out there and others are willing to help you out if you get stuck. I think some of the ideas mentioned above aren't necessary as the system is already a pretty simple, yet effective one. After doing a little more research, I also found a way to have a set IP, so rather than entering my external IP, people just enter an my-ip.com address.

People simply enter my IP in to their client console and then connect. I agree with JanxJelantru, above, how hard is it to enter a series of numbers?
avatar
kurt said Jul 01, 2013 19:30:40
You're right. People can generally type.

But I feel I'm also right: people generally should not need to.
And I'm right: ip addresses are not always visible (after start, etc).

You (all) are probably too young to remember: there was not always DHCP. People used to have to configure/enter their own correct IP address. Now we don't, because that's dumb and it should be done for you. Same thing.
avatar
JanxJelantru said Jul 01, 2013 21:33:44
Well, I had an Artemis game for my 40th birthday last night. I am more than old enough to remember.

And I do expect every human on the planet with an internet connection to know how to find their IP address and know what it's basically for. Just like I expect everyone with a drivers license to know how to change a flat tire.

It's rudimentary and it's how the system works. Just because we have DHCP, doesn't mean you shouldn't know how to find your IP address (in fact, that's how you debug if DHCP is down).

Entering in a direct IP address cuts out a lot of handshaking code that doesn't always work. Going straight to an IP always works.

I don't disagree that it would be nice to have. But it's not a high priority considering the demographic playing this game.

I've only played 2 sessions of the game, I'm not entirely sure why anybody would be able to join late, as I would have assigned all the stations to the PCs that are present, so that somebody would have access to them. A latecomer would have to wait until the current game was over anyway.

avatar
kurt said Jul 01, 2013 21:55:49
And I do expect every human on the planet with an internet connection to know how to find their IP address and know what it's basically for.


I disagree. Most computers are appliances - they should plug in and work. It isn't like people know how phone calls are routed. And it is especially unreasonable to expect folks to know or care about their IP addresses, as most of them are meaningless private network addresses that are in use many times simultaneously.

Not to put too fine a point on it - but why would you ever want to know your computer's IP address?

Entering in a direct IP address cuts out a lot of handshaking code that doesn't always work.


Which is why I recommended using a zeroconf library like bonjour.

Going straight to an IP always works.


No... it does not.

I don't disagree that it would be nice to have. But it's not a high priority considering the demographic playing this game.


I'm curious - what demographic do you think that is?

I've only played 2 sessions of the game, I'm not entirely sure why anybody would be able to join late, as I would have assigned all the stations to the PCs that are present, so that somebody would have access to them. A latecomer would have to wait until the current game was over anyway.


Last night: we have 5ish playing. Someone arrives late with an ipad. It should be as easy for them to join as firing up the game, clicking the local game name, and selecting a ship/position that is not already taken.
[Last edited Jul 01, 2013 22:03:39]
Login below to reply: