There was an error loading form1, i looked at the log, and it said invalid file reference.
Where is the documentation & main part, all i have is 1 form, with 1 screen's worth of code.
Printable View
There was an error loading form1, i looked at the log, and it said invalid file reference.
Where is the documentation & main part, all i have is 1 form, with 1 screen's worth of code.
works fine on my computer... it's actually a very small program, no documentation is really neccesary. try going to components, and make sure the Microsoft Script Control is selected, and name it sc1. other than that there are no file references, maybe only vb6?
WAIT!! I am very sorry!! Wrong ZIP! omg, what an idiot. the correct zip is on this one. lol:mad:
SnakeEyes1000,
I downloaded the file...ran it. This is interesting. I wrote a Life program a few years ago in basic that regenerated a colony by adhering to a few basic rules for living, surviving and dying. The evolve button is a bit deceptive...mutation button would be better label since the equations never changed in their format (i.e. 5 operators, 4 operands). Evolving implies that the equations would grow and grow until they contained 50 operators and 49 operands...or something like that. ;-)
I am attaching a Bit Manipulation program I wrote as a tool for developing my AIP (Artificial Intelligence Program). You can select a random number for a grid size between 3x3 and 5x5. This number is displayed in a grid (MSFlexGrid). Additionally, the bit pattern is shifted left and up...what I called relative...or converting ABS format to REL format. See earlier posts for these ramblings.
Z, the code to convert ABS to REL may be a bit cumbersome. The code to update the grids was much tighter and cleaner.
AIP v0.1 is getting much, much closer...I am shooting for this weekend once again as long as I can get the world to leave me along long enough.
Regards,
sorry about the confusion. my english was still a little bad when i wrote that. i moved from northwestern romania a few years ago. very interested in testing your program. thank you.
sorry about the confusion. thanks, i'll take a look at this program.
SnakeEyes,
Your English is perfectly fine. You write far better than most people here in South Carolina, ranked 49th out of 50 states for public education...
Is the program your creation or did you get it from a book? I think it is interesting.
My comment about evolution versus mutation is based upon this. There are two thoughts in the US about the origin of life. One is evolution and the other is special creation by a creator.
This is interesting to me because if one writes an AI (Artificial Intelligence) program modelled after humans or other life forms, then it is possible to create two models...one that evolves into more complex programs (i.e. ape to man) or one that simply stays the same but changes some form somewhat superficially (i.e. men with different skin color).
I have read about this concept in the past fews years in a couple of AI books. Another concept involves having two programs that are identical .exe files...but they have unique 'DNA' files. Consequently, they behave differently. The next steps requires the two programs to spawn a third program that shares the 'DNA' data and produces a hybrid of the two.
May I have permission to post your program on my site?
Regards,
ChuckB
Yeah, Chuck, I can imagine that the ABS->REL Pattern conversion code will be pretty tough, especially as grid sizes increase in size, and patterns become more complex, but you should be able to do it =).
Sorry, but I havent been able to take a look at your hang man program yet (no access to VB at the moment), but I will as soon as I can). The same goes for the NN/Genetic Training demo I was going to do, though the reason is a lack of a C++ debugger (all C++ I do at the moment is over Telnet to my home server running Linux =).
I should be ready to go though in a few days, at which point I have a mother of a job to do (write a full RDBMS, with a bunch of bells and whistles =). When that is going well, I will get to that demo =).
Z.
Hi Z,
I created a VB Multiple choice testing program tied to an Access database 2 weeks ago in order to administer a 130 computer theory and hardware exam to my students. My goal was not to have to grade 130 x 24 questions. The autograding was great.
They have been warned that their next exam will be similar to the last one but I will incorporate the Hangman front end. Each incorrect response adds another body part. If they end up 'swinging' before the exam is finished they will be finished. ;-)
AIP update: Each absolute pattern displayed in a 5x5 grid can be oriented a total of 8 ways (rotating and flipping). I have got this working with all 3 grid sizes.
A few more lines and I can begin programming the AIEngine SUB that will return a row and col to the routine controlling who is playing...teacher or program.
I am considering two possible approaches. 1) hardcode this AIEngine giving considerations to random selection, playing to win, playing to block, desperation, et. or 2) place this data into a data file so that this method can be modified by the AIP over time.
Honestly, no. 1 sound easiest and will serve as the first release version with no. 2 planned for the future.
I can use two LONGs to store 64 square grid for checkers. However 2^31 produces over flow. 2^30 is okay. Need to figure that out.
I am spending a lot of time writing a thorough help file (HTML) with theory, graphics and general help to go with the program. This helps keep me focused on the strategy.
Really late. Much teach electrical code class in moring...not my favorite but it pays the bills.
Telnet to your linux system...are you away from home now w/o VB?
Regards,
ChuckB
No, Im at home, but my computer is in pieces, and Im without my hard drives =).
When dealing with VB, data types are always signed, so one bit is used for the sign. When it comes to doing bit manipulation, this shouldnt be a problem, as you only care about the bits, not the actual value.
A hang man test =). That sounds like fun!
Z.
I apologize for the delay. Thank you, I am working on my english and I have gotten much better. You have my permission to post the program on your site, of course, just make sure to indicate you are not the one who wrote it. This is not pride; I would not want you to be blamed or have to explain any faults. By the way, my final thoughts are "Unde est toaleta?". I need that answer as soon as is possible.:D
is that "where's the bathroom?" and what does that have to do with the program?? ;)
well I hope I can soon play against your program...
you need to implement some takebacks/undos so you wont teach your program wrong stuff by accident... I think that would slow down the learning process really bad...
Thank you for your criticsms. I like improving old projects. Thank you, I might try to implement something like that. If you went through the cpde thoroughly enough, then you would have noticed that the mutation has not been done AT ALL yet. I apologize, but it makes it interactive(now you have to finish it becuase I am too lazy):D
Hi,
I am attaching Part 2 of the AI Model paper. It deals specifically with taking winning patterns, X's, O's all represented as bit patterns and using that information so that the computer program will make the best play that it can based upon winning patterns it has been taught by the teacher/user.
Feedback is always welcome.
I started a major overhaul of the source code over the weekend for my AI Program due to algorithm improvements I figured out after I started programming. One day I will think to work 100% of everything out on paper before coding. Not this time though. ;-)
Note, the strategy in Part 2 only deals with Type 1 games...games that start with an empty grid 3x3 to 5x5, players play one piece at a time...only two types of pieces used...i.e. X's and O's. It is still too early for me to consider how to evolve the program so it can handle checkers. First things first.
Regards,
ChuckB
Hello everybody,
I'm doing lots of game programming, and AI was always one of my favourite subjects.
When it comes to AI, it's absolutely no matter which language you want to use - as long as you have a good concept, it will run anywhere. The language does then only improve perfomrance.
Unlike developing things like graphical engines,arithmetical and/or logical routines and the like, writing a good AI isn't an exact science, there are no real standards.
You CAN hardcode an AI, however, usually you need lots of code for even the smallest task.
The method I prefer are binary trees. You always start with a starting situation S and want to reach an end situation E.
To reach E, you must run trough several Processing-Situations
P(i).
P(i) is chosen from a list of multible possibilities(actions), and always the action with the most in common with E is chosen.
An example:
You start with a square of digits, from 1 to 8, and one blank position:
7 8
3 4 6
1 5 2
This is your starting Situation S.
You want your AI to sort these digits, to reach your end Situation E, which lokks like that:
1 2 3
4 5 6
7 8
To sort these digits, you can move a digit to the blank space.
Example:
S: 7 8
3 4 6
1 5 2
P(0): Move digit 8 to the blank space:
7 8
3 4 6
1 5 2
To realize this, you first need a list of possible actions, in priority order:
LIST = "UP","DOWN","RIGHT","LEFT"
Now you let your program check which of these actions is possible for witch digit (this shouldn't be a problem, so I won't explain it further).
For example, in S, the action "LEFT" is possible for digit 8, while "UP" is possible for digit 6.
Now you let your AI execute all actions to all digits, and store them in a list.
(NOTE: C/C++ is great for this specific task, for it offers great lists and binary trees.)
EXAMPLE:
S: 7 8
3 4 6
1 5 2
P(0): EXECUTE ALL POSSIBLE ACTIONS:
UP:
7 8 6
3 4
1 5 2
RIGHT:
7 8
3 4 6
1 5 2
E:
1 2 3
4 5 6
7 8
Now you check, which action fits best, that is, which result has most common with E.
In this case, it is the "RIGHT" action, for digit 6 stands in the right place, so it's:
UP RIGHT
0 / 1
So you store situation P(0) = 7 8
3 4 6
1 5 2
If you realize it over lists, trees, arrays ,databases or any other way is up to your choice.
Now you have the possibilities "UP","LEFT" and "RIGHT"
Executing them all with bring you:
UP:
7 4 8
3 6
1 5 2
LEFT:
7 8
3 4 6
1 5 2
RIGHT:
7 8
3 4 6
1 5 2
As you see, "LEFT" isn't a valid option, for it is already stored in "S", and since no situation should be reached twice, only "UP" and "RIGHT" remain.
It's:
UP RIGHT
1 / 1
So you store P(1)= 7 4 8
3 6
1 5 2
Now you have all four possibilities:
UP:
7 4 8
3 5 6
1 2
DOWN:
7 8
3 4 6
1 5 2
LEFT:
7 4 8
3 6
1 5 2
RIGHT:
7 4 8
3 6
1 5 2
UP DOWN LEFT RIGHT
2 / 1 / 0 / 1
Now, you save P(2) = 7 4 8
3 5 6
1 2
Following this sytem, your AI should be able to solve the task and come to E.
You can use this method for almost every task, however, sometimes you have to decide over similarities rather than absolute commons.
Have fun with the tip, I hope this helps and I'll be able to post again soon,
CodeRonin
CodeRonin: The method you posted above is a simplified form of desicion trees. Instead of a binary tree, you can instead use a general tree (a tree in which each node can have any amount n child nodes), and solve more general problems with more possible actions. Though this is a good method, for more complicated problems, the tree can become so large that it cannot be stored in memory, or the search takes so long that the final result is invalid anyway (this is especially true in games).
Chuck: Ive got a new computer all set up (its actually a virtual computer, but it suits my needs =). I still have work to do before I can get started on my AI things, but I will get there =).
Also, I saw the book I suggested at Borders the last time I was there, so you might be able to find it there, if you are lucky =).
Z.
Hi,
CodeRonin, thanks for the decision tree explanation. Zaei has posted similar explanations earlier in this thread but every explanation has value in penetrating my think head. :-)
Z, I have spent about 6 hours today working on my AI program v0.1e. The letters increase with significant changes. AIP is now playing against me. I need to hook in the pattern algos and the program should have the capacity to learn from playing and to get better each time.
It is of course a whole lot easier writing a program to play tic-tac-toe (TTT) then it is writing a program that has the ability to learn to play TTT and other games. But I am sure the agony will be well worth it. ;-)
I posted a few messages earlier, a DOC file (zipped), that explains how the program will determine the next logical move based upon definitions of win in it's database and upon current play (i.e. where the X's and O's are presently). Let me say that this method looks to me to be the most straightforward and simplest way of enabling intelligence in the AIP. I cannot tell you if it is a decision or binary tree....or if either of those methods will apply here.
So, I will make this thing work...then you and others can show me how to implement these various 'thinking' strategies.
During the past week, I have successfully written small programs with Dev-C++ that uses OpenGL and also SDL. I am interested in converting my VB AIP to C++ once I get it working as a way to break the ice with C++.
Well, I have the rest of the week off to program so I hope to upload a 'beta' version of AIP soon. Z, where is the best place to post that zipped file? In this thread, start another thread focused upon the program or go to another forum and post?
Glad to see your virtual computer is online...not sure what that means though. ;-)
Regards,
ChuckB
Just take it that I can program again =).
You might want to consider creating a new thread down in the Communication Area, focused only on AIP, and then using this thread here for theory and such.
Z.
Zaei,
I thought it would be better to post simple steps first, as general introduction to AI.
Next I've planned posting something about first-order, low-depth and breath-first, but if you already posted method trees, ther's no reason to post such basics again.
However, a thing I've learned in my actual program is:
Never try to build a perfect AI from the beginning - it's impossible.
Building an AI is very time-consuming.
The most important part is the concept - try to make some points clear:
1)What does my AI have to do? It sounds simple, however, many AI projects are aborted because after some months the programmers don't exactly know their programms exact task any more.
2)How do I realize it? A good on-paper concept saves half the work in most cases. Here you decide which method you use, or if you create a new method. It's always good to check if a similar AI has already been developed.
3)Which language(s) do I use? In some cases it's a good idea to mix languages (this is my opinion, many say it's rubbish, but if you find the proper interface for multiple external progs to communicate, it's a great thing). For example, if your AI controls any graphics, but needs lots of time for calculating (like chess games, if they are good), you may want to combine VB and C, or even Assembler.
---------------------------------------------------------------------------------
Then, try to code a simple, weak AI doing the main task - for example moving tiles or filling in numbers. It doesn't have to be good at it, it just has to do it.
---------------------------------------------------------------------------------
Now, test your AI until it does something stupid (which shouldn't take too long with a new AI).
Analyze the following points:
1)What was the situation?
2)What would you have done in this situation?
3)What could have been the reason for what the AI has done?
Then, if you know these points, you should be able to correct the error (by correcting it, or just by appending some control-routines).
Do not correct every little mistake the AI does, as long as it isn't really fatal, it doesn't concerns you in this state of development.
Now do the test again, until no more fatal errors happen.
---------------------------------------------------------------------------------
Now you can correct the smaller errors by following the same system as with the fatals... however, when the fatals are gone, most samller errors should be gone, too, for they are often created by fatals or even the creators. In any case, you should have destroyed most of them until here.
---------------------------------------------------------------------------------
Now, as last test, you can either hire some friends to test it, or just open up a second instance and let the two of them work against each other.
If you follow these points, and don't start to rush (rush = deadly with AI development) then you should be able to create fine, able AI's.
Hope this helps,
CodeRonin
Curse of the screenshot??? I am going to risk it and show anyone who wants a peek what I have invested nearly 80 hours (on paper and source code).
My program is now teachable for games using grids 3x3 to 5x5. I have the AI Engine working random moves now in order to get game play, file saves/opens functioning correctly. Please take a look at the screen shot in which I beat the program at TTT. I clicked the Win option button, then highlighted the pattern in the grid that constituted a win, and clicked on Send Feedback. This loads the knowledge base array perfectly.
As an added bonus AIP allows the teacher to look at the knowledge file that was loaded, global variables at work in the program (allows me to study the process during run-time) and then I can dump the system knowledge to the screen in AIP scripting language such as ABS( );( ), etc.
I am making a change to the AI concept...AIP will take a pattern, shift it all the way left and up to create what I call the relative pattern...sort of normalizing it (if I can use that term) so other patterns can be compared. The difference, is I will manipulate the relative pattern across the grid to determine all possible absolute values possible based upon this pattern.
For example: If AIP sees a vertical win, then this means there are three possible vertical wins in TTT. All it needs is one vertical win to guess that there are two other possible plays.
Now I do not think that is cheating because the human brain is quite natural at picking out patterns.
Please let me know what you think. My family only see the backside of me most days now as I work this. :-)
Regards,
Chuck B
I must agree... AI is certainly to be done in stages.
Determining what an AI is meant to do is difficult, as well as determining how it should be done.
I think that a better method would be to use some sort of automatic testing system, that would allow an AI to fix itself. This is where neural networks are helpful, as there are algorithms that automaticaly adjust the neurode weights without human interferance.
Here, with AIP, Chuck is working on creating an AI that can be taught, not only to do one specific task, but several related, or unrelated tasks.
Z.
Hi,
Z, when the program is ready to post I will do it in the Communications area as you suggest.
CodeRonin, do not think that all of us are like Zaei and are brillant programmers. ;-) My study of AI has been theoretical in books that I have read. Lots of ideas but not immediate application to programming. I did get a book from the library called "Practical C" by O'Reilly & Associates. These decision trees are explained in very simplistic terms so much that the lights came on today :-)
It was a simple figure but it all became clear. Now I know what it is. Can I apply it? Not sure.
I am going to perform some nonsensical tests on my AIP. The most important will be lying to my program as the teacher. You see, right now, the program is 100% trusting. I am curious how much I can mess up the 'little fellow' by lying. Of course 'lie' detection would come in later program versions.
Back to debugging my file writing and opening.
Regards,
ChuckB
Of course it's hard to determine what an AI should do - but every design is hard.
However, AI's are in general better if they are designed for a specific task.
Although my philosophy is to hardcode as little as possible, when it comes to AI, speed is essential, and hardcode is way faster than any external data exchange, no matter of what kind.
Of course, you can write small AI's by teaching them everything, but as soon as it come to bigger projects, much more hardcode is needed, especially in such slow languages as VB.
AI?
Hardcoding AI for specific tasks is not really my area of interest. I have written many games with 'AI' in QBASIC years ago. They worked fine. My chess game played legal chess, though my young children could certainly beat it. The problem with my chess program was simply this....
...it could only play chess!
So, my concept of AI goes beyond the performance of a single task but rather sees an engine that is capable of handling several AI tasks...with the possibility of persons adding modules to extend its engine capability such as 3D coordinate systems, time, comparisons of objects (size, color), natural language processing, etc. The modules could be added using just about any code as long as the various libraries or modules obeyed certain conventions when passing arguments, etc.
Imagine, you want to add an agent to a game. You define its characteristics, its intelligence level, mobility, etc...into a script file. The script file along with a module is linked into program and voila...you have added a worthwhile contender to your game just be selecting a few attributes. Of course the game program must have the code to handle time (time compression), coordinate systems, interface agents with virtual world, etc.
So, this module (DLL or LIB for example) has the ability to play a chess game or navigate around in a virtual world and seek to destroy the human player and so on. It accumulates knowledge and saves it into a database for later retrieval. It then locates related AI agents like itself and shares knowledge.
Far fetched? Maybe. But then it is just a dream of mine. How to implement it? Not sure.
So, my AI program will handle simple fill in a grid type games. Then hopefully expands to play checkers, connect 4, chess. Then hardcode capability to play Risk, Monopoly, dominos, card games, etc. The list goes on.
Teaching time should be very quick...like teaching an adult to play chess....they learn quickly...and with some practice get quite good. There is something about the human brain that allows it to learn a variety of games. All of these facilties come to play in real life with humans...therefore AI that can play games I believe has a chance of being used outside of the gameplaying arena.
So much for my thoughts. ;-)
Time to code.
Regards,
ChuckB
Chuck, what you've described would be the optimal AI : short learning time, little hardcode and availiable for all tasks - true AI.
The only problem is: No one can be sure if it's even possible to create true AI.
Of course, it's great to do researtch on true AI, I'm glad people are interessted in creating true AI - I am, too, and I'm doing my own studies in this direction.
However, if an AI is NEEDED for a specific task, it's nonsense in my opinion to teach it hundrets of other things, which it'll never need - and lose time in this way.
As you know, you don't have time to do everything perfect in a big project (when it's not just for you), so you'll need to find a middle-way.
No company will allow you to spend loads of money and lots of time to develop an AI to play chess - for a good reason.
So, for own study there's nothing wrong with searching for true AI (as I do, it's my holy Grail ;) ), but when it comes to an AI that is needed to play a role in a project, you won't have the luxury of implementing true Ai if you want to finish your work.
It's fine to have someone to discuss with,
CodeRonin
Hi CodeRonin,
I agree with overkill on writing task specific AI. But consider this.
There is a program called Cyc which just celebrated its 18th birthday. Led by Lenat this program takes natural language input and is capable of applying 'common sense' to many things. For example, a dead dog cannot play, falling off a steep cliff could result in severe injury, etc. I understand it is available on line for training by internet users.
Lenat's thoughts are to take this package which fits on 1 CDROM and to put it on future Operating Systems for some purpose...
My concept on AI would be to produce a module that can be taught <once>. The module and the knowledge base would then be used as one unit for future programming needs...an AI library I suppose.
What really interests me is that with all of the predictions about what computers could do in the future, it is the field of AI that has been overly rated...i.e. computers that could beat the best chess players as early as 1964, fully conversational type programs by 1990, etc.
My readings on neural nets and all they promise have not lived up to most expectations. Expert systems require intensive and expensive training sessions. So the AI field is wide open for us to explore.
I spent nearly 40 hours programming during the past 5 days on my 'simple' AI program. It is kicking me in the tail but I smell victory on the horizon. :-)
Regards,
ChuckB
This is off subject, but imagine for a second that someone made a fully intelligent AI, with the ability to be smarter than anything on earth. What happens when it realizes, as it must, that it is the smartest? This is an ethics question, because any true AI won't have any restraints or blocks on it; it would be able to learn to hate it's creators. And obviously, with the way the internet works now, it could easily infect every computer in the world. So do we really want to have an AI that is capable of learning anything, as real intelligence is?
Not really, snakeeyes. Though movies like Terminator seem to put AI in a bad light, think about it this way. If someone were to develop a self aware AI, and it took over the world, can we honsetly say that the person who created the AI is responsible? That would be like saying that any mass muderer's/conquerer's/evil dictator's, etc parents are responsible for their actions. Are we to say that procreating is a bad thing, because it might spawn something evil?
Though, if you really think about it, a true AI would not really crave power, domination, etc. At most, I think it would be self preserving (a la, The Iron Giant), and not a tool of evil =).
Z.
Hi Everyone,
I am sure you appreciate seeing a challenging program work after you have spent over 100 hours designing and writing the source code.
Today at 3:30 EST AIP v0.1g kicked 'butt'! It took just three tic-tac-toe games for AIP to learn how to tie and beat my son. My wife created a 5x5 grid game in which you had to connect 5 blocks (cells) in some connecting pattern. Within five games AIP (pronounced 'ape') was playing agressively with what knowledge it had learned and with an unquenchable thirst for even more knowledge. Okay...I may be exaggerating just a bit...
Man! The engine requires data to be formatted a particular way. The actual AI engine is fairly simple...blew me away. I expected tons of code to make this program 'hum'!
I have 5 cosmetic bugs to correct and I will be ready to release v0.2a to the public. :-)
Sorry about the excitement. It's my first real, genuine AI program that wasn't hardcoded to play specific games. Hey, even my wife the schoolteacher thinks its really cool!
Got some debugging to do.
Regards,
ChuckB
Good going! Congratulations! I would have expected that it would require more games for it to start tieing and winning, though =). Good job!
Z.
Hi,
I have started a new thread in the Communication Area supporting my AI program, AIP v0.2a. The thread is http://www.vbforums.com/showthread.p...hreadid=185539
The zipped file - source code, graphics and HTML help pages can be downloaded from http://www.clg-net.com/ai/aip.htm
Regards,
Chuck B
I don't claim to be that up on the theory, but I've been reading this thread and playing with Chuck's AIPs and it seems to me that our man here has created a simplistic neural net.
Each square of the board is a node that gradually recieves a 'win weighting', that allows the AIP to make good decisions about where to play in order to win, or to prevent itself from losing.
That is essentially a neural network is it not?
Chuck: I took a look at AIP.2a, but it wasnt very friendly to my Virtual Computer =). I will take another look later on my main computer (I wasnt sure if you had included an exe or not, which is why I tried it out on my virtual one first (VB doesnt run over a network =( )). The interface looked very nice, but once I got into a game, the computer essentially locked =(. I would put this down to a fault in the VM and/or VB itself, since several of my programs do the same thing =).
Judd: Though the program does assign a weight to each square, it also uses patterns to figure out its next move. AIP appears to try and find the square that a) control has yeilded a win, and b) fits into a pattern that causes a win.
Z.
The ZIP file does include EXE and source code. However, it requires two controls...flex grid and tabstrip/status bar. Maybe this is the problem. Can you run any VB programs..non EXE mode...with your VM
If you cannot then you probably need the two OCX files. I have them zipped at http://www.clg-net.com/ai/aip.htm for those that need them. Of course, they need to be registered with regsvr32.exe I believe...not sure about VM's.
I have received feedback from person online and locally. One report played two instances against each other to see the outcome. The human served as the mediary (sp!).
I am advancing a theory now that will increase the 5x5 limit to an almost indefinite size limit by using arrays instead of 32 bit long integers. I have worked out all details on paper to get v0.4 to play checkers...accept two things.
1) How important is history...is it really needed once AIP needs rules. I think it is a possible disadvantage that AI programmers rely upon entirely too much...modeling humans...for example, don't remember much history in great detail...just a few key facts.
Yet their pattern recognition is superior to programs with tons of historical data....
2) Matching winning patterns is one thing...matching legal moves with board layout...while marching towards a goal of annihalating the enemy requires a lot more thought...and programming
You see humans must be taught rules, but they also must learn strategy...which I must be able to define in my game .AIP file and inside the AI Engine.
Judd,
I wouldn't know a neural net if it hit me in the head...but its a flattering thought that I may have stumbled upon something so cool. :-)
Regards,
ChuckB
The VM is essentially Windows 2000 in a little window =). Everything is exactly the same, otherwise. The application runs, and works simply fine until I actually start a game. At that point, the VM becomes unstable (the VM's fault, not AIP's).
I posted down in the Communication Area as well.
Z.
Hey
well I am sure you want to concentrate on the AI part first and not on the interface. But I think you could improve you AIP a lot by upgrading the interface. What I am thinking of is: Setting up a connection between two of your programs (most likely with winsock) once your programm knows all the rules you could provide your file storing those to both programs than connect them and let them play for a couple of hours if they don't start repeating the same game over and over they are very likely to develop strategies (I haven't seen any of your code, neither am I sure if I would understand it..., so I can't say if they are really going to learn by playing against each other, but I think it is probable)
Hi,
You mention Winsock. I have this question. I can write two programs that can run on the same computer that communicate with each other in two ways. 1) They read/write to a common file, thus they leave and write messages for the other to use.
2) I did some DDE years ago on a very limited basis.
Can I use Winsock to get 2 programs on the same PC to communicate? If so, does anyone have some sample code that I can play with because I would really like to implement this? Can I then use this same code for network/internet communication by specifying IP addresses?
Computer vs. computer?
There are some non-random things that I do in the v0.2a program that results in some eventual predictable play by AIP. I will change this in the near future.
Before two AIP programs play together, I would suggest the human teaches the first AIP program to play a game. After the training session is over...say 10 games...then you allow the two AIP programs to play. This way, one program teaches another to play the game. The emphasis here is on teaching a program to play a game.
That is the current limit on AIP. Once the program knows how to play a game it will do its best to win and to oppose defeat.
M, consider this. With the AIP engine, it is possible to create a new computer game without any programming in the conventional sense..you know, using VB or C++. Instead, we can create games by playing the game and teaching it as we go. This game is saved. We can write another program that has no teaching interface but is a simple interface that allows game play only using the files that were created with the AIP teacher interface.
Now, I think this is how the human brain works...which is why I consider the program AI.
Regards,
ChuckB
Z and others,
Here is a concept question for you.
I know how to save history and rules in a text file for reading into a program so it can operate. AIP v0.2a does that. However, I am not satisifed with this one major defficiency. AIP CANNOT add to its program by writting more programs or program modules...eventually growing to a much larger size. The brain seems to constantly update its 'program' as we learn more and more...so I have not really achieved AI as I see it.
Do you think the following process will work and help me to close up on this.
I create an AIP program module that allows me to read data in from a specific file format. This is not the current game files I am using...but a deeper and more permanent method of allowing self-programming.
'sample file
GAME.ROWS | integer | Method=DefineGridRowSize
GAME.COLS | integer | Method=DefineGridColSize
Now, inside the VB source code, there exists no hardcoded global variables for defining rows and cols in the grid or any other game parameter. So, when this file is loaded by the program it constructs a user defined array to handle these variable types. Something like this:
'define user type
TYPE MyArray
a AS INTEGER 'define all possible variable types here so type is universal
b AS LONG
c as BOOLEAN
.
.
h AS STRING
method AS INTEGER 'stores pointer to a hardcoded method
END TYPE
'update array
REDIM PRESERVE nGlobal(UBOUND (nGlobal) + 1) AS MyArray
IF nVariableTypeReadFromFile = "integer" then
nGlobal(UBOUND nGlobal).a = nIntegerValueReadFromFile
ELSE...continue all variable types after this
END IF
nGlobal(UBOUND nGlobal).method = nMethodTypeReadFromFile
So, now, I can create AIP scripting language keywords...assign them a variable type an associate them with a Method. The problem is that this is a bit pointless since I am still hardcoding Functions or Methods.
Now, am I looking at the ability of AIP to write its own macros? Its own methods? Am I writing my own programming language that can be used by AIP? Am I way over my head? ;-)
Any thoughts would be appreciated. My task seems to be able to write ironclad engine that can process a sophisticated set of keywords and macros...am I writing an interpreter? Macro recorder?
Regards,
ChuckB
well for the winsock question:
yes it is really easy to program a program that can communicate to another one over winsock no matter if it's on a local pc or on the network or the internet.
It is much easier to do it for one pc though since you don't have to bother with the possibility for data coming in slowly..
all you need to do is put a winsock control on your form and set one of you programs to listen (server) and the other one to connect to it (client)...
all of this requires only a few lines of code that I have to look up in the msdn every time I use it...
as far as I know there is a winsock tutorial on vbworld so you could use that code for reference.
I read through most of your thread and I think I understand what you are doing. What I meant is this:
First the human teaches the game to the program. Now you get the game file if I am not mistaken. Copy it to the other intance of your program. Now both have the same 'rule set'. Now you don't have to bother to teach the second program from the first, but you(respectively your program) can go to develop strategies...
if you got enough random actions in your AI it should gain huge knowledge about how to move by playing practically against itself.
...well while writing this I was thinking: You could program your AI engine into a server kind of thing. Now a client can connect tell it where the game file is, send the current state and your AI server will send it's proposed move... this way you would be really flexible, you could have some client that looks much like your current gui that can teach than others that can just play one game that comes with them as you AI file thing..., this way everyone could code a graphical interface for some game he taught your ai first...
Chuck: Essentially, teach AIP to program itself? Actually, I have realized the same thing about our own brains, though not to the extent that might be imagined. I think that our brains only add data processing capabilities. For instance, before we start school, we dont know how to read. At that point, when we learn to read, we learn how to process written information. Once we have that, it is only a matter of expanding a knowledge base (our vocabulary) to learn to read. The same goes for essentially anything. Math, programming, etc. When learning a second language, we simply train our brains to map words and phrases to words and phrases in our original language, in the first stages, and then the second language gets its own knowledge base (fluency). For instance, when learning a second language, it is very difficult to read a word that is unknown and figure out its meaning from context, while it is usually VERY easy to do in the original language.
Basically, what you propose is to write an engine that is capable of not only learning, but also modifying itself to be able to understand more concepts, in the way the human brain works. Conceptually, brilliant. Practically, itll take work, but it seems feasible =).
I would personally be interested in pursuing something like this =).
As to winsock. Everything MisanThrop said is true. That is the reason I am using winsock for communication in my database system, ease, and flexibility (simply point the IP address to some place with an AIP server, and it will work).
Z.