It is currently 18 Aug 2019, 22:02
   
Text Size

Network Multiplayer (Multi-human players)

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, friarsol, Blacksmith, KrazyTheFox, Agetian, CCGHQ Admins

Re: Network Multiplayer (Multi-human players)

Postby drdev » 29 Sep 2014, 21:56

I managed to get the Graphics logic updated so I can show the stack rotated 90 degrees. How does this look?

HumanVHuman.png
drdev
Programmer
 
Posts: 1950
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 564 times

Re: Network Multiplayer (Multi-human players)

Postby 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. :D
drdev
Programmer
 
Posts: 1950
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 564 times

Re: Network Multiplayer (Multi-human players)

Postby 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.
drdev
Programmer
 
Posts: 1950
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 564 times

Re: Network Multiplayer (Multi-human players)

Postby 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)

Postby drdev » 01 Oct 2014, 15:24

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.
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.

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: 1950
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 564 times

Re: Network Multiplayer (Multi-human players)

Postby elcnesh » 01 Oct 2014, 15:29

drdev wrote:
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.
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.

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.
Fair enough, I guess this is much more elegant (and faster) overall.
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)

Postby 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.
drdev
Programmer
 
Posts: 1950
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 564 times

Re: Network Multiplayer (Multi-human players)

Postby 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: 7462
Joined: 15 May 2010, 04:20
Has thanked: 240 times
Been thanked: 933 times

Re: Network Multiplayer (Multi-human players)

Postby drdev » 26 Oct 2014, 02:45

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?
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.

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: 1950
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 564 times

Re: Network Multiplayer (Multi-human players)

Postby 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
Programmer
 
Posts: 3341
Joined: 14 Mar 2011, 05:58
Has thanked: 641 times
Been thanked: 495 times

Re: Network Multiplayer (Multi-human players)

Postby drdev » 26 Oct 2014, 06:00

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
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.

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: 1950
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 564 times

Re: Network Multiplayer (Multi-human players)

Postby 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
Programmer
 
Posts: 3341
Joined: 14 Mar 2011, 05:58
Has thanked: 641 times
Been thanked: 495 times

Re: Network Multiplayer (Multi-human players)

Postby 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. :(
mastroego
 
Posts: 231
Joined: 22 Sep 2013, 14:04
Has thanked: 28 times
Been thanked: 16 times

Re: Network Multiplayer (Multi-human players)

Postby silly freak » 28 Oct 2014, 13:57

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.
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)

(pessimism is the best guide to crypto :P)
___

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)

Postby 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: 1950
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 564 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 7 guests

cron

Who is online

In total there are 7 users online :: 0 registered, 0 hidden and 7 guests (based on users active over the past 10 minutes)
Most users ever online was 287 on 31 Mar 2019, 04:11

Users browsing this forum: No registered users and 7 guests

Login Form