Hello, World!
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
9 posts
• Page 1 of 1
Hello, World!
by LightningBolt » 29 Mar 2012, 01:32
Hey, everyone. I stumbled upon Forge a few weeks ago and I have been continually impressed by it. Forge is as far I can tell, among the most complete and polished rule and card implementation around - and by a wide margin (but you don't need me to tell you that). Well, I figure it's about time I stop freeloading, so here I am.
As for my background, I am 21 years old and I am currently attending college studying computer engineering. My first love was Java but then Python stole my heart. I don't play much MTG anymore - all the people who I used to play with have moved away, which brings me to...
As for what I hope to contribute to Forge: my interest is singularly in implementing multiplayer. This is something that I (and I suspect many others) would really like to see in Forge and I would like to take a crack at doing it.
I have been able to find very little about the current status of multiplayer. Is there anyone else currently working on implementing it? What (if any) necessary features are currently in place? Was anything ever tried but then abandoned because it was too complex? Is there any other super-important information that's not readily available on these forums/on the wiki?
~LightningBolt
As for my background, I am 21 years old and I am currently attending college studying computer engineering. My first love was Java but then Python stole my heart. I don't play much MTG anymore - all the people who I used to play with have moved away, which brings me to...
As for what I hope to contribute to Forge: my interest is singularly in implementing multiplayer. This is something that I (and I suspect many others) would really like to see in Forge and I would like to take a crack at doing it.
I have been able to find very little about the current status of multiplayer. Is there anyone else currently working on implementing it? What (if any) necessary features are currently in place? Was anything ever tried but then abandoned because it was too complex? Is there any other super-important information that's not readily available on these forums/on the wiki?
~LightningBolt
- LightningBolt
- Posts: 4
- Joined: 29 Mar 2012, 00:58
- Has thanked: 0 time
- Been thanked: 3 times
Re: Hello, World!
by friarsol » 29 Mar 2012, 14:09
Hey Bolt,
Welcome aboard. Just to clarify, are you interested in adding multiple AI opponents or Network Play vs other Humans? I'm going to answer as if you meant "Multiplayers" not "Multihumans", although the answers are similar for Network Play.
The largest hurdle is that the original design of Forge was merely for 1v1 against a Computer opponent. There were many shortcuts made along the way where an assumption of two players, one human, one computer were made to simplify coding. One of the largest one of those was the UI.
Doublestrike has been working on revamping the UI of late, and in this process has been adding some hooks for multiple Player boards. This is a fairly major prereq for multiplayer.
There's also AI considerations. Our AI isn't the most robust AI in the Rules Engine scene, other AIs have Minimax decision trees and so forth. Related to this, a lot of the card scripts are based around only going after the Human and not considering a third combat source and so forth. I'm not sure how much extra effort just on the AI side, but it's also a large task.
In general, there has been some groundwork laid to add flexibility, but there's still a large amount of work to be done. I'd recommend starting off smaller (perhaps adding support for EDH) so you can focus on seeing how things work in the code-base. Before trying to jump right in to something so huge. Others have attempted it before and scrapped whatever work they have done (and burnt themselves out in the process).
Welcome aboard. Just to clarify, are you interested in adding multiple AI opponents or Network Play vs other Humans? I'm going to answer as if you meant "Multiplayers" not "Multihumans", although the answers are similar for Network Play.
The largest hurdle is that the original design of Forge was merely for 1v1 against a Computer opponent. There were many shortcuts made along the way where an assumption of two players, one human, one computer were made to simplify coding. One of the largest one of those was the UI.
Doublestrike has been working on revamping the UI of late, and in this process has been adding some hooks for multiple Player boards. This is a fairly major prereq for multiplayer.
There's also AI considerations. Our AI isn't the most robust AI in the Rules Engine scene, other AIs have Minimax decision trees and so forth. Related to this, a lot of the card scripts are based around only going after the Human and not considering a third combat source and so forth. I'm not sure how much extra effort just on the AI side, but it's also a large task.
In general, there has been some groundwork laid to add flexibility, but there's still a large amount of work to be done. I'd recommend starting off smaller (perhaps adding support for EDH) so you can focus on seeing how things work in the code-base. Before trying to jump right in to something so huge. Others have attempted it before and scrapped whatever work they have done (and burnt themselves out in the process).
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Hello, World!
by moomarc » 29 Mar 2012, 16:24
Aw, I miss Braids. She kept things rather "lively" while she was around.friarsol wrote:Others have attempted it before and scrapped whatever work they have done (and burnt themselves out in the process).
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Hello, World!
by LightningBolt » 30 Mar 2012, 02:48
Sorry for the ambiguity, I actually met 1v1 network play. Having peeked at the code, I think that this would be easier than implementing additional AI opponents. Also, it's the thing that I want to add.
~LightningBolt
~LightningBolt
- LightningBolt
- Posts: 4
- Joined: 29 Mar 2012, 00:58
- Has thanked: 0 time
- Been thanked: 3 times
Re: Hello, World!
by friarsol » 30 Mar 2012, 03:08
I wasn't trying to convince you that you shouldn't add it, just that you should try to get familiar with the code before jumping in and doing such a complex Job. I think you may be right that Network Play is an easier task than Multiplayer, since on your local version aside from transferring the game state, the game can treat the second Human as a the AI for the most part, (any ability resolution decision making would need to request answers instead of running through AI code)LightningBolt wrote:Sorry for the ambiguity, I actually met 1v1 network play. Having peeked at the code, I think that this would be easier than implementing additional AI opponents. Also, it's the thing that I want to add.
One of the early milestones is saving state (since state is needed to transfer across the network), I believe this is one of the things Braids was working on when she threw in the towel. I haven't looked at the details of network play, but some other complications would involve players being on different versions, waiting for network instead of calling AI response functions, etc.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Hello, World!
by LightningBolt » 30 Mar 2012, 03:57
That's roughly the approach I was planning on taking. The first thing that I plan on doing is developing a way to serialize the game state. This would be a nice milestone because it can be saved and loaded locally without having to worry about all of that messy network nonsense. After that, I will implement a function to load a game state and swap the two players in the game state. At this point, the question is: when does the game state get passed to the other player? The logical starting point for this is whenever priority is passed. I'll have to investigate other situations where the opponent can act without having priority, but that's much later. With all these pieces, it's a simple matter of putting them together ("simple", in this case, meaning "simple after several highly nontrivial tasks are completed"). The end result of this is, hopefully, to bypass the AI altogether.friarsol wrote:I wasn't trying to convince you that you shouldn't add it, just that you should try to get familiar with the code before jumping in and doing such a complex Job. I think you may be right that Network Play is an easier task than Multiplayer, since on your local version aside from transferring the game state, the game can treat the second Human as a the AI for the most part, (any ability resolution decision making would need to request answers instead of running through AI code)LightningBolt wrote:Sorry for the ambiguity, I actually met 1v1 network play. Having peeked at the code, I think that this would be easier than implementing additional AI opponents. Also, it's the thing that I want to add.
One of the early milestones is saving state (since state is needed to transfer across the network), I believe this is one of the things Braids was working on when she threw in the towel. I haven't looked at the details of network play, but some other complications would involve players being on different versions, waiting for network instead of calling AI response functions, etc.
As for how I will deal with different client versions: I will require the players to have the same client version.
~LightningBolt
- LightningBolt
- Posts: 4
- Joined: 29 Mar 2012, 00:58
- Has thanked: 0 time
- Been thanked: 3 times
Re: Hello, World!
by Max mtg » 30 Mar 2012, 15:54
I would rather perfer having a server that holds the gamestate and a number of players sending commands to it via jabber or something similiar. Server freely shares open info and never sends away the what player should not know. Not sure if Forge ever comes to this point at all.
If you are about sending gamestate to and from other player, well, that would mean one can view his or her library, opponent's hand and so on, armed with a debugger or special client build... but anyway that would be better than be able to play against AI only
If you are about sending gamestate to and from other player, well, that would mean one can view his or her library, opponent's hand and so on, armed with a debugger or special client build... but anyway that would be better than be able to play against AI only
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Hello, World!
by LightningBolt » 30 Mar 2012, 22:21
A separate server would definitely be ideal. Perhaps it would be worthwhile to use it as an intermediary if for no other reason than to allow for future expansion more easily.
An end goal would definitely be to not send the entire game state, but security is not really my concern at the moment. It also would also necessitate some mechanism for merging the new game state with the old game state on the server. All doable in the future, but I don't want to worry about it for the time being.
~LightningBolt
An end goal would definitely be to not send the entire game state, but security is not really my concern at the moment. It also would also necessitate some mechanism for merging the new game state with the old game state on the server. All doable in the future, but I don't want to worry about it for the time being.
~LightningBolt
- LightningBolt
- Posts: 4
- Joined: 29 Mar 2012, 00:58
- Has thanked: 0 time
- Been thanked: 3 times
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 15 guests