Network Multiplayer (Multi-human players)
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Network Multiplayer (Multi-human players)
by drdev » 29 Sep 2014, 21:56
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: Network Multiplayer (Multi-human players)
by drdev » 30 Sep 2014, 19:44
As an update, I just released the first version of this Human v. Human support with the latest Android app version.
viewtopic.php?f=26&t=14534&p=163514#p163514
As mentioned there, anyone who can do some playtesting against another person and provide a little feedback will be greatly appreciated. I doubt I'm going to convince my wife to help me playtest on my end.
viewtopic.php?f=26&t=14534&p=163514#p163514
As mentioned there, anyone who can do some playtesting against another person and provide a little feedback will be greatly appreciated. I doubt I'm going to convince my wife to help me playtest on my end.
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: Network Multiplayer (Multi-human players)
by drdev » 01 Oct 2014, 14:19
FYI, I just committed a somewhat large refactoring to CardView in terms of how and when the information is updated. This was necessary to better facilitate the new head-to-head support for the mobile app, plus I think it should help reduce the occurrence of flickering P/T and other attributes.
Please let me know if you notice anything not working about my changes. The only thing I know of is that I might want to tweak it a bit to improve performance.
Please let me know if you notice anything not working about my changes. The only thing I know of is that I might want to tweak it a bit to improve performance.
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: Network Multiplayer (Multi-human players)
by elcnesh » 01 Oct 2014, 14:49
I took a quick look, and do I understand it correctly that you delegated the responsibility of showing/hiding a card to the gui? I was actually trying to prevent that, to avoid people cheating by editing their client and being able to see all the cards.
- elcnesh
- Posts: 290
- Joined: 16 May 2014, 15:11
- Location: Netherlands
- Has thanked: 34 times
- Been thanked: 92 times
Re: Network Multiplayer (Multi-human players)
by drdev » 01 Oct 2014, 15:24
I understood what you were going for, but it was causing issues and made the logic a lot more complicated. We had discussed not worrying too much about trying to prevent cheating, since any network support we would provide would only be for casual play anyway.elcnesh wrote:I took a quick look, and do I understand it correctly that you delegated the responsibility of showing/hiding a card to the gui? I was actually trying to prevent that, to avoid people cheating by editing their client and being able to see all the cards.
Besides, most likely we won't be putting the game logic on a central server, so one of the players would have access to this information anyway.
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: Network Multiplayer (Multi-human players)
by elcnesh » 01 Oct 2014, 15:29
Fair enough, I guess this is much more elegant (and faster) overall.drdev wrote:I understood what you were going for, but it was causing issues and made the logic a lot more complicated. We had discussed not worrying too much about trying to prevent cheating, since any network support we would provide would only be for casual play anyway.elcnesh wrote:I took a quick look, and do I understand it correctly that you delegated the responsibility of showing/hiding a card to the gui? I was actually trying to prevent that, to avoid people cheating by editing their client and being able to see all the cards.
Besides, most likely we won't be putting the game logic on a central server, so one of the players would have access to this information anyway.
- elcnesh
- Posts: 290
- Joined: 16 May 2014, 15:11
- Location: Netherlands
- Has thanked: 34 times
- Been thanked: 92 times
Re: Network Multiplayer (Multi-human players)
by drdev » 25 Oct 2014, 22:37
Is there a directory on cardforge that I could use as makeshift server? I'm planning to implement Forge's network support as a peer-to-peer network, but I need an online directory to read and write usernames and IP addresses for people who are logged in, as well as post challenges and open game requests. This way we don't need an actual running server.
Better yet, could I implement a MySQL database? That would make reading and write easier. I think I could do it all with a single table.
Better yet, could I implement a MySQL database? That would make reading and write easier. I think I could do it all with a single table.
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: Network Multiplayer (Multi-human players)
by friarsol » 26 Oct 2014, 02:38
Isn't a central server a bad idea? Couldn't we just do IP connection, and tell people to join an IRC chat or something to find other players?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Network Multiplayer (Multi-human players)
by drdev » 26 Oct 2014, 02:45
It's not a central server really. It will just be an online database that helps people find others to play against without having to post on the forums or manually enter IP addresses. All the game play will be done using peer-to-peer networking.friarsol wrote:Isn't a central server a bad idea? Couldn't we just do IP connection, and tell people to join an IRC chat or something to find other players?
The only thing that will be stored on this "server" is usernames, passwords, and a list of people looking for a game, with each such entry specifying the IP address and port for the user, the game format, and any user restrictions (challenged single user vs buddies only vs everyone minus blocked users). So if somebody tries to take down this "server", it will have very little effect on Forge.
To further clarify, the only thing I'm going to store online is a few PHP pages to handle HTTP requests from the client, with those PHP pages handling some simple operations on a MySQL database. There will be no Java code or anything that needs to be "running."
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: Network Multiplayer (Multi-human players)
by Agetian » 26 Oct 2014, 05:38
Does this implementation mean that a direct player-to-player connection by IP is not possible and that you need to necessarily access the central database to find a game? Or is it going to be possible both ways?
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3472
- Joined: 14 Mar 2011, 05:58
- Has thanked: 677 times
- Been thanked: 561 times
Re: Network Multiplayer (Multi-human players)
by drdev » 26 Oct 2014, 06:00
It sounds like maybe I should support both. The only thing the central database is meant to do is help you search for people looking for games. Beyond that, everything that happens just uses the IP addresses of each user's machine to send messages back and forth. So if you can find out the IP address of a friend's machine, then you don't need to connect to the database.Agetian wrote:Does this implementation mean that a direct player-to-player connection by IP is not possible and that you need to necessarily access the central database to find a game? Or is it going to be possible both ways?
- Agetian
I'm thinking maybe I should just remove the username and password layer all together. That way there's no need to login. The only thing having a username was really going to be necessary for was maintaining a buddy list, but perhaps that's just getting too close to MTGO. Instead, I'll just maintain a recent list of player names and IP addresses that you've played against and provide you the ability to challenge one of them to a rematch.
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Re: Network Multiplayer (Multi-human players)
by Agetian » 26 Oct 2014, 06:32
Sounds good. And yeah, it'd be good if it's also possible to directly connect to a friend whose IP you know.
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3472
- Joined: 14 Mar 2011, 05:58
- Has thanked: 677 times
- Been thanked: 561 times
Re: Network Multiplayer (Multi-human players)
by mastroego » 26 Oct 2014, 07:00
Ok I'm going to be that guy again, but I'm a bit anxious about this.
With the phone app and multiplayer support Forge "risks" to become very, VERY popular and spread "uncontrollably".
Obviously that's well and good, but, won't this risk to bring the whole house down?
If the Legal Maul falls on Forge, I'm not sure that technicalities like a separate image downloader will be enough to protect it.
With the phone app and multiplayer support Forge "risks" to become very, VERY popular and spread "uncontrollably".
Obviously that's well and good, but, won't this risk to bring the whole house down?
If the Legal Maul falls on Forge, I'm not sure that technicalities like a separate image downloader will be enough to protect it.
Re: Network Multiplayer (Multi-human players)
by silly freak » 28 Oct 2014, 13:57
Yes, do that. Storing passwords is a huge responsibility, even if the service is low-priority. There are bound to be users who reuse passwords, and doing security right is really hard. (for orientation: https://crackstation.net/hashing-security.htm - but there can never be a complete guide to security)drdev wrote:I'm thinking maybe I should just remove the username and password layer all together. That way there's no need to login. The only thing having a username was really going to be necessary for was maintaining a buddy list, but perhaps that's just getting too close to MTGO. Instead, I'll just maintain a recent list of player names and IP addresses that you've played against and provide you the ability to challenge one of them to a rematch.
(pessimism is the best guide to crypto )
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: Network Multiplayer (Multi-human players)
by drdev » 02 Nov 2014, 22:33
Does anyone have access to a server that could host a couple PHP files and a MySQL database? I've figured out a way to support creating and finding network games, but I need a PHP-enabled server to do so. Ideally one that would be difficult to shut down if Wizards decides even this minuscule level of network support is too threatening, though I will certainly do what I can to keep things basic enough so as to prevent competing with MTGO.
- drdev
- Programmer
- Posts: 1958
- Joined: 27 Jul 2013, 02:07
- Has thanked: 189 times
- Been thanked: 565 times
Who is online
Users browsing this forum: No registered users and 112 guests