I have heard that this is impossible for dwarves but still want to try and want to know what program I should get and where from to do this (preferably free) and a bit of instruction on its use...
I'm pretty good at maths but a rookie in the area of programming!











Have a look at http://ai-depot.com/LogicGames/MiniMax.html. That is a tutorial about the Min-Max algorithm. It is a starting point. If we use this algorithm, we need a function that gives a value telling how good or bad the situation looks for each player. The number of pieces left is part of the equation. How well grouped the dwarfes are, is another.
That was useful, although I already knew something about that from my maths, but I was more interested in which software I should get to create an a.i. for this? Can i use thudboard at all?
Plateau? What does that make aristotle? Aristoner? Wait he didn't do drugs...
Well if you are wiling to learn python then you could simply modify thudboard to use your ai.
The ai itself could be writen in python, but for efficiency reasons it's probably better to use a "proper" programing language. If I am not completely mistaken python interfeces nicely with c.
How would I do this and what is python? language or a program? If I am having to ask these questions should I not be trying to do this?
Plateau? What does that make aristotle? Aristoner? Wait he didn't do drugs...
Well if you are wiling to learn python then you could simply modify thudboard to use your ai.
The ai itself could be writen in python, but for efficiency reasons it's probably better to use a "proper" programing language. If I am not completely mistaken python interfeces nicely with c.
Not to put too fine a point on it, but python is a very proper programming language, thank you
And yes, it interfaces nicely with C as well, but python is much better to play around with (even for novice programmers). If efficiency becomes a problem (it very seldom is) then you could rewrite bottlenecks in c.
Anyway, if you want to try your hand at programming in python, just google for python and AI, you'll find a lot of results. Then you can judge for yourself if you're up for it.
Good luck!
Python is a language.
If you understood the tutorial about the min-max algorithm then a basic A.I should not be too hard to make, although you will most likely be wanting to use a language that you are familiar with, or at least one that you need to learn anyway. For starting out I would keep it simple, count 4 points for each troll and 1 point for each dwarf and ignore where on the board they stand. This would mean that the A.I. would have to look rather far ahead to get an acurate count, so expect poor play unless you have CPU cycles to burn for a deep search.
IMHM thudboard does not have the cleanest of codes so working from that could become quite confusing if you are totaly new at programming.
You will have to use some programing, and it's a fairly tall order as a starting out with programming is conserned.
I know of no generic program for implementing A.I. and I think such a program would be extremely difficult to make, because of the many different ways of determining win/loss as well as the problems with defining a generic board in a flexible enough manner. That, combined with limited usefullness of such a program, leads me to doubt if such a program exists.
In general, an interpreted language/virtual machine (Javascript, Java, Flash, Python?) is slower than compiled languages like C, Pascal, and so on. How much depend on what the program does and how good the compiler optimazation is, but I've heard ten times faster as a rule of thumb. Don't know if that is still true. Anyway, a poorly written AI can easily be a thousand times slower than a poorly written, so a good algorithm is the key.
I make my program in Flash, and plan test the water with something that isn't to complicated. The two things that will define the execution time is how many moves it has to test, and how much time it need to test each move.
The trolls have a very limited number of moves, so all legal moves can probably be tested. The dwarfs have a lot of legal moves each time. I plan to limit it to see if it can attack a troll, moving one square, and moving as far as it can in each direction. That will cut down the number of moves a lot. It is also important to evaluate the moves and cut of hopeless moves as fast as possible.
Anyway, it's possible to put up something simple first, and then add more smart code when the simple works. That's what I plan to do, and I have a lot of programming experience (not AI though).
I think i was crazy to think abou trying, but if you were able to create one (and it sounds like you know your stuff) is there anyway you could distribute it to others (trolls permenantly in saunas like me) so that they could also use it?
Plateau? What does that make aristotle? Aristoner? Wait he didn't do drugs...
In general, an interpreted language/virtual machine (Javascript, Java, Flash, Python?) is slower than compiled languages like C, Pascal, and so on. How much depend on what the program does and how good the compiler optimazation is, but I've heard ten times faster as a rule of thumb.
It usually is not a question of slower/faster, but a question of, is it fast enough? Who cares if the button responds after 1 millisecond or 10 milliseconds?
Anyway, a poorly written AI can easily be a thousand times slower than a poorly written, so a good algorithm is the key.
And I totally agree on a good algorithm being key!
IMHM thudboard does not have the cleanest of codes so working from that could become quite confusing if you are totaly new at programming.
Yeah I agree, certainly the UI code in thud.py could be cleaned up a lot. But if you start work on an AI you could use the battle.py code for reading/updating the board-status.
On the UI side you could just add two buttons initially: 1 with 'make troll move' and 1 with 'make dwarf move', redirect that to the AI code and update the board to display the new move.
Personally I would start with the most basic skills: teach the AI the rules...
I think i was crazy to think abou trying, but if you were able to create one (and it sounds like you know your stuff) is there anyway you could distribute it to others (trolls permenantly in saunas like me) so that they could also use it?
If I manage to do it, and if I can get a thumbs up from the thud rules copyright holders so I'm sure not to get into any legal problems, I'll release it free of charge. I'll probably release the source as well, though I'll have to make sure all the variable names are in english, and add some more comments.
It usually is not a question of slower/faster, but a question of, is it fast enough? Who cares if the button responds after 1 millisecond or 10 milliseconds?
The AI will be slower than 10 milliseconds. That much I can tell you allready.
It is however possible to put a limit on how much time it can use (for instance 10 seconds). That will make it smarter on a powerfull imp-box than on a slow one.
If you make the running-time for the AI a user-setting, you can create different levels of smartness: Nobby thinker (1 sec), Vetinari thinker (10 seconds), Deep Thought thinker (millions of years, after which it comes up with the invalid move: 42).
[timings]
The 10 ms was just an example to show speed isn't important if it's fast enough... for a UI action or a one-time action 1 or 10 ms won't matter, but for a tight loop that runs millions of times, 1 ms might make a huge difference.
Personally I would start with the most basic skills: teach the AI the rules...
Well yes.
But I hesitate to call a bot that makes a random legal move for an AI.
Also he indicated that he had understood the min-max algorithm.
Re:
Prolog was the language of choice for AI creation while i was at uni. Scared the hell out of me though so I skipped that module and went and played with lego instead.
Not too sure how easy it is to integrate with other languages though.