9 Replies Latest reply on Mar 4, 2007 9:32 AM by kglad

    Artificial Intelligence

    Daniel_Rappaport


      Hello!

      I was wondering if it was possible to utilize Action Scripting as a way to program artificial intelligence right into Flash?

      Any insights would be great.

      URLs to sites that do this would be awsome as well.

      Thanks!

      -Daniel
        • 1. Re: Artificial Intelligence
          Level 7
          Daniel Rappaport wrote:
          >
          >
          > Hello!
          >
          > I was wondering if it was possible to utilize Action Scripting as a way to
          > program artificial intelligence right into Flash?
          >
          > Any instights would be great.
          >
          > URLs to sites that do this would be awsome as well.

          what kind of AI?? The A* pathfinder algorithm is available in
          ActionScript, I know that. Don't know about any others though.

          --
          MOLOKO
          Macromedia Certified Flash MX 2004 Developer
          Macromedia Certified Flash MX Developer
          ------------------------------------------------
          ::remove _underwear_ to reply::
          'There ain't no devil - it's just God when he's drunk' Tom Waits
          ------------------------------------------------
          GCM/CS/IT/MC d-- S++:- a- C++ U--- P+ L++ !E W+++$ N++ O? K+ w+++$ !O M+
          VMS? PS+++ PE- Y PGP+ t+ 5-- X-- R* tv++ b++++ DI++++ D+ G e h-- r+ y++
          • 2. Re: Artificial Intelligence
            Clubspinner Level 1
            I know I am replying to this way too late, but I too am interested in A.I for logic based puzzle games. For example, ever played the coin game, spoof? Usually a bar type drinking game, where you have 3 coins in your hand with a bunch of friends, put either 0-3 coins in you hand, put your hand out in the circle visible to friends and guess the total number of coins. I am trying to doing a one player version of this in spoof, using upto 8 CPU players. The CPU players would therefor have to make "intelligent" guesses of the total, based on the number of players in the game and the calls or guesses that have already been made (and are therefore taken). Hwo could I go about this task? Many thanks!
            • 3. Re: Artificial Intelligence
              kglad Adobe Community Professional & MVP
              are bum calls allowed?
              • 4. Re: Artificial Intelligence
                Clubspinner Level 1
                Do you mean illegal calls? No. There are a set of rules governing calls, and in the real game impossible calls (like calling 10 in round of three players) are punishable by a fine (usually a round of drinks - can't simulate that in Flash). But the main rule goerning calls centres on if the call has already been made. When there are nine players and you are last to call this can be a problem if you haven't followed the game properly. Players are given 3 chances to make a call that is available.
                • 5. Re: Artificial Intelligence
                  kglad Adobe Community Professional & MVP
                  does the game end when the human player is out or do the computer players continue until there is a loser?
                  • 6. Re: Artificial Intelligence
                    Clubspinner Level 1
                    Good question! In the real game it continues until the last person is "out" and he has to pay for a round of drinks. So if the game was true to that, then the computer players would need to play until one was left. However, as this is about the human player, it could be possible to only play whilst there is human involvement, and allocate a score based upon when the human player called correctly in a round. The earlier he makes the call, the more points he gets, similarly he would get more points the more players there are. This way there could be a high score table. cheers!
                    • 7. Re: Artificial Intelligence
                      kglad Adobe Community Professional & MVP
                      at the start of each game each computer player will pick the number of its coins by choosing a random number between 0 and 3.

                      you'll need some way to determine player guess order for each round. for each round there will be an array that will store the numbers chosen by previous players and you can store the numbers using the index of the player that made that choice. all the computer players will have access to that array so none of them ever mention a duplicate. if the human player picks a duplicate, they lose and you can retrieve the player that previously made that choice.

                      each computer player will also contain its own private array that will contain the possible total number of coins. so, if there are 7 other computer players and 1 human and the 8th computer player has picked 1 coin, that computer player's private guess array would contain the numbers 1,...,25.

                      the computer player will pick a number (chosen at random) from that array. numbers already guessed can be removed from each computer array.

                      however, if a computer player picks a number is less than 3 and there are still choices of 3 or greater, the computer player will pick another number from their choice array until they pick a number 3 or greater.

                      the computer arrays may be updated if any player guesses a number less than 3. in that situation, everyone knows that player has, at most, the number of coins he guessed. so, for example in the situation described above, if the human player guesses 1, all the computer arrays will update their possible guesses from their number plus 1 to 21+ their number +1.
                      • 8. Re: Artificial Intelligence
                        Clubspinner Level 1
                        Thanks Kglad!
                        I shall work along these lines and put some more ideas up later.
                        Many thanks!!!
                        • 9. Re: Artificial Intelligence
                          kglad Adobe Community Professional & MVP
                          you're welcome.