Results 1 to 5 of 5

Thread: Simple AI?

  1. #1
    Atriamax is offline Member
    Join Date
    Sep 2009
    Posts
    41
    Rep Power
    0

    Default Simple AI?

    I created a game like TRON, (ok, the same game just in java) but i have no idea how to program AI into it. Its just like the original tron, you just have to avoid running into the walls that are created behind each player. I just want to create a simple AI to play against.
    I really dont know how to approach this. The only thing i can really think of is a huge load of if statements (lol) but i know that wont work.
    any tips?

  2. #2
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    7

    Default

    I've created a modern version of a game called Digger in Java. There's a Wikipedia article on it. It's also a maze game similar to TRON, assuming this is the subgame you want to implement.

    For my game, I used a two dimensional array of cells, which you define according to the needs of the game. Then, I did my scene drawings based in this matrix. In addition, I had actors. Such actors, like the player, baddies or collectibles moved about my matrix by linear interpolation and responded to collisions according to the defined AI. Programming actor AI from here is simple. I had a huge switch for actor interactions and actions. Now, Java is OO, so you can do better, but the switch is simpler. Besides, if your not planning to rescale the game, then don't overkill. ;)

    Good luck and ask if you think I can help. :D
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

  3. #3
    Atriamax is offline Member
    Join Date
    Sep 2009
    Posts
    41
    Rep Power
    0

    Default

    I just dont know how to approach it code wise, It has to be a combination of random movement, and reaction based movement. I could try a switch but i feel like with a game like this it will make the ai too perfect.
    Ill try it, I was just searching for a better way.

  4. #4
    gcampton Guest

    Default

    You could add a increasing randomness to the switch the more random the easier the game obviously, with hard mode being virtually no randomness.

    Just to compensate for the perfectness of the actor acting out the switch.
    eg. easy mode it would take the right path every 10 moves, 11th move could be a random switch, which may also be the right move, but it may also be the wrong move. and for medium mode, just scale this to every 25 moves, and for hardmode over 50 or so.

  5. #5
    Atriamax is offline Member
    Join Date
    Sep 2009
    Posts
    41
    Rep Power
    0

Similar Threads

  1. New simple application using a simple database
    By webbusiness23 in forum New To Java
    Replies: 9
    Last Post: 08-03-2009, 02:55 AM
  2. Simple Help....
    By jpnym15 in forum New To Java
    Replies: 1
    Last Post: 11-11-2008, 02:33 PM
  3. Replies: 2
    Last Post: 05-04-2008, 05:27 PM
  4. Simple timer
    By im-not-alive in forum New To Java
    Replies: 1
    Last Post: 01-20-2008, 09:04 PM
  5. simple GUI
    By dim_ath in forum New To Java
    Replies: 3
    Last Post: 01-07-2008, 03:00 PM

Posting Permissions

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