AI Wars.

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Woodwizzle
Posts: 719
Joined: December 9th, 2003, 9:31 pm
Contact:

Post by Woodwizzle »

How about some sort of Wesnoth AI contest with a real grand prize. Say a amazon gift certificate or something.

I think Wesnoth's current AI is respectable. However I wish it knew how to heal, and ambush, and didn't 'see' players that are invisible and it is not supposed to 'see'
Signature dropped due to use of img tag
Gobling
Posts: 77
Joined: April 28th, 2006, 5:44 pm
Location: a place ancient

Post by Gobling »

if possible, let's make the game a bit more like the "programming game".
providing interface for gamer to write AI,and test it at his own machine.
then perhaps engage each other at the official server.

so, you can still play this game like a normal strategy game.
or you can play this game like a programming game.

imagine that, you watching the screen, one side is your AI, the other side is enemy player or enemy's AI.^_^
_______________________________________________________

and ... if it's so bad to give us an AI API, maybe simpler, some macro API, so you can execute your macro just like you have made your own command for some specific units or all the units.

macro perhaps like:

Code: Select all

//control current unit move to the nearest hex to the position of the target unit.
//then attack target with the first attack ability(generally melee blade attack)
this.moveTo(target.position.x-1,target.position.y);
this.attack(target,this.attacks[0]);
code above performs the same as move to the top left hex of the target and choose the first weapon to attack.
all my suggestion is OK and welcome to say NO:)
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Gobling: there is an interface to the AI. The documentation for the Python interface is at http://www.wesnoth.org/wiki/ReferencePythonAPI

The documentation for the C++ interface is at http://www.wesnoth.org/wiki/WritingYourOwnAI

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
ILikeProgramming
Posts: 837
Joined: April 14th, 2005, 4:17 am

Post by ILikeProgramming »

I want to write an AI, but unless I can get my hands on some data about how the functions work (input types, return types...) I can't possibly figure out what each function does.
viorc
Posts: 130
Joined: February 22nd, 2006, 3:03 am

some data about how the functions work

Post by viorc »

If you do not want to analyse every function, you can start by using only the most simple ones. An example use of these can be found at http://www.wesnoth.org/wiki/PythonTestScript.
As the interface is still under construction, you can report problem or ask for answer on the page: http://www.wesnoth.org/wiki/Talk:ReferencePythonAPI (some patience is required).
It is clearly still needing some self-teaching but you may want to do that if you feel like being a trailblazzer.
ILikeProgramming
Posts: 837
Joined: April 14th, 2005, 4:17 am

Re: some data about how the functions work

Post by ILikeProgramming »

viorc wrote:self-teaching
Hopefully this won't be too hard.
Woodwizzle
Posts: 719
Joined: December 9th, 2003, 9:31 pm
Contact:

Re: some data about how the functions work

Post by Woodwizzle »

ILikeProgramming wrote:
viorc wrote:self-teaching
Hopefully this won't be too hard.
Oooh, how about genetic AI. Everytime someone plays a game the AI is tweaked a bit and the results are sent to a central server which creates the next generation of AI. =)
Signature dropped due to use of img tag
User avatar
Cuyo Quiz
Posts: 1777
Joined: May 21st, 2005, 12:02 am
Location: South America

Post by Cuyo Quiz »

You could give some players with reputation a patch to send that information. In the end you could have "play vs. the <insert name here> bred AI". Maybe didive them into specific factions or whatever. [/brainstorm]
Cuyo Quiz,where madness meets me :D
Turn on, tune in, fall out.
"I know that, but every single person nags about how negative turin is; it should be in the FPI thread "Turin should give positive comments" =)"-Neorice,23 Sep 2004
User avatar
irrevenant
Moderator Emeritus
Posts: 3692
Joined: August 15th, 2005, 7:57 am
Location: I'm all around you.

Post by irrevenant »

Probably it would be easier all round just to have it learn from games on the multiplayer server. That way you don't have to decide who's 'reputable' or not.
User avatar
Elvish_Pillager
Posts: 8129
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Re: some data about how the functions work

Post by Elvish_Pillager »

Woodwizzle wrote:
ILikeProgramming wrote: Hopefully this won't be too hard.
Oooh, how about genetic AI. Everytime someone plays a game the AI is tweaked a bit and the results are sent to a central server which creates the next generation of AI. =)
Use natural selection! Create lots of slightly different AIs from the existing set, send them into the fray, and delete them if/when they lose a game.
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
Woodwizzle
Posts: 719
Joined: December 9th, 2003, 9:31 pm
Contact:

Re: some data about how the functions work

Post by Woodwizzle »

Elvish Pillager wrote:
Woodwizzle wrote: Oooh, how about genetic AI. Everytime someone plays a game the AI is tweaked a bit and the results are sent to a central server which creates the next generation of AI. =)
Use natural selection! Create lots of slightly different AIs from the existing set, send them into the fray, and delete them if/when they lose a game.
Thats essentially what genetic algorithms do. They create children based on a parent algorithm that are all slightly different. The children that perform the best become parents for the next generation.
Signature dropped due to use of img tag
ILikeProgramming
Posts: 837
Joined: April 14th, 2005, 4:17 am

Post by ILikeProgramming »

The problem with all of this is that there are more brainstormers than coders. I'll try to get to writing an AI sometime soon.
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Does anyone have a documented example of a genetic AI being produced for anything remotely as close as a Wesnoth AI?
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
Woodwizzle
Posts: 719
Joined: December 9th, 2003, 9:31 pm
Contact:

Post by Woodwizzle »

Dave wrote:Does anyone have a documented example of a genetic AI being produced for anything remotely as close as a Wesnoth AI?
Genetic Algorithims are usually used to solve problems with a near infinite ammount of possible solutions, where the difference between the solutions can be defined by small variations. One of the best known uses of genetic algorithims is by a certain postal service (I think FedEx). They use a genetic algorithim to figure out the best way to cram as many of their packages into an airplane cargo bay. The program runs every day with a new set of packages and runs untill it is time to pack the plane. There are a near infinite ammount of packages in all shapes and sizes that this company gets and it always has to fit as much as it can into a plane ASAP. A Genetic Algorithm has solved this problem for them.

I imagine the problme of Wesnoth's AI could be fit to a genetic algorithm. There area near infinte possible solutions to what the AI should do in a given game and each possiblilty can be just slightly different than the others.

Here is an interesting read about genetic algos in game AI.
Signature dropped due to use of img tag
Ragwortshire
Posts: 36
Joined: May 9th, 2006, 8:31 pm
Location: Dublin, Ireland

Post by Ragwortshire »

As far as I understand, the problem is that you need a set of parameters over which to run the algorithm. You might be able to use it to determine optimum values for aggression and caution with the default AI, but I don't see how you can get something really new out of it.

If you had a more complex AI with several different strategies then you might be able to work out when to use each one - but you'd have to program the strategies yourself first (probably the "hard bit", as it were).
There midnight's all a-glimmer, and noon a purple glow. (The Lake Isle of Inisfree - W.B. Yeats)
Post Reply