• Lucid Dreaming - Dream Views




    Results 1 to 21 of 21

    Thread: AI Program

    1. #1
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386

      AI Program

      I got bored yesterday and wrote a dynamic AI scripting language for a Nought & Crosses (Tic-Tac-Toe) game. So far, there's a group of programs that have evolved to beat the usual 2-5-8 win

      Oh, and this only works on Windows platforms.

      Download: http://www.filefront.com/14485647/T-T-T%20AI%20v2.rar
      Last edited by A Roxxor; 09-07-2009 at 09:28 PM.

    2. #2
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      Sorry, found a huge bug. Fixed it, though

      http://www.filefront.com/14485647/T-T-T%20AI%20v2.rar

    3. #3
      Xei
      UnitedKingdom Xei is offline
      Banned
      Join Date
      Aug 2005
      Posts
      9,984
      Likes
      3084
      How does it work?

      I'm guessing you've done it in a special way because it's pretty trivial to create a program which always wins or ties, you just have to list all of the different situations and the correct move.

    4. #4
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      Lol yeah. What it actually does is contains a population of programs that use a pretty simple (But dynamic!) scripting language that is basically all about placing pieces on the board. When you play a game, the computer randomly selects a script to run, and depending on how it performs determines how many times it gets to reproduce. Programs that get to a point where they cannot place a piece in an empty square are killed, and when an program reproduces (Always asexual with only one chromosome) random mutation and information dithering may change the script, resulting in new behavior. To get a list of all of the programs and their stats, type 13 into the console and check the data folder for Programs.txt.

      Also, new version: http://www.filefront.com/14486417/T-T-T%20v3.rar

      Fixed a few crashes.

    5. #5
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      Forgot to actually upload the fixed version: http://www.filefront.com/14486645/T-T-T%20v4.rar

    6. #6
      Credo ut intelligam Achievements:
      Referrer Bronze 5000 Hall Points Veteran First Class
      Noogah's Avatar
      Join Date
      Mar 2009
      Posts
      1,527
      Likes
      138
      Man of hidden talents. Lol. I didn't know you were into programming, roxxor. Works nicely. You should make a gui.
      John 3:16

      For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

    7. #7
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      Yuss. GUIs are too needy and make everything all cluttered early on. I may make one once I actually finish the program

      Here's the latest version w/ a trainer. The Trainer program runs the AI scripts against a random number generator, so it isn't particularly effective, I was just testing it for memory leaks. The trainer runs 20,000 iterations (Several minutes on an Intell E8400 @ 3.00GHz) before stopping. Just hit enter to exit it. I'll post up the completed version when I'm done.

    8. #8
      Credo ut intelligam Achievements:
      Referrer Bronze 5000 Hall Points Veteran First Class
      Noogah's Avatar
      Join Date
      Mar 2009
      Posts
      1,527
      Likes
      138
      Nice. I love AI, and who doesn't love tic tac toe? I'll be watching for the full version.
      John 3:16

      For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

    9. #9
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      Er, here's the D/L link...

      http://www.filefront.com/14506967/T-T-T-v6.rar/

      I have a better version in the works, but I keep running into some nasty runtime errors in the new trainer for some reason. I'll upload it when I fix that.

    10. #10
      Credo ut intelligam Achievements:
      Referrer Bronze 5000 Hall Points Veteran First Class
      Noogah's Avatar
      Join Date
      Mar 2009
      Posts
      1,527
      Likes
      138
      So, does the trainer basically work against itself? Also, whats with all the organism babble? Is this also a computer natural selection thing? I'm getting confused.

      John 3:16

      For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

    11. #11
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      This is a precursor for an Artificial Life simulator I am working on. Organism = Program = Reproducing entity that carries inheritable, mutable information that directly describes that entity's structure and behavior.

      The program works using a dynamic scripting language I wrote with the principles of random mutation and natural/artificial selection. Right now, the trainer you have runs for 20,000 steps and pits a random program against a random number generator that selects the spot it places and the program is either rewarded or punished based on how well it did. What I am working on is a system that will pit a random program versus a random program and let natural selection ensue, as a random pattern is more likely to fail and pass along stupid, error-full and self-destructive programs.

      Basically, a program is just a set of instructions that revolve around playing tic-tac-toe. The program has a stack which is can place items onto, delete from or query, and has the ability to query squares on the board and place pieces from its stack. It can also perform a few arithmetic functions on its stack items.

      Whenever a program is playing as the opponent it is being scored based on its performance. For instance, if a program wins, it is allowed to breed many times depending on how many loses and ties it has. Same thing for a tie, only less times. A program that loses does not get to breed, but is not culled either. After every game 15 - 25% of the population is killed off at random, and if the population goes below 35 it is revived by random reproduction. The population is also capped at 2000, with programs having a maximum of 300 instructions and 300 stack items. Any more will cause the program to die. After several thousand generations [of challenging games, not a random guessing opponent], programs will likely emerge that can tie and/or beat human opponents.

      I intend to take this basic system and turn it into a fully-fledged artificial life simulator that I am still designing to model real organisms as close as possible and still be able to calculate thousands of instructions per second.

    12. #12
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      Here's the final version with the completed trainer: http://www.filefront.com/14525855/T-...%20Version.rar

      The trainer now pits program vs program and you can already see that winning patterns are starting to show up within the population.

    13. #13
      Credo ut intelligam Achievements:
      Referrer Bronze 5000 Hall Points Veteran First Class
      Noogah's Avatar
      Join Date
      Mar 2009
      Posts
      1,527
      Likes
      138
      |Noogah nodds intelectually, and pretends to understand everything|


      ANYHOOOOOOW.....

      That's a cool game. Congrats on that. Especially the whole...evolving thing. It's neat. You a programmer or a hobbiest?
      John 3:16

      For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

    14. #14
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      I am a programmer, but I'm not getting payed to do it yet.

    15. #15
      Credo ut intelligam Achievements:
      Referrer Bronze 5000 Hall Points Veteran First Class
      Noogah's Avatar
      Join Date
      Mar 2009
      Posts
      1,527
      Likes
      138
      You can do freelancing.

      There are a LOAD of websites that hire freelancers. If you have the time, that could be a good way to rake in some extra cash.

      Sources? Google.
      John 3:16

      For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.

    16. #16
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      Yes, I know. Most require you to be at least 18 and have several years of professional experience and/or a degree. I'm not currently looking for a job right now.

      Anyway, I tweaked the mutation rates, etc and reworked the ecosystem code, as there were a couple flaws that made it work slowly. Also, I also implemented usage of 64-bit integers to ensure that program IDs don't get too large that they mess up the program.

      D/L : http://www.filefront.com/14546017/T-T-T%20v32.rar
      Last edited by A Roxxor; 09-16-2009 at 11:57 PM.

    17. #17
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      Noöne is interested in this at all?

    18. #18
      Dismember Achievements:
      1000 Hall Points Veteran First Class
      SnakeCharmer's Avatar
      Join Date
      Mar 2009
      Gender
      Location
      The river
      Posts
      245
      Likes
      41
      I'm interested, but I feel like a mental midget when it comes to discussing stuff like this.
      Can you make something similar for a general game theoretic situation? Something like prisoner's dilemma, but that allows users to set up a payoff matrix. Then you have a population of strategies playing against each other pairwise.
      The fitness could be the average payoff a strategy gets when playing against other strategies (and itself).

      It might be a good feature to include in your artificial life simulator, provided you want your digital organisms to be social creatures.

    19. #19
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      Yes, that will be possible. I don't think I would include that in the ALife program though. I want to see emergent properties emerge with it

      I think I might do that with this program once I fix up the scripting language

    20. #20
      Rational Spiritualist DrunkenArse's Avatar
      Join Date
      May 2009
      Gender
      Location
      Da Aina
      Posts
      2,941
      Likes
      1092
      Quote Originally Posted by A Roxxor View Post
      Noöne is interested in this at all?
      I've been watching and I plan on checking it out when I get some free time. I'm very interested in this stuff at times but I'm on a physics roll recently and I don't want to get side tracked The down side of azbergers Gotta watch myself or I get sucked in very easily. If you had written it in lisp, I'd be all over it already
      Previously PhilosopherStoned

    21. #21
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      You have asberger's?

      And I don't know lisp

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •