Great job there! how about magarena in a web?
by ubeefx
Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins
Great job there! how about magarena in a web?
by fesja » 19 Feb 2012, 01:37
I've just discovered this program while I was searching for the current state of MTG programs. Congrats to all the devs; I'm a developer myself and I am very impressed by the quality. I have 2 questions/topics to suggest:
Improve the way of adding cards
I believe the new approach is the correct one. It doesn't make sense to have a java class per card. You can have a sqlite/txt database, which each row is a card with a standarized way of adding the features of each card. I'm sure you will reduce the quantity and quality of the code by a lot. If you have doubts about the new approach, I'd be glad to share my opinions.
Make it a website
This one is more agressive, but it will make complete sense. Instead of having clients, it can be a website. There is a technology called Node.js (javascript over v8 engine) that suits perfectly for this user case. Duels would be like a chat, but instead of passing messages, we would be sending orders (attack, block, draw card). jQuery can take control of all the drag & drop of the cards. It would be easier to play against other people and against the machine, and also joining tournaments, having an online reputation on the platform, etc.
Despite it would be "just" rewriting the java code into javascript, I know it's too much effort specially of occupied developers. Let me add another reason to do it, if you learn node.js well; there are many companies in the Bay Area (SF) which are paying over $100k a year for Node.js developers. Not bad while you code for hobby
Of course, Wizards may not like it, so it would have to be on a outside server or reaching an agreement with Wizards to licence the brand and charge users per buying extra cards or playing tournaments.
Just some ideas I've thought
Improve the way of adding cards
I believe the new approach is the correct one. It doesn't make sense to have a java class per card. You can have a sqlite/txt database, which each row is a card with a standarized way of adding the features of each card. I'm sure you will reduce the quantity and quality of the code by a lot. If you have doubts about the new approach, I'd be glad to share my opinions.
Make it a website
This one is more agressive, but it will make complete sense. Instead of having clients, it can be a website. There is a technology called Node.js (javascript over v8 engine) that suits perfectly for this user case. Duels would be like a chat, but instead of passing messages, we would be sending orders (attack, block, draw card). jQuery can take control of all the drag & drop of the cards. It would be easier to play against other people and against the machine, and also joining tournaments, having an online reputation on the platform, etc.
Despite it would be "just" rewriting the java code into javascript, I know it's too much effort specially of occupied developers. Let me add another reason to do it, if you learn node.js well; there are many companies in the Bay Area (SF) which are paying over $100k a year for Node.js developers. Not bad while you code for hobby

Of course, Wizards may not like it, so it would have to be on a outside server or reaching an agreement with Wizards to licence the brand and charge users per buying extra cards or playing tournaments.
Just some ideas I've thought

- fesja
- Posts: 2
- Joined: 19 Feb 2012, 01:13
- Has thanked: 0 time
- Been thanked: 0 time
Re: Great job there! how about magarena in a web?
by melvin » 19 Feb 2012, 03:39
Using card scripts definitely reduces the amount of code since we can express certain effects once in code and refer to it from the card script using its name. Ultimately we would need some sort of effects DSL or card language parser to have the flexibility needed to express all sorts of different effects. The way we are doing it now is with special phrases, basically an extension of ability keywords, but it is not as flexible as we would like.fesja wrote:Improve the way of adding cards
However, designing a card effect language up front is difficult. So our process is as follows: 1) Create the card effect in Java. 2) Refactor the card/game engine to minimize the code. 3) Construct the implementation automatically by looking out for special phrases in the ability text.
Putting the game on the web does make a lot of sense for popularizing the game and making it more accessible. Since our code base is in Java, I wonder if using something like GWT would help to reduce the effort. Still it would be a huge undertaking.fesja wrote:Make it a website
Thanks for sharing your ideas. We are always on the lookout for more developers on the project. If you would like to help develop the project, you are most welcome to post any code contributions/patches to our developer discussion group at magarena@googlegroups.comfesja wrote:Just some ideas I've thought
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Great job there! how about magarena in a web?
by fesja » 19 Feb 2012, 15:18
The problem comes with 5% of the cards which have unique effects. But I believe it's the way to go if you want to have a maintainable code.melvin wrote:However, designing a card effect language up front is difficult. So our process is as follows: 1) Create the card effect in Java. 2) Refactor the card/game engine to minimize the code. 3) Construct the implementation automatically by looking out for special phrases in the ability text.
I hadn't though about GWT, but you are right. It wouldn't be so hard to do it, as you can load any Java class/library.melvin wrote:Putting the game on the web does make a lot of sense for popularizing the game and making it more accessible. Since our code base is in Java, I wonder if using something like GWT would help to reduce the effort. Still it would be a huge undertaking.
Good luck! It's fun to play Magic again after 8 years

- fesja
- Posts: 2
- Joined: 19 Feb 2012, 01:13
- Has thanked: 0 time
- Been thanked: 0 time
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 15 guests