Results 1 to 10 of 10

Thread: Some sorta AI experiment

  1. #1

    Some sorta AI experiment

    As I said to WILL, I might post it later... well, I've done so.

    I don't know what to call the thing. It's a bizzare mix of randomness and some neural network similarities. It's just best if you read the code. :roll: It was a total shot in the dark for me and was intended to be an experiment with Neural Networks. Whatever it can be classified as now, it works.



    The average processing time for 1 "nextturn" calculation takes a mere 2 billionths of a second. I've done my best to comment this beast, so it's hard for me to describe it outside the unit, since I've said it already within the context of the unit.

    Anyhow, I'm curious to your thoughts on it.

  2. #2

    Some sorta AI experiment

    This looks interesting, I've been looking for a nice AI system for Alert Fighter, but I hit a bit of a mental block when coding my own.

    Are you going to release the code? The screen shot lools great
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  3. #3

    Some sorta AI experiment

    Oops! Forgot to link to the code!! ROFLMAO! :lol:

    http://freepgs.com/thewickedflea/nne.rar

    MPL Licensed, full source.

  4. #4

    Some sorta AI experiment

    I have never done much at all with AI except specifc to single games.

    Can you post an explanation of what your program does and why it is useful.

    I looked at the picture and I would surmise that:

    The programmer can add behaviour that characters in the game an do and place weights on choosing this behaviour given a set of circumstances.

    Is that about the skinny of it?

    In which case that sounds rather excellent.

    I think I will download your code now...
    The views expressed on this programme are bloody good ones. - Fred Dagg

  5. #5

    Some sorta AI experiment

    Basically what the AI does is "crawl" along a basic ruleset given by the programmer. I add things such as misfourtunes and calamaties and the AI randomly tries things to escape the bad states. It keeps a count of failures and successes, and then rules out the things that fail and weight the rest as being good or not. The skinny is that it learns what not to do and what to do for a given state.

    The -1's you see are "disabled" nodes, they never fire. It takes 5 failures for a node to be deactivated.

    The others are the weights, which is 1/3rd the actual success rate of that node for leaving the state. When picking between successful actions the bot makes a random number that is the sum of all the weights + 1 each weight. The bot then uses that random number as a "slider", so to speak, to choose the right action. For example(refer to the screenshot):
    The sum of "Normal" actions + 1x4 is 22 (-1's aren't factored).
    Let's say the random number is 8.

    The action is Normal_Jump. Here's why.

    The range for Normal_Move is 1..3 (weight + 1), the range for Normal_Jump is 4..12 and so on. So ranked by fitness the bigger the weight, the bigger the chance of the node being picked.

    So if you were to add a state, you'd (with this code specifically) name it and specify the actions that make it possible to escape that state. As I said it was a blind shot for me and I cut many corners, so it's 90% hardcoded in the definitions.

    QUICK FYI: The Bot State shows the current state, not the one that the action was previously based on. So if it says "Hurt" yet it successfully did nothing (weighted -1) then you know that it was in either Normal/Moving, not actually hurt the previous state.

  6. #6

    Some sorta AI experiment

    Just thought of this, but perhaps it's a Variegated Finite State Learning Machine? :lol: Ain't that a mouthful!?

  7. #7

    Some sorta AI experiment

    lookin good

    What about multiple input states?
    your bot could be "moving" and "hurt" at the same time.

  8. #8

    Some sorta AI experiment

    Currently unfactored. However to fix that I would just rank the states importance, with wounded being more important and so the bot would recharge first.

  9. #9
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Some sorta AI experiment

    Very cool. I'm gonna have to browse your code sometime to see how you impliment your NNs. Is it a Feedforward network you are using? Those seem to be most common.

    BTW if anyone is interested in checking out my own AI Unit I made some few years ago, AI Workshop.

    I created it while trying to come up with my own solution to the 'minesweeper' (or ant eating food) problem at AI Junkie in Fupster's Neural Networks tutorial. Another look at Neural Networks, but using Genetic Algorithms.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  10. #10

    Some sorta AI experiment

    Not sure if it even qualifies for a NN right now. I had tried to design one without quite knowing what I was doing. Hard to say exactly what it is, but the closest I've to to an accurate name is a "Variegated Finite State Learning Machine"...?

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
  •