It is currently 16 Apr 2024, 23:18
   
Text Size

Card scripting

Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins

Card scripting

Postby ubeefx » 24 Jul 2011, 14:49

There are a couple of reasons why I did not script cards in Magarena :
  • 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
There is actually basic scripting in Magarena, the cards.txt file, but it is very limited.
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.
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Card scripting

Postby 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

Postby 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 ???
User avatar
madmarcel
 
Posts: 18
Joined: 17 Jul 2011, 03:18
Location: New Zealand
Has thanked: 0 time
Been thanked: 0 time

Re: Card scripting

Postby 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.
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Card scripting

Postby 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. =P~
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: Card scripting

Postby ubeefx » 25 Jul 2011, 18:21

Unfortunately not. :(
Examples of removed cards are Curse of Chains and Steel of the Godhead.
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Card scripting

Postby 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!
User avatar
Huggybaby
Administrator
 
Posts: 3205
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 696 times
Been thanked: 594 times

Re: Card scripting

Postby ubeefx » 25 Jul 2011, 18:30

I think you have a point here Huggybaby. :)
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Card scripting

Postby 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.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times

Re: Card scripting

Postby 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?
User avatar
Huggybaby
Administrator
 
Posts: 3205
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 696 times
Been thanked: 594 times

Re: Card scripting

Postby 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 :D

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.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times


Return to Magarena

Who is online

Users browsing this forum: No registered users and 28 guests


Who is online

In total there are 28 users online :: 0 registered, 0 hidden and 28 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 28 guests

Login Form