My Computer Forum Computer Science Forum

Go Back   My Computer Forum > Computer Science Forum > Artificial Intelligence

Artificial Intelligence Artificial Intelligence, Artificial Life, Automated Reasoning, Computer Vision, Machine Learning, Computational Linguistics, Robotics


Reply
 
LinkBack Thread Tools Display Modes
December 13th, 2007, 02:25 PM   #1
 
Joined: Dec 2007
Posts: 24
AI basics

What I'm trying to understand is the basics of how to convert data to meaningful AI responses. In other words, if I have a bunch of objects on a map interacting with each other, and the human is controlling one side and the computer is controlling the other, then I would need the computer to make decent moves based on sound strategy and based on what the human was doing.

Now, getting data is easy. I can tell the computer how many objects the enemy has, what they are, what they can do, how dangerous they are, how far away they are from his objects, what resources the computer has to acquire more objects or build up objects, what objects the computer has and their properties, what actions have been fought between the enemy objects and the computer's objects, who won them, how many objects the computer has lost versus the enemy, the type of terrain in every pixel of the map, the boundaries of the map, the locations of the enemy home base, the location of the computer's base, etc. From these piles of raw data, I can calculate secondary indicators, such as 'strategy confidence', or something like that, based on the outcomes of the battles, the balance of forces, etc. I could also calculate something like a general strength factor for both sides, based on unit types, locations, and numbers, etc.

In other words, I'm drowning in data without knowing how to make the computer look at the data and understand what to do with its objects in the map. All it can do is move each of its objects in 8 different directions (N,S,E,W,NE,SE,SW,NW), buy more objects (of several different types), split up any object to make two weaker objects, build up its home base to be stronger, or send out objects currently residing at the home base.

I'm not looking for an exact answer here (hence why I am generalizing), I'm just looking for a rough idea of how to transform data into actions.
Infinity is offline  
 

My Computer Forum is free to register and we welcome everyone!

December 13th, 2007, 05:58 PM   #2
 
Joined: Dec 2007
Posts: 138
Re: AI basics

This is just an idea, but...

Couldn't you weight each function (move, split, buy, etc), and have each data point change the weight of each function? The computer then chooses the function with the highest weight.

To use a much simpler (and ridiculous) example, the computer can move any of 5 (identical) pieces in 8 directions. The human has 5 (also identical) pieces. The goal is to capture all of your opponent's pieces (in the same way as Chess.) to make it a little more interesting, you make two moves, but not with the same piece.

So, you have 5*8 possible first moves, followed by 4*8 moves (we're going to neglect the possibility that you run into your own pieces)., which means 72 moves.

An enemy piece 2 spaces away will decrease the weight of moving toward it, by 3, and decrease the weight of moving away from the piece by 1.
And an enemy piece adjacent will increase the weight of attacking by 3, and decrease the weight of moving to another adjacent space by 2.

Something sort of like that should work, yes?
cknapp is offline  
December 13th, 2007, 07:10 PM   #3
 
Joined: Dec 2007
Posts: 24
Re: AI basics

Quote:
Couldn't you weight each function (move, split, buy, etc), and have each data point change the weight of each function? The computer then chooses the function with the highest weight.
Wow, I never thought of that. That would be a great idea. With all of the data, I could compute all the secondary indicators and then use them and the data to weight the various actions, with, as you said, the highest value being picked. I only have a finite number of actions, so basically I have a very complicated finite state machine that just has to pick a state based on a certain logical framework, which you just invented. Thanks!
Infinity is offline  
December 13th, 2007, 07:43 PM   #4
 
Joined: Dec 2007
Posts: 138
Re: AI basics

Quote:
Originally Posted by Infinity
I only have a finite number of actions, so basically I have a very complicated finite state machine that just has to pick a state based on a certain logical framework, which you just invented. Thanks!

I do what I can.
cknapp is offline  
December 13th, 2007, 08:17 PM   #5
 
Joined: Dec 2007
Posts: 232
Re: AI basics

The nice thing with reasonably simple FSMs is that you can run them against each other or human opponents to see how they fare, then breed them genetic algorithm-wise. (This is AI layered on AI, no?)
CRGreathouse is offline  
December 14th, 2007, 05:57 AM   #6
 
Joined: Dec 2007
Posts: 24
Re: AI basics

Are you saying that I should write an AI that is capable if changing and mutating the weights assigned to the various actions based on game experience, and then just play the AI against itself until it reaches a suitable level of cleverness and tactical ability, whereupon I would then save that version of the AI to be used against a human?
Infinity is offline  
December 14th, 2007, 06:00 AM   #7
 
Joined: Dec 2007
Posts: 138
Re: AI basics

Yes... That is what he's suggesting...

Learn lisp, and use macros , it'll make the whole process smoother
cknapp is offline  
December 14th, 2007, 09:43 AM   #8
 
Joined: Dec 2007
Posts: 232
Re: AI basics

Quote:
Originally Posted by Infinity
Are you saying that I should write an AI that is capable if changing and mutating the weights assigned to the various actions based on game experience, and then just play the AI against itself until it reaches a suitable level of cleverness and tactical ability, whereupon I would then save that version of the AI to be used against a human?
Yes. You can start it off with weights that seem good, and certainly hardcode the 'obvious moves' where anything else would be silly. Then let it evolve the weights until it's pretty good, save the weights, and use it. If even with the Monte Carlo optimized weights the AI is poor you can give the computer unfair advantages in the game, and if it's too good you can keep the good version as a "hardest" setting and use non-optimal settings for a "normal" setting.
CRGreathouse is offline  
December 14th, 2007, 01:02 PM   #9
 
Joined: Dec 2007
Posts: 24
Re: AI basics

How would I allow the computer to change the weights in a way that is constructive? How would it know how to change the weights based on the data?
Infinity is offline  
December 14th, 2007, 07:23 PM   #10
 
Joined: Dec 2007
Posts: 232
Re: AI basics

Just select a random weight and modify its value by up to k%, where k starts out modestly large and becomes progressively smaller as the parameters become better tuned. Adjusting them properly isn't needed, just adjusting them and letting tests show what works.
CRGreathouse is offline  
Reply

  My Computer Forum > Computer Science Forum > Artificial Intelligence

Tags
basics



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
MODEM BASICS musicworld1 Computer Science 0 July 14th, 2010 11:06 PM
Java Basics asbo Programming 0 April 30th, 2010 05:52 PM





Copyright © 2018 My Computer Forum Forum. All rights reserved.