Parser: addition

All additions requested or suggested to improve the card coding language.
digix
Posts: 38
Joined: Fri Jul 09, 2010 7:25 am

Parser: addition

Post by digix »

When coding cards I keep running into the activated ability being confusing as to what is actually supposed to happen. For example, when I coded Early Harvest, the card gives two abilities to choose from, but I have to remember from how I coded the card which is which. Likewise, when I modified the lands to put the Mana Flare effect onto the land itself, the land went from "Add {R}" to saying "ability". What would be good is to have the ability to be able to have a text line in the auto line that would show up so that the player would know exactly what the ability was doing or targeting sorta like a HTML address code does.
moxen
Posts: 254
Joined: Fri May 21, 2010 7:00 am

Re: Parser: addition

Post by moxen »

digix wrote:When coding cards I keep running into the activated ability being confusing as to what is actually supposed to happen. For example, when I coded Early Harvest, the card gives two abilities to choose from, but I have to remember from how I coded the card which is which. Likewise, when I modified the lands to put the Mana Flare effect onto the land itself, the land went from "Add {R}" to saying "ability". What would be good is to have the ability to be able to have a text line in the auto line that would show up so that the player would know exactly what the ability was doing or targeting sorta like a HTML address code does.
You can actually make both the options create tokens. Then name the tokens appropriately so that the choice will make sense.
Only those crazy enough to think they can change the world are the ones who do.

Wishlist: Sneak Attack, Through the Breach, Aluren, Serra Avatar, Goblin Piledriver
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: Parser: addition

Post by Zethfox »

take a look through my addon and see how i code choice cards...particularly "turnabout" which has about 20 choices all of which you know exactly what its going to do...i cant STAND ability ability ability....on a card...also look at lotus blossom and the color blanks i use.
digix
Posts: 38
Joined: Fri Jul 09, 2010 7:25 am

Re: Parser: addition

Post by digix »

Using blasted tokens shouldn't be necessary for this.
wololo
Site Admin
Posts: 3727
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: Parser: addition

Post by wololo »

There is redundancy between what the ability does and what its text should display. This is why it is not "necessary" to have an ability text as an auto line. We just need to update the code to better show the text for each ability. If you tell me which card is causing an issue I'll have a look.
digix
Posts: 38
Joined: Fri Jul 09, 2010 7:25 am

Re: Parser: addition

Post by digix »

wololo wrote:There is redundancy between what the ability does and what its text should display. This is why it is not "necessary" to have an ability text as an auto line. We just need to update the code to better show the text for each ability. If you tell me which card is causing an issue I'll have a look.
A line like "auto={T}:add {G} && foreach(Mana Flare) add {G} && etc" will not generate anything that tells the player anything ("ability" is rather vague and tells the player absolutely nothing), and I disagree in that it is actually necessary. Sometimes it's easier to simply tell the parser what to put instead of having the parser try and figure it out.

Another example: Sakura-Tribe Elder doesn't say "Sacrifice to search for a land" or anything involving land, it simply says "Move".

Early Harvest only says "Ability" when coded "auto=may all(land[basic]|mybattlefield) untap" and "auto=may all(land[basic]|opponentbattlefield) untap"

It would be much simpler to simply tell the game what to display in the card code than let the game figure out what to put.

This is just a suggestion, feel free to ignore it if you aren't going to do anything with it.
wololo
Site Admin
Posts: 3727
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: Parser: addition

Post by wololo »

We just need to refine the way this works. the ability text mechanism was added when Wagic had only 250 cards, and the only creatures with an ability were llanowar elves.
I agree that "move" is not enough.
But adding an extra line to specify the ability involves lots of extra stuff:
- extra space in the database (that's VERY expensive on a console that has 24MB of Ram)
- additional translations
- additional code in the parser to handle the text

I'd rather have a simple generic system with some imperfections, than ask card coders to enter a name for each ability.

That being said, a "default" value could be computed by the engine, and this value could be overridden by something added by the card creator... I'll think about it, but I'd rather have a coder spend some time improving the current automated system rather than spend the same amount of time coding something that will make the DB even heavier than it is right now...

Additionally, a major problem that is very recent is that people are pushing the parser to its limits to create more and more cards. The engine wasn't supposed to support so many cards. And, don't get me wrong, I think it's great that people figure out new stuff that I didn't even think was possible. But that's not the way I was planning to go, so we need time to adapt Wagic.

The idea behind my parser was initially to be able to code stuff simply. People have changed that rule, by adding cards that rely on clever tricks to work. When I read some of the cards in Wagic I don't even understand what they do, which kind of scares me. If possible, I'd rather convert some complex cards into a few keywords. Yes this needs hardcoding a few rules, but if it makes card coding simpler, I think everyone will be happy. Then again, I don't have as much free time as I used to :cry:
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: Parser: addition

Post by Zethfox »

seriously my method works fine....the time would be WAY better spent coding in the missing abilities or improving the card making tools...there is a 100% working solution that doesnt hurt the performence of wagic at all....

ive looked into the source...i can get an idea of the amount of work upgrading the parser to include a line read back would be...and i think if that were to be done maybe we should all cast a vote..

cause that would be about as much work as adding affinity or mana redux as a whole.....im the first one to say...DONT DO IT....dont like assigning tokens to read what it does then well like my mother use to tell me...beggers cant be choosers....

edit: i didnt mean for it to sound so harsh, but you have to consider lately theres been an absence of C++ coders that are adding abilities or new perser tools...and wololo has been so busy that he barely seems to have the time to answer questions on the forum. if he was to sit down to code anything, his C++ coding ability would be much better used on coding in things like a reveal mechanic or mana cost redux...not making it so it reads you back a line for abilities..when that can already be done with the use of tokens, with NO probelm at all...i can write a whole choose your own adventure story using that method...i HIGHLY beleve that that part is not worth it to spend the effort upgrading...and im pretty sure im not the only person that feels this way.

furthermore, wagic is open source, you could download the svn and try figuring it out like ive been doing, ive been able to add a few thing to wagic already, such as an opponents hand gui, access to the exile zones and even a new trash zone....it wasnt easy since i had 0 experence in C++ but i was able to do it...i even added lifetotals as a static varible...and have a workaround using it to determine the difference between you life and your opponents...i added stack triggered effects also...so you can code "copy" so it doesnt lock you into a eternal loop if you choose a card that also has the copy command....
if its something that is bothering you about wagic, you could try coding in the read back yourself and provide a patch submission.

getMenuText(){ <---if you do a search for this in VC++ then it will show you everything that displays a small box on the screen with a word choice...those are what you need to edit.

}

const char * getMenuText(){
return "Move";
}

thats what it looks like...inside the quotes is what gets displayed...get to work...
digix
Posts: 38
Joined: Fri Jul 09, 2010 7:25 am

Re: Parser: addition

Post by digix »

I could post something equally harsh, but that would be unnecessary as I'm not demanding anything be done, simply pointing out something that eventually would make the program better and why. I will refrain from posting any other suggestions as there simply isn't the time and they obviously aren't worth the time to read.
wololo
Site Admin
Posts: 3727
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: Parser: addition

Post by wololo »

Sorry, that wasn't the goal here.
Please understand that Wagic has around 100'000 lines of code, which was fine when there was 4 coders on it, but right now there's only me. I'm reading at all the suggestions, but clearly I can't code all of them. I agree with you that using weird techniques just to overcome the bugs is not a good solution.
Locked