AI Development Question
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
9 posts
• Page 1 of 1
AI Development Question
by Agetian » 30 May 2011, 03:48
Hello guys,
I have studied the attacking and blocking code in Forge for a while and I'd like to experiment with it a little in an attempt to make some improvements. However, I have one question: is there any Developer mode if Forge that would allow me to set up precise battlefield situations? (for instance, can I set up the battlefield in a such a way that the AI has specific cards and I have specific cards, and maybe also set the life of players to specific values, etc.?) If such a mode does not exist, is there perhaps some alternative way you usually use to test specific circumstances and condition outcomes for the AI? Thank you in advance for your help.
- Agetian
I have studied the attacking and blocking code in Forge for a while and I'd like to experiment with it a little in an attempt to make some improvements. However, I have one question: is there any Developer mode if Forge that would allow me to set up precise battlefield situations? (for instance, can I set up the battlefield in a such a way that the AI has specific cards and I have specific cards, and maybe also set the life of players to specific values, etc.?) If such a mode does not exist, is there perhaps some alternative way you usually use to test specific circumstances and condition outcomes for the AI? Thank you in advance for your help.
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: AI Development Question
by friarsol » 30 May 2011, 04:16
The dev mode at this time is something I refactored from an older piece of code that was basically a "should a player lose if their deck runs out". At this time it doesn't have the ability to set Players Life Totals, or Create Tokens. In general, when I went to test a condition, I just give myself the cards I need and generate the mana necessary (through DevMode), and give the AI a deck with a bunch of Moxen, plus the cards I want to test.
With the current tools available if you want to test specific life totals, I'd recommend adding Fanning the Flames so you can cast it repeatedly on both yourself and the AI. But feel free to expand the DevMode as that's why its there to add testing tools that might be useful. Writing set life totals should be fairly straight-forward. Writing a "add card to Human's Battlefield" or "add card to "AIs Battlefield" would be a bit trickier, but not out of the question.
With the current tools available if you want to test specific life totals, I'd recommend adding Fanning the Flames so you can cast it repeatedly on both yourself and the AI. But feel free to expand the DevMode as that's why its there to add testing tools that might be useful. Writing set life totals should be fairly straight-forward. Writing a "add card to Human's Battlefield" or "add card to "AIs Battlefield" would be a bit trickier, but not out of the question.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: AI Development Question
by Agetian » 30 May 2011, 10:56
Oh sounds interesting, I'll check it out for sure and will also see if I can expand on it during my experiments.
Thanks!
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: AI Development Question
by Chris H. » 30 May 2011, 12:28
Fnoed recently added some suppoert to the .dck file for metadata. At some point this could be expanded to including a list of cards that should be placed onto the battlefield as the game starts.
This would allow us to move some info out of the class files and into the .dck files for the special quest opponents that people can face at the later stages of a quest. Such a feature could also help to set up combat type tests.
This metadata is a work in progress currently.
This would allow us to move some info out of the class files and into the .dck files for the special quest opponents that people can face at the later stages of a quest. Such a feature could also help to set up combat type tests.
This metadata is a work in progress currently.
-

Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: AI Development Question
by Agetian » 30 May 2011, 13:18
That's interesting, thanks for the heads-up! 
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: AI Development Question
by Rob Cashwalker » 30 May 2011, 14:57
Wasn't there some functionality Dennis was using that would setup the board with a particular set of cards?
If not, then you'll want to look at GameAction.NewGame. That's where the decks get loaded and the mana pool "card" is put into "play".
If not, then you'll want to look at GameAction.NewGame. That's where the decks get loaded and the mana pool "card" is put into "play".
The Force will be with you, Always.
-

Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: AI Development Question
by Agetian » 30 May 2011, 15:52
Awesome, I'll take a look around - thanks for a valuable pointer!Rob Cashwalker wrote:Wasn't there some functionality Dennis was using that would setup the board with a particular set of cards?
If not, then you'll want to look at GameAction.NewGame. That's where the decks get loaded and the mana pool "card" is put into "play".
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: AI Development Question
by Chris H. » 30 May 2011, 16:35
`Agetian wrote:Awesome, I'll take a look around - thanks for a valuable pointer!Rob Cashwalker wrote:Wasn't there some functionality Dennis was using that would setup the board with a particular set of cards?
If not, then you'll want to look at GameAction.NewGame. That's where the decks get loaded and the mana pool "card" is put into "play".
- Agetian
Check out the src.forge.quest.data.QuestUtil class. There is a setupQuest() method which is used to place cards and tokens onto the battlefield at the start of a game.
-

Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: AI Development Question
by Agetian » 30 May 2011, 18:50
Oh this would be really helpful! Thanks a lot!Chris H. wrote:Check out the src.forge.quest.data.QuestUtil class. There is a setupQuest() method which is used to place cards and tokens onto the battlefield at the start of a game.
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 59 guests