• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
TriKri

Best AI programming language?

38 posts in this topic

Quote:
Original post by alvaro
Quote:
Original post by dj3hut1
Hello,

why not use a logic programming language like Prolog or a constraint logic programming language? ( f.e. http://eclipse-clp.org/ )


And why would you?


Prolog is good for solving search problems like the AI for chess.
The advantage is, that you don't have to code the algorithm, you must only declare the problem in the right way.

And a CLP is even more beneficial, because you have the ability to restrict the search space with the help of simple constraints.
0

Share this post


Link to post
Share on other sites
You have to choose whether you want a "creative" Chess AI, or a Chess AI that can actually beat other players. The traditional minimax Chess AI considers ALL possibile moves - good, bad, creative, astounding, stupid, the lot - within a certain number of moves ahead (<= a limitation of computer speed, not minimax) and then picks the move that gives it the best advantage. So if there is a creative move that is good, it'll get considered in due course!

You seem to believe that creative moves are the same as good moves.. In the early histories of Chess programming, there were two opposing schools of thought (you can read about this on Wiki) the one where Chess programs should try to replicate human creative and desicion making processes, and the other where Chess programs work more like the "brute-force" method (ie minimax). In those days it was a legitimate question because computers were much slower, and minimax is costly. But in practice, when computers became faster, the minimax method beat even the very complex "creative" methods hands down. It isn't elegant, but it's what works.

So my suggestion is, you need to think about what your goal is. If you want to make a Chess AI that doesn't suck, use minimax. If you want to explore more "interesting" aspects of AI methods, and were just using Chess as example, then I think you should find a different game (or create a new one!) which is better suited to creative AI thinking (perhaps Go? This game is notoriously difficult to write an AI for, because the oft-used minimax completely fails to play the game to any high level!) I'm sorry, but Chess is already married to minimax, and doesn't want an affiar :(
0

Share this post


Link to post
Share on other sites
The reason why I said "And why would you?" is roughly what Oberon_Command said. It's not obvious at all how a logic programming language can be used to make a function that maps chess positions to real numbers (which is what an evaluation function does). If the question had been "Why not use ANNs?" or "Why not use GAs?", at least it would have been obvious what type of solution the poster had in mind. Then we could have had a conversation about the difficulties in applying those methods to this problem.

Quote:
Original post by dj3hut1
Prolog is good for solving search problems like the AI for chess.

No, it's not. I spent about seven years developing a chess program on weekends, I've read most of the relevant literature since the 80s to around 2000 and I can tell you that Prolog didn't even play a minor roll in getting computers to play chess well. Search in chess is done using alpha-beta with refinements (quiescence search, move-ordering heuristics, transposition tables, null-move pruning...), preferably in whatever language is fastest (usually C with many clever tricks so things are fast).

Quote:
The advantage is, that you don't have to code the algorithm, you must only declare the problem in the right way.

I know that's how they always try to sell you declarative languages. In practice, you want to know exactly what your computer is doing at all times, and the abstraction offered by languages like Prolog doesn't buy you that much. This point of view may not be true for every type of programming problem, but it's most definitely true for chess.

Quote:
And a CLP is even more beneficial, because you have the ability to restrict the search space with the help of simple constraints.

I still don't know of any chess-playing programs over 2000 ELO using anything resembling this. What kind of constraints would you impose?

Perhaps you could write a program that would find solutions to mating problems, but before the very end of the game, I wouldn't even know what the main idea of how to structure the program would be.
0

Share this post


Link to post
Share on other sites
alvaro, maybe I misunderstood you, I guess that happens easily on the web. Didn't know you had the experience you have about chess programs either.

What I had in mind wasn't the next top rated chess program, but simply an experiment to see if code that made sense could be generated (only for the evaluation function), and if a computer could "learn" to play chess this way.

What motivated me was that I thought I had a an especially good method for telling what's good (and should be given a higher value) and whats not, since I found source that better matches the "true value" of the position (see my second post in this thread if you don't know what I'm talking about). However, I originally developed that idea for neural networks (to use with some form of backpropagation), since it would be possible to train them this way using supervised learning, and just let the program run for itself, while improving. I guess it could be used just for tuning parameters as well. Maybe it's overkill to try to generate code, but since it's the computers language, I thought it might be what has the greatest potential to achieve something really good.

Note that this would NOT be a replacement for min-max or alpha-beta pruning; those algorithms are very essential for any good chess program, and they would still be there. That would totally be to reinvent the wheel. :)

However, now I kinda don't feel like doing it any more. I feel a little bit discouraged as well. I planned of starting the project, but then it took way to long before anything happened, and then I just lost interest of it. Hopefully I've given someone else an idea or inspired anyone (anyone feels inspired?). For so long it's put it on ice, maybe I will make a try sometime later, in a few years or so.

Thank you anyway for the suggestions that I've got.

-Kristofer

[Edited by - TriKri on October 10, 2009 7:59:55 AM]
0

Share this post


Link to post
Share on other sites
I would not post but there is some contraformation being stated.

Quote:
Original post by alvaro
Quote:
Original post by dj3hut1
Prolog is good for solving search problems like the AI for chess.

No, it's not. I spent about seven years developing a chess program on weekends, I've read most of the relevant literature since the 80s to around 2000 and I can tell you that Prolog didn't even play a minor roll in getting computers to play chess well. Search in chess is done using alpha-beta with refinements (quiescence search, move-ordering heuristics, transposition tables, null-move pruning...), preferably in whatever language is fastest (usually C with many clever tricks so things are fast).


Nonsense. Look at his statement. Prolog *is* good for solving search problems. And in the general, most any modern language can handle 'chess algorithims' just fine. In the 80s, C over Prolog made sense because computers were slow, simple and in order. Momentum and tradition may be why it still continues. As stated earlier in thread speed is not the main issue and even Python was advised. But I prefer the Prolog suggestion myself but would suggest Clojure (lisp derivative) or Oz as better.

Quote:
Quote:
The advantage is, that you don't have to code the algorithm, you must only declare the problem in the right way.

I know that's how they always try to sell you declarative languages. In practice, you want to know exactly what your computer is doing at all times, and the abstraction offered by languages like Prolog doesn't buy you that much. This point of view may not be true for every type of programming problem, but it's most definitely true for chess.


In practice you cannot know exactly what your computer is doing at all times these days. Less and less with multicore. And the abstractions offered by declarative languages buy you a massive amount. I say this as someone who uses them for work. And cringe when I have to do something in C# that I know would be implemented much more clearly and robustly in a more declarative language. These languages excel at recursion and manipulating complex data structures (especially recursive ones like trees). I never done any chess programming but those algorithims you state would be more easily implemented correctly in a declarative languages.
0

Share this post


Link to post
Share on other sites
http://www.cs.utexas.edu/~EWD/transcriptions/EWD03xx/EWD340.html

"Now for the fifth argument. It has to do with the influence of the tool we are trying to use upon our own thinking habits. I observe a cultural tradition, which in all probability has its roots in the Renaissance, to ignore this influence, to regard the human mind as the supreme and autonomous master of its artefacts. But if I start to analyse the thinking habits of myself and of my fellow human beings, I come, whether I like it or not, to a completely different conclusion, viz. that the tools we are trying to use and the language or notation we are using to express or record our thoughts, are the major factors determining what we can think or express at all!"
0

Share this post


Link to post
Share on other sites
Trikri, have you tried genetic programming? It seems to be just what you are looking for. You generate a number of different code "candidates", and test each to see its performance. Then you take the best candidate, and regenerate several parts of its code again to create a new generation of candidates. You test these in turn, and carry on until hopefully you have evolved a kick-ass evaluation function!
0

Share this post


Link to post
Share on other sites
Quote:
Original post by DaeraxIn practice you cannot know exactly what your computer is doing at all times these days. Less and less with multicore.

I don't follow. I thought multicore had no impact at all on what a program was doing. I was under the impression that, unless you specifically designed your program to use multiple processors, the OS would treat your app just like it always has.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by willh
Quote:
Original post by DaeraxIn practice you cannot know exactly what your computer is doing at all times these days. Less and less with multicore.

I don't follow. I thought multicore had no impact at all on what a program was doing. I was under the impression that, unless you specifically designed your program to use multiple processors, the OS would treat your app just like it always has.


Exactly. If you are not writing for multicore these days then you are not writing for the present. Certainly not for the future.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by willh
Quote:
Original post by DaeraxIn practice you cannot know exactly what your computer is doing at all times these days. Less and less with multicore.

I don't follow. I thought multicore had no impact at all on what a program was doing. I was under the impression that, unless you specifically designed your program to use multiple processors, the OS would treat your app just like it always has.

The OS certainly isn't intelligent enough to automatically parallelize single-threaded code, so, yes, a single-threaded application will more-or-less run on a single core (or in the worst case, switch cores all the time, but it will never run on two or more cores simultaneously).

I believe Daerax meant that if one wants to actually utilize multiple cores, he or she needs to step into a very chaotic and nondeterministic world, and that harnessing the power of multiple cores correctly is extremely hard when using "regular languages" such as C++, java or C#, while when programming in a higher level language such as Prolog, Haskell, Oz or Erlang, a lot of complexity can be handled by the language/compiler, and writing a correctly behaving multi-threaded program can then become quite easy. For example, as far as I know, most Prolog programs (those who do not use the somewhat ugly assert/retract constructs) can be run on multiple cores with no change to the source code whatsoever.

(Directed towards "use any language you wish" posts) Languages are indeed "just tools", meaning there is no sense in claiming one language is absolutely superior to another. However, using the right language for the right problem can make a huge difference. Screwdrivers are not inherently better than forks, but they sure make it easier to put those screws in. There's more than one programming language for a reason.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Daerax
"Now for the fifth argument. It has to do with the influence of the tool we are trying to use upon our own thinking habits. ...that the tools we are trying to use and the language or notation we are using to express or record our thoughts, are the major factors determining what we can think or express at all!"


"The limits of my language mean the limits of my world."
-Ludwig Wittgenstein

0

Share this post


Link to post
Share on other sites
Quote:
Original post by TriKri
By the way, I read a book before sometime which contained a chapter about a computer or a computer program (don't know which) called Eurisko (you can see http://en.wikipedia.org/wiki/Eurisko). Ever heard of it? I think that used Lisp too, or at least something similar. That computer achieved some amazing things! Does anyone know how it worked? It would be really awesome if my program could do about the same thing!

I have spent some time documenting myself about Eurisko. Unfortunately, the details available in the literature are sparse. It was a rule-based system that had rules to generate new rules. It was some sort of an expert-system designed to create expert-systems. Very interesting stuff. Now its designer founded CycCorp. I am not sure about how well it is doing but he got a truckload of money to develop datamining software for antiterrorist purposes. Unfortunately it makes most of his work unpublished. There is an open version of Cyc named OpenCyc but I never really understood how one was supposed to use that.

If these interest you, I suggest you read about rule base system, planners, theorem solvers, and all that falls into the GOFAI (Good Old Fashion AI) field.
0

Share this post


Link to post
Share on other sites
I would think the language with the richest ai history is prolog. But again just like everyone is saying, the best language is always a situationally dependent question.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0