It is currently 20 Sep 2019, 06:21
   
Text Size

Towards no RulesEngine-Deadbox Cards

Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!

Moderators: BAgate, drool66, stassy, Aswan jaguar, gmzombie, CCGHQ Admins

Re: [engine limitation]Sorin Markov

Postby gmzombie » 28 Mar 2014, 16:47

So a side question Korath then do u think there will ever be a time that we won't need the rules engine card? I know it does a lot but is this something that you guys by your recoding of all of these cards and Api's would be able to someday not need?
can I maze of ith your snowstorm?

http://home.comcast.net/~gmzombie/index.html old stuff in here. don't use this stuff right now till I get time to get back into it and readjust.
gmzombie
 
Posts: 855
Joined: 26 Feb 2009, 01:05
Location: Wyoming, Mi
Has thanked: 199 times
Been thanked: 50 times

Re: [engine limitation]Sorin Markov

Postby BAgate » 28 Mar 2014, 18:53

That would probably need a major interface change. If there was no Rules Engine, how would you use flashback or dredge?
Working on: housekeeping and archived reports
User avatar
BAgate
Tester
 
Posts: 2445
Joined: 06 Mar 2012, 11:09
Has thanked: 117 times
Been thanked: 158 times

Re: [engine limitation]Sorin Markov

Postby gmzombie » 28 Mar 2014, 22:05

that is why i asked. i dont really understand how the game uses the card to do the flashback and dredge and whatnot. But this is why im not a coder im just the useful tester.
can I maze of ith your snowstorm?

http://home.comcast.net/~gmzombie/index.html old stuff in here. don't use this stuff right now till I get time to get back into it and readjust.
gmzombie
 
Posts: 855
Joined: 26 Feb 2009, 01:05
Location: Wyoming, Mi
Has thanked: 199 times
Been thanked: 50 times

Re: [engine limitation]Sorin Markov

Postby BAgate » 29 Mar 2014, 04:17

Think of it this way. I cast a Dream Twist (that has flashback). Two turns later I want to use that flashback, so what do I do? There is no card in my hand or the bf to click and Manalink doesn't allow clicking on specific cards in the gy, so what do you do? The Rules Engine is always in play so is always available to be clicked on. While it could theoretically be possible to handle things like cycling w/o the Rules Engine, the interface alone kind of necessitates it for some cards.
Working on: housekeeping and archived reports
User avatar
BAgate
Tester
 
Posts: 2445
Joined: 06 Mar 2012, 11:09
Has thanked: 117 times
Been thanked: 158 times

Re: [engine limitation]Sorin Markov

Postby Korath » 29 Mar 2014, 06:08

(Off topic. Can someone split this, probably into Development?)

Over half of the cards that currently need a Rules Engine - everything that has 1 in their cc[2] column in ct_all.csv - won't generate a Rules Engine as of next patch; all they did was make it possible for us to cast spells without charging their mana cost, and I've moved the function that does that into C so we can just suppress it directly.

As for eliminating the Rules Engine completely, well, it could be done. Data stored on it can just be stored directly in memory - it needs to be backed up and restored by the AI (the functions to do so are already in C, so easy), and saved and loaded (which I happen to be working on currently, though not specifically for Rules Engine data). Things we use the rules engine to trigger for, we can create temporary effect cards, like how madness or death triggers work. For flashback and other in-graveyard activation, click on graveyard to fan it out, then click on a card in the graveyard to activate it. For cycling and other in-hand activation, click on the card.

But we'd have to understand how the AI picks things to cast or activate a whole lot better than we currently do in order to give it more options like that - it can activate the Rules Engine because it sees it as just another activateable card on the battlefield. (Or at least, it would if we didn't force it not to. There's an experimental config option in the next patch that lets it do so, though I think it'll still only ever pick the first option.) Plus, all of the UI uses direct win32api calls, which are absolutely miserable to work with even if you have source code.

I don't think it's worth the development time right now. I know I for one just want to get duel stable enough that I can work on getting Shandalar working, without knowing that there'd be at least one totally unusably buggy card in every deck I put together.
User avatar
Korath
DEVELOPER
 
Posts: 3412
Joined: 02 Jun 2013, 05:57
Has thanked: 482 times
Been thanked: 950 times

Re: [engine limitation]Sorin Markov

Postby Aswan jaguar » 29 Mar 2014, 06:54

In the version you gave me with the experimental config.txt option I tested AI using flashback and unearth and AI didn't have problems using them at least in casual play.(non combo decks)
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester
 
Posts: 6526
Joined: 13 May 2010, 12:17
Has thanked: 541 times
Been thanked: 279 times

Towards no RulesEngine-Deadbox Cards

Postby Aswan jaguar » 29 Mar 2014, 07:01

Postby Korath » 28 Mar 2014, 13:53
Probably easier than Deflection. A lot of it we can do already, or do pretty easily:

override who_chooses in select_target_impl().
override who_chooses in do_dialog().
override who_chooses in show_deck() and its front ends.
show opponent's hand.
choose attackers and blockers.

Selecting spells to play and permanents to activate, both spontaneously and during charge_mana(), is more difficult, but not insurmountable.

The biggest stumbling block is all the places in C where a choice is forbidden to the AI - it doesn't just forbid them to the AI, it forbids them to player #1, even if that's a human in a multiplayer game, or a human's controlling the choice. (Probably the largest reason why multiplayer is broken; one of the cards doing this is the Rules Engine.) I've been replacing these by an IS_AI() macro as I've noticed them, but there's still hundreds of instances to go.
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester
 
Posts: 6526
Joined: 13 May 2010, 12:17
Has thanked: 541 times
Been thanked: 279 times

Re: Towards no RulesEngine-Deadbox Cards

Postby gmzombie » 29 Mar 2014, 18:35

well this is awesome news to hear at least we are stepping in the right direction. I for one totally agree with a stable duel as i would love to see some shandalar action someday. i kinda think there is still some shandalar code inside of magic.exe due to the nature of how the original game progressed. back when the game first came out there was just one magic.exe and a duel.exe and deck.exe. shandalar wasent an additional exe if i recall.
can I maze of ith your snowstorm?

http://home.comcast.net/~gmzombie/index.html old stuff in here. don't use this stuff right now till I get time to get back into it and readjust.
gmzombie
 
Posts: 855
Joined: 26 Feb 2009, 01:05
Location: Wyoming, Mi
Has thanked: 199 times
Been thanked: 50 times

Re: Towards no RulesEngine-Deadbox Cards

Postby gmzombie » 19 Apr 2014, 16:12

hah when i originally read this i believed i understood but now i totally do. what would need to be recoded and redesigned would be the interactions with the graveyard. i dont know why it took me so long to get this but now i do. so then is the rules engine only for dredge, scavenge, flashback, unearth and anything that is graveyard related correct?
can I maze of ith your snowstorm?

http://home.comcast.net/~gmzombie/index.html old stuff in here. don't use this stuff right now till I get time to get back into it and readjust.
gmzombie
 
Posts: 855
Joined: 26 Feb 2009, 01:05
Location: Wyoming, Mi
Has thanked: 199 times
Been thanked: 50 times

Re: Towards no RulesEngine-Deadbox Cards

Postby Korath » 20 Apr 2014, 00:05

Pretty much anything that needs to let a card trigger or activate while it's not already in play. So also madness, miracle, leylines, cycling, and forecast, for example.

We also use it to store global data that needs to be backed up and restored while the AI speculates, and put in savegames and such. The most obvious examples are the various conditions for Trap cards in Zendikar block. Those'll probably be the next to go.
User avatar
Korath
DEVELOPER
 
Posts: 3412
Joined: 02 Jun 2013, 05:57
Has thanked: 482 times
Been thanked: 950 times


Return to Development

Who is online

Users browsing this forum: No registered users and 2 guests


Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 10 minutes)
Most users ever online was 287 on 31 Mar 2019, 04:11

Users browsing this forum: No registered users and 2 guests

Login Form