It is currently 13 Dec 2018, 01:20
   
Text Size

Verse - Approach to rules through Parsing Expression Grammar

General Discussion of the Intricacies

Moderator: CCGHQ Admins

Re: Approaching rules through NLP and grammars

Postby telengard » 11 Oct 2010, 00:10

silly freak wrote:
telengard wrote:You need hooks or a way to inject new rules (and effects etc) behavior somehow. I implemented the Venom abilities in such a way that it just dealt it out and all state about Venom was kept in a generic container that the engine provides. It also added a check for destruction at the appropriate time (via subscription). I could probably extend upon this to allow new rules behavior, but haven't had a need to for my game. Over time, all of my abilities have gone from very specific to very generic allowing for many permutations without having to change any c++ code.

~telengard
Venom's ability has three big parts: It triggers on being blocked, creates a delayed triggered ability, and destroys a creature. At least the first and the last are so general that a good rules engine should support them.
Having all three, you probably still need some code to tie it together, but not in the engine. Delayed triggered abilities are something to be implemented in the engine, not the actual Venom ability.

And that is what I was talking about: If you didn't have delayed triggered abilities, you can't implement Venom, but that's not a shortcoming of the engine's architecture but of is completeness. If you have a complete rules engine implementation, you should be able to implement any mechanic. With code, still, but without the need to recompile the core.
Venom for my game (an ability in Dreamblade) is different than MtG, probably should have mentioned that. Just counters and a check for destruction at the end of every phase. Completely different. My point was just that it was a mechanic added after the initial release of the game, and I had to change the engine to support it but I did it in a mostly generic way that I could probably leverage for similar type abilities.

Would something like a Planeswalker have been possible pre-Planeswalker with the core rules up to that point?
I'm not sure exactly what a Planeswalker does.

I would think that adding a new mechanic could potentially create new rules, unless it is just a remash of existing rules. The more generic/flexible your engine, the better chance you have of accommodating new rules/mechanics without recompiling. Something like Incantus that is in python makes for a much more flexible framework for this sort of thing since it is dynamic (at the expense of performance).

~telengard
Author of Dreamblade:
viewtopic.php?f=51&t=1215
User avatar
telengard
DEVELOPER
 
Posts: 371
Joined: 23 May 2009, 23:04
Has thanked: 0 time
Been thanked: 23 times

Re: Approaching rules through NLP and grammars

Postby silly freak » 11 Oct 2010, 07:24

telengard wrote:Would something like a Planeswalker have been possible pre-Planeswalker with the core rules up to that point?
I'm not sure exactly what a Planeswalker does.
Here we have the same conclusion. I don't think planeswalker would be possible without changes to the engine, and a hack would hurt the engine in total. Creating planeswalkers in the engine is healthy, creating individual planeswalkers there is not.

telengard wrote:I would think that adding a new mechanic could potentially create new rules, unless it is just a remash of existing rules. The more generic/flexible your engine, the better chance you have of accommodating new rules/mechanics without recompiling. Something like Incantus that is in python makes for a much more flexible framework for this sort of thing since it is dynamic (at the expense of performance).

~telengard
Same here; however, my personal opinion on dynamic languages is that you can easily maneuver you into a maintenance hell. Dynamic languages are no excuse for bad software design; it should support the good sort.
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Approaching rules through NLP and grammars

Postby MageKing17 » 14 Oct 2010, 20:42

silly freak wrote:my personal opinion on dynamic languages is that you can easily maneuver you into a maintenance hell.
Don't I know it. ;)

silly freak wrote:Dynamic languages are no excuse for bad software design; it should support the good sort.
This can never be emphasized enough.
User avatar
MageKing17
Programmer
 
Posts: 473
Joined: 12 Jun 2008, 20:40
Has thanked: 5 times
Been thanked: 9 times

Re: Approaching rules through NLP and grammars

Postby Incantus » 15 Oct 2010, 02:50

MageKing17 wrote:
silly freak wrote:my personal opinion on dynamic languages is that you can easily maneuver you into a maintenance hell.
Don't I know it. ;)
Hey, what are you saying... ;)

Anyway, what you guys are describing is exactly what I tried to do with Incantus. Basically support the core rules in the most general way so that it is possible to implement current cards and also modify the rules implementation in the future when WotC comes up with new modifications. Working in python has definitely made this a lot easier.
Incantus
DEVELOPER
 
Posts: 267
Joined: 29 May 2008, 15:53
Has thanked: 0 time
Been thanked: 3 times

Re: Approaching rules through NLP and grammars

Postby MageKing17 » 15 Oct 2010, 04:00

Incantus wrote:
MageKing17 wrote:
silly freak wrote:my personal opinion on dynamic languages is that you can easily maneuver you into a maintenance hell.
Don't I know it. ;)
Hey, what are you saying... ;)

Anyway, what you guys are describing is exactly what I tried to do with Incantus. Basically support the core rules in the most general way so that it is possible to implement current cards and also modify the rules implementation in the future when WotC comes up with new modifications. Working in python has definitely made this a lot easier.
Especially with regard to custom cards, which is pretty awesome if I do say so myself.

Maybe I should make some free time for myself despite my schoolwork and just go on a coding spree in Incantus; try to add all the keywords, perhaps.
User avatar
MageKing17
Programmer
 
Posts: 473
Joined: 12 Jun 2008, 20:40
Has thanked: 5 times
Been thanked: 9 times

Re: Verse - Approach to rules through Parsing Expression Gra

Postby proud » 19 May 2013, 02:00

Alright, as I posted in the other forum page, cards have been put into JSON data, except no rules parsing exists yet.

Sets and rarity have been split, per request.
aka ancestral, mproud
mtg.design
proud
 
Posts: 47
Joined: 21 Apr 2010, 10:50
Has thanked: 6 times
Been thanked: 15 times

Previous

Return to Magic Rules Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 1 guest

Login Form