Suara Malaysia
ADVERTISEMENTFly London from Kuala LumpurFly London from Kuala Lumpur
Friday, September 20, 2024
More
    ADVERTISEMENTFly London from Kuala LumpurFly London from Kuala Lumpur
    HomeNewsHeadlinesAlgorithmic adventures: Did you know AI has been making games fun for...

    Algorithmic adventures: Did you know AI has been making games fun for you since the ‘80s?

    -

    Fly AirAsia from Kuala Lumpur

    The other day, I was wandering around the narrow, twisting alleyways of Oxford city playing Pokemon Go when a woman suddenly appeared out of nowhere and asked me, “Do you want to attend a free lecture about AI (artificial intelligence)?” She gestured manically towards a door hidden in the ancient brickwork, presumably leading to a lecture hall and not a secret room where I’d get robbed. “No thanks,” I said. “I’m searching for shiny Skorupis.” We parted ways, having successfully confused one another. I know academics love talking about their research, but that was weird even by Oxford standards. I blame the current trend where every company, entrepreneur, and social media influencer talks about AI like it’s the hottest new tech since, erm, the blockchain? AI has been marketed as this “newly discovered” panacea that can solve all of humanity’s problems, a magical future technology that has finally been made a reality. But you know what? None of this is really new to me, because as gamers, we’ve been playing with some form of AI, at least since the days of Pong. I think there’s some benefit to demystifying AI and actually looking at how this new old tech has consistently been used in video games in a very practical and grounded manner.

    So if you’d follow me through this completely innocent hidden door, I can start my lecture by talking about a game that uses an advanced AI system, a game called… Pac-Man. Pac-Man (originally Puck Man) is an arcade game where you play a yellow circle living in a maze that goes wakka wakka, gobbles up pellets, and runs away from ghosts.

    ‘The Impossible Fortress’ is a tribute to old schoool games such as Pac-Man. You didn’t expect me to be talking about a game from 1980, did you? That’s what you get for following strange people through strange doors! But seriously, this game really implements AI – after all, what do you think drives the ghosts to chase Pac-Man around the maze? There are three parts to the ghosts’ AI, and the first tries to answer an ostensibly simple question that’s way more complicated than it should be: how do I get from Point A to Point B?

    ALSO READ:  Keluarga, rakan Koh tak putus asa pada keadilan

    The process of finding these routes is called “pathfinding”. I’m not sure which pathfinding algorithm Pac-Man’s ghosts use, but if you’re interested in the nitty-gritty of how video game characters move throughout their worlds, do read up on Dijkstra’s algorithm or the A* algorithm. This is one way to view AI: simply as complex problem-solving programs. (By the way, if some AI company tries to sell you the fact that it has the “best algorithms” to solve world hunger, find love or whatever, know that an algorithm is just a bunch of instructions. An apple pie recipe is arguably an algorithm for turning apples into pies.)

    The second part of the ghosts’ AI is the specific “NPC behaviour” – or, in other words, how were the ghosts programmed to interact with the human player? How are they designed to act in the game world so as to give the player a challenge without being unfair? There are four ghosts: Blinky (red), Pinky (pink), Inky (blue) and Clyde (orange), with each one behaving differently. Blinky, for example, is programmed to find the shortest route to the player’s current position (essentially, this means the red ghost chases Pac-Man). Pinky, meanwhile, is programmed to move to a position that’s four “tiles” ahead in the player’s current direction (this means that the pink ghost tries to “intercept” Pac-Man). Combined, these ghosts act as if they’re working as a team, performing pincer movements to ambush the player and cutting off escapes.

    This form of dynamic decision-making is what gamers usually think of when they think about “AI in games”: the ability for the computer to simulate the behaviour of thinking beings. In other words, we can view AI as virtual “people”. At the time of writing, there’s no such thing as actually intelligent machines – nobody has created an Artificial General Intelligence (AGI) that thinks like an actual human. Or even a moderately smart orangutan. But as video games have shown, existing AI can be very good at making you think they’re smarter than they are.

    ALSO READ:  Does flirting with AI count as cheating?

    An FSM is just one way of imagining data, where each “thing” exists in specific states that change given specific input. For example, Shaun the Human has two states: Hungry and Full. In my Hungry state, if you input a cheeseburger (via the mouth, please), my state will change to Full. This will be relevant when we talk about the third part of the ghost’s AI, which has everything to do with the dynamic difficulty of the game and, by extension, the overall player experience of actually playing the game.

    The ghosts in Pac-Man have three states: in the default Chase state, every ghost will try to chase or intercept the player. But every once in a while, the ghosts will temporarily enter the Scatter state, where they’ll stop hunting the player. Finally, in the Frightened state, every ghost flees from the player, who has just eaten one of those big “energiser” pellets. How long the Chase, Scatter, and Frightened states last has a direct impact on how difficult the game feels. Have frequent Chase states, and players will feel the pressure of being hunted by the ghosts. Conversely, longer Scatter or Frightened states will give players more time to breathe.

    This is another way of viewing AI: as a system that intelligently reacts to player input, acting as a game director or Dungeon Master whose job it is to make the game challenging enough to be fun but not so difficult as to be impossible.

    If you look around the Internet – or at least the random weird ads that keep popping up on my X/Twitter timeline – you’ll often find AI enthusiasts talking about how ChatGPT is the greatest thing ever, as it can write your emails, finish your homework, or make stock predictions. Or they’d hype up the “artistic prowess” of Midjourney. The marketing makes it sound like the newest way to view AI is as “personal…

    Wan
    Wan
    Dedicated wordsmith and passionate storyteller, on a mission to captivate minds and ignite imaginations.

    Related articles

    Follow Us

    20,248FansLike
    1,158FollowersFollow
    1,051FollowersFollow
    1,251FollowersFollow
    ADVERTISEMENTFly London from Kuala Lumpur

    Subscribe to Newsletter

    To be updated with all the latest news, offers and special announcements.

    Latest posts