triplea-game / triplea

TripleA is a turn based strategy game and board game engine, similar to Axis & Allies or Risk.
https://triplea-game.org/
GNU General Public License v3.0
1.36k stars 398 forks source link

Brainstorming - Allow anyone to host, remove need for bots! #2850

Closed DanVanAtta closed 6 years ago

DanVanAtta commented 6 years ago

Task:

Specific task:

Desirable outcomes

Question to solve as a team

For games that do not allow direct hosting, how can we allow them to host a game?

RoiEXLab commented 6 years ago

@DanVanAtta I thought about this multiple times now, and here are my thoughts: I believe the main hurdle for hosting is port forwarding. So we'd need a way to connect 2 or more clients to each other without them having to reroute their ports. The most easy-to-implement option is to route all the traffic through some kind of public access point (could be the lobby itself), but the problem with this is that this is probably not going to scale well and all connections will be interrupted if the server crashes or something. I don't know how to achieve this (mostly because I don't know what exactly they're doing), but Steam somehow manages to enable everyone to host their own game and have their friends join them without any further setup. This is probably what we'd want to. I heard about a technique called UDP hole punching and TCP hole punching, but I really don't know how feasible they are to implement for us

RoiEXLab commented 6 years ago

I found the relevant steam documentation for this: https://partner.steamgames.com/doc/features/multiplayer/networking It seems like they first try a hole punching technique, and then use a relay server if that fails. Might be worth trying if theres a java library somewhere.

ron-murhammer commented 6 years ago

Don't most games these days use some sort of 'bot' to host the actual game. Not sure I necessarily agree with the direction or removing bots and moving towards all games hosted by individual players. Especially for tournaments/competitive matches, I would prefer to play on a bot to remove any potential dice cheating. Only way I see this as an option is if you also moved dice rolling to use MARTI for lobby games as well.

prastle commented 6 years ago

Good pt but if not a tourney it would be great if anyone could host. Just my two cents.

ron-murhammer commented 6 years ago

@prastle Agree with making it so anyone can host but just not onboard with removing the concept of some sort of 'bot'.

RoiEXLab commented 6 years ago

@ron-murhammer I agree keeping bots for competitive games is a reasonable argument. But as @prastle already mentioned it would be nice if every player had a host button that would just work out of the box. Even if we end up using relay servers to workaround NATs, they would still be very lightweight and require less server power in exchange for bandwidth.

prastle commented 6 years ago

or a works out of the box with it all through marti?

prastle commented 6 years ago

Off topic but either way I sent ya both an invite to a New Council discussion please join.

DanVanAtta commented 6 years ago

@ron-murhammer suggestion is to make a bot completely transparent. The server would likely need to spin up some resources if the "hoster" can't host. Hopefully, we can do something that is pretty lightweight and only be botteleneck by network IO, (and not CPU). Presumably for those that could host, we could add an option for 'verified dice', so dice are rolled on server and we do the 'virtual bot' configuration anyways.

ron-murhammer commented 6 years ago

@DanVanAtta Yeah, I'm fine with making bots transparent and having a verified dice option would be great. I think we are on the same page now.

DanVanAtta commented 6 years ago

Closing this for now as not immediately actionable. To some extent I wanted to communicate idea/direction that bots become transparent.