Page 1 of 1

AI Development Question

PostPosted: 30 May 2011, 03:48
by Agetian
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

Re: AI Development Question

PostPosted: 30 May 2011, 04:16
by friarsol
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.

Re: AI Development Question

PostPosted: 30 May 2011, 10:56
by Agetian
Oh sounds interesting, I'll check it out for sure and will also see if I can expand on it during my experiments. :) Thanks!

Re: AI Development Question

PostPosted: 30 May 2011, 12:28
by Chris H.
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. :D

Re: AI Development Question

PostPosted: 30 May 2011, 13:18
by Agetian
That's interesting, thanks for the heads-up! :)

- Agetian

Re: AI Development Question

PostPosted: 30 May 2011, 14:57
by Rob Cashwalker
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".

Re: AI Development Question

PostPosted: 30 May 2011, 15:52
by Agetian
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".
Awesome, I'll take a look around - thanks for a valuable pointer! :)

- Agetian

Re: AI Development Question

PostPosted: 30 May 2011, 16:35
by Chris H.
Agetian wrote:
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".
Awesome, I'll take a look around - thanks for a valuable pointer! :)

- 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.

Re: AI Development Question

PostPosted: 30 May 2011, 18:50
by Agetian
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.
Oh this would be really helpful! Thanks a lot! :)

- Agetian