Wednesday, January 5, 2011

Min-Max Combat - A Failure

My goal was to build the new combat code completely separate from the rest of project.  Unfortunately this was not possible because of Forge’s architecture.  The more that I tried to update the combat code, the more messy things became.  Forge does not allow you to easily update one part of the AI without updating the whole thing.  In my mind Forge has grown from a collection of objects to sub-systems, which is the difference between a 3 story house and a skyscraper. 

Giant Growth’s AI code checks to see if a creature is attacking and then targets that creature.  There is no “wait time” for the computer and the new code definitely will need a few seconds in order to generate future combat situations.  I thought that I knew what I was getting into but I didn't.

Programmer note: The reason that it is good to create and use interfaces (or abstract classes) is because you have the opportunity to update them later.  Of course you can be too abstract and become lightheaded but in general, some interfaces are better than no interfaces.


Stassa said...

Hi. Sorry to bother you on the blog about the forum, but I've been trying to register to use the forum (on and I don't seem to get the registration e-mail, even though I made sure I entered my correct address. I tried sending mail to the admin address but still no luck, so since you're an administrator on the forum, I thought I might contact you directly.

I'm the owner of a blog about another Magic-playing program. I'm about to release an update including some code and I wanted some feedback and so on. Btw, my plan is to use minimax for my program's AI. This is still a bit in the future, I still have some way to go. In any case, at this point I sorely need some feedback from other Magic programmers, so if you could get back at me about the registration issue I'd owe you one.

My email is idinatas (at) yahoo (dot) com, my name is Stassa. Glad to meet you :)

Forge said...

Hi, I did look at your blog and yes getting Magic's turn sequence programmed can be challenging. It seems like such a trivial thing but it isn't.

(When you have to code it from scratch, nothing is too trivial or easy. Programming is just hard.)

My guess is that the registration email goes to your spam folder. I also use yahoo mail and sometimes that happens.

stassa said...

Hiya! Thanks for replying! :)

Yes, I think it was my yahoo mail account, because I tried again from my own domain's mail account and this time I got the registration email right away.

I started a thread already. Yes, programming the turn sequence was harder than I thought, mostly because I was trying to get it just so.

Happy Cat said...

Looks like it would be redone someday from the scratch, in one giant leap. :) At least, that's what I hope for and that's how new version are born sometimes.
After all, forge offers only single player versus AI, right?