I'm working on a new AI, but I need help with something

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
Invisible Philosopher
Posts: 873
Joined: July 4th, 2004, 9:14 pm
Location: My imagination
Contact:

I'm working on a new AI, but I need help with something

Post by Invisible Philosopher »

How can I basically say:
"Suppose I make this move. Then where can the enemies go?"
so that I can see whether making the move would break my zone of control, for example.
Play a Silver Mage in the Wesvoid campaign.
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Re: I'm working on a new AI, but I need help with something

Post by Dave »

Invisible Philosopher wrote:How can I basically say:
"Suppose I make this move. Then where can the enemies go?"
so that I can see whether making the move would break my zone of control, for example.
Make a copy of the units map, modify it as appropriate, and then call the pathfinder, passing in the copy of the units map.

To do this kind of thing alot though, you'll have to come up with something more efficient.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Is the AI trying to protect a specific unit or maximize ZOC chains?
edit: or minimize exposure?
Hope springs eternal.
Wesnoth acronym guide.
Invisible Philosopher
Posts: 873
Joined: July 4th, 2004, 9:14 pm
Location: My imagination
Contact:

Post by Invisible Philosopher »

scott wrote:Is the AI trying to protect a specific unit or maximize ZOC chains?
edit: or minimize exposure?
I haven't quite decided what it'll do there. The idea is a goal-based AI; I have no idea how good it'll be until I try playing it, but it's nowhere near a usable state yet. It will have different values for protecting different units. I'm trying to make it extensible by WML (assign almost any sort of goal, and actually tell it about opportunities like freeing the mermen instead of saying "Go there, believe me, it's good for you", so that it can make more intelligent decisions on that sort of thing), and of course I'll try to give it a decent chance at tactical issues, though of course it won't be nearly as refined as the current AI at first. Assuming I actually finish it. I'm taking advice from the book AI Game Programming Wisdom, especially Chapter 7.5, "A Flexible Goal-Based Planning Architecture". Unfortunately it mostly assumes that each agent has a separate mind, which isn't quite applicable to a good Wesnoth AI. I'm mostly creating it as I go, using my intuition to decide what would make it smarter, and not too slow - while it might be good to check every possible combination of moves the AI can make for how good it is, it would take *way* too long. Of course for most things I don't know how long they'd take, and it's best to save optimizations for later, and I don't even have any kind of sense how long pathfinding takes with the new A* implementation.
Play a Silver Mage in the Wesvoid campaign.
Kjara
Posts: 3
Joined: January 30th, 2005, 4:24 am

Post by Kjara »

Are you attempting to make the AI have any sort of look ahead, or just worried about that turn, and the opponents following turn at this point?
Invisible Philosopher
Posts: 873
Joined: July 4th, 2004, 9:14 pm
Location: My imagination
Contact:

Post by Invisible Philosopher »

Kjara wrote:Are you attempting to make the AI have any sort of look ahead, or just worried about that turn, and the opponents following turn at this point?
Specific lookahead of some sorts is way too slow. I think when it isn't in range of enemies it'll just take a general estimate of their power and position. Which is similar to what I do when I play -- I'm modelling the AI after myself. :)
Play a Silver Mage in the Wesvoid campaign.
MCP
Posts: 518
Joined: May 23rd, 2005, 5:23 pm
Location: California

Post by MCP »

You still working on this?

I was starting work on an AI of my own, but it would be better if we worked together, just in general.
Post Reply