Card scripting
by ubeefx
Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins
Card scripting
by ubeefx » 24 Jul 2011, 14:49
There are a couple of reasons why I did not script cards in Magarena :
If the intention is to let Magarena have many more cards, then I am in favor of migrating to scripts.
Best way is to do this gradually, like Forge was migrated from hard coded to scripted cards.
Most succesful projects with many cards and even the official DOTP use some kind of scripting.
Due to the lesser complexity and the need to save card definitions, I also switched to basic scripting in Dreamwalkers.
- the cube was limited to around 500 cards, so the need did not arise
- I wanted maximum flexibility, so Java code, to have a good AI
- Java code is easier to refactor during development
If the intention is to let Magarena have many more cards, then I am in favor of migrating to scripts.
Best way is to do this gradually, like Forge was migrated from hard coded to scripted cards.
Most succesful projects with many cards and even the official DOTP use some kind of scripting.
Due to the lesser complexity and the need to save card definitions, I also switched to basic scripting in Dreamwalkers.
Re: Card scripting
by jeffwadsworth » 25 Jul 2011, 00:45
Interesting. I think the main reason Magarena didn't attract more devs was due to the "limited" scope of the allowable card base. Something like Mage is wide open in contrast.
- jeffwadsworth
- Super Tester Elite
- Posts: 1171
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 69 times
Re: Card scripting
by madmarcel » 25 Jul 2011, 04:07
Could be the "limited scope of the card base"...
Could also be the (perceived) complexity of the code...
Could be that people don't like the interface...who knows.
IIRC the emphasis was/is on getting the AI right, and that is easier to test with a small set of cards.
I'm willing to put up with a small subset of cards if the gameplay (AI) and GUI is superior, and having tried most of the other software...well, I won't say too much.
My current copy of MagArena is at 1200+ cards at the moment BTW...working on adding more. Added all the 'vanilla' and simple keyword creatures for a start. That adds a bit of diversity to the pauper format...but then again...when was the last time you saw Headless Horseman or Gerrard's Irregulars ???
Could also be the (perceived) complexity of the code...
Could be that people don't like the interface...who knows.
IIRC the emphasis was/is on getting the AI right, and that is easier to test with a small set of cards.
I'm willing to put up with a small subset of cards if the gameplay (AI) and GUI is superior, and having tried most of the other software...well, I won't say too much.
My current copy of MagArena is at 1200+ cards at the moment BTW...working on adding more. Added all the 'vanilla' and simple keyword creatures for a start. That adds a bit of diversity to the pauper format...but then again...when was the last time you saw Headless Horseman or Gerrard's Irregulars ???
-
madmarcel - Posts: 18
- Joined: 17 Jul 2011, 03:18
- Location: New Zealand
- Has thanked: 0 time
- Been thanked: 0 time
Re: Card scripting
by ubeefx » 25 Jul 2011, 10:34
This topic is just a thought, I am not planning to do this work myself.
I made Magarena open source mainly to avoid legal issues and because I wanted to contribute at least once to an open source project.
And then the ideal is of course to have your very own project.
The commercial ambitions I had with this game were not successful, but I learned a lot.
I still prefer playing Magarena to anything else Magic related on this forum.
But I am very interested in other projects to see what they do from a technical perspective.
The code in Magarena is far more flexible and structured than people might think.
Given enough effort there are no issues with having many more cards, even from an AI point of view.
What people might not realize is that I actually spent many hours composing the ubeefx cube, this is not a random collection of cards.
I personally have little need for a game with more than 600 cards, that is why I even removed cards at times.
I made Magarena open source mainly to avoid legal issues and because I wanted to contribute at least once to an open source project.
And then the ideal is of course to have your very own project.
The commercial ambitions I had with this game were not successful, but I learned a lot.
I still prefer playing Magarena to anything else Magic related on this forum.
But I am very interested in other projects to see what they do from a technical perspective.
The code in Magarena is far more flexible and structured than people might think.
Given enough effort there are no issues with having many more cards, even from an AI point of view.
What people might not realize is that I actually spent many hours composing the ubeefx cube, this is not a random collection of cards.
I personally have little need for a game with more than 600 cards, that is why I even removed cards at times.
Re: Card scripting
by Aswan jaguar » 25 Jul 2011, 10:50
If you still have these coded cards that you cut from your cube it would be nice to have them.
---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8078
- Joined: 13 May 2010, 12:17
- Has thanked: 730 times
- Been thanked: 458 times
Re: Card scripting
by Huggybaby » 25 Jul 2011, 18:26
Why didn't Magarena acquire more developers? Well, it's already gone gold, programming has been taken over by Melvin, and new releases keep coming out.
So, why didn't Magarena acquire more developers? Because it didn't need them!
So, why didn't Magarena acquire more developers? Because it didn't need them!
-
Huggybaby - Administrator
- Posts: 3207
- Joined: 15 Jan 2006, 19:44
- Location: Finally out of Atlanta
- Has thanked: 701 times
- Been thanked: 594 times
Re: Card scripting
by melvin » 26 Jul 2011, 01:56
If the cards have been added to the repository before, they can be recovered, but it will take some digging through the change history.
Thanks for the vote of confidence IMHO, having a single point of failure is always a bad idea and I don't know how long I can keep up this pace. For the project to be sustainable in the long run, we really need a community of developers and users.
Open source is also much less fun when you only see your own changes. It feels so much like the projects that I do at work where I am the sole developer.
Thanks for the vote of confidence IMHO, having a single point of failure is always a bad idea and I don't know how long I can keep up this pace. For the project to be sustainable in the long run, we really need a community of developers and users.
Open source is also much less fun when you only see your own changes. It feels so much like the projects that I do at work where I am the sole developer.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Card scripting
by Huggybaby » 26 Jul 2011, 17:58
Loneliness may be the hardest part of developing.
With this project it may not be obvious you're looking for help.
Perhaps advertise that you're looking to add more cards, or some specific feature like a deck builder?
With this project it may not be obvious you're looking for help.
Perhaps advertise that you're looking to add more cards, or some specific feature like a deck builder?
-
Huggybaby - Administrator
- Posts: 3207
- Joined: 15 Jan 2006, 19:44
- Location: Finally out of Atlanta
- Has thanked: 701 times
- Been thanked: 594 times
Re: Card scripting
by melvin » 14 Aug 2011, 03:23
This topic went from a comment on card scripting to why Magarena doesn't have more devs. I'm happy to report that since this topic was started we've managed to bring more devs on board. madmarcel and beholder has kindly agreed to contribute their modifications to the project and we will see some of these in the next release
Going back to the issue raised by ubeefx, I would also like to see the scripting capability in Magarena enhanced so that users can add simple cards by themselves. The other benefit of scripting is a reduction in the complexity of the code base since in the process of scripting we come up with a domain specific language to describe the cards. Java is very flexible but also very verbose and easy to make mistakes, using a card script should make things more concise and reduce errors.
Rather than "designing" this card script from the top down, a slow gradual migration is in progress. This started with the refactoring to move the code necessary to implement a card into its own file. In the process, I was able to simplify some of these codes to just a couple of lines. Moving this to a script is a matter of introducing some keywords and a parser to read in the card script and initialize the card object.
Going back to the issue raised by ubeefx, I would also like to see the scripting capability in Magarena enhanced so that users can add simple cards by themselves. The other benefit of scripting is a reduction in the complexity of the code base since in the process of scripting we come up with a domain specific language to describe the cards. Java is very flexible but also very verbose and easy to make mistakes, using a card script should make things more concise and reduce errors.
Rather than "designing" this card script from the top down, a slow gradual migration is in progress. This started with the refactoring to move the code necessary to implement a card into its own file. In the process, I was able to simplify some of these codes to just a couple of lines. Moving this to a script is a matter of introducing some keywords and a parser to read in the card script and initialize the card object.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
11 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 44 guests