AI is revolutionizing aspects of the gaming industry and making games more realistic and lifelike
Imagine video game characters who don’t just follow pre-programmed routines, but react and adapt to your choices. This is the power of artificial intelligence (AI) in gaming. AI breathes life into non-playable characters (NPCs) by giving them the ability to make decisions, strategize, and even learn from their encounters with the player. It’s like giving NPCs a virtual mind, making the game world feel more immersive and the challenges more dynamic.
AI has been used in games for many years, and a notable example is the chess match between chess champion Garry Kasparov and IBM AI-powered computer Deep Blue in 1997. During this grueling 9-day game, Garry competed against Deep Blue, eventually conceding and passing on the victory to the computer.
Since the computer’s win, AI has revolutionized other aspects of the gaming industry, making games more realistic and lifelike. Generative AI has also been utilized to create game assets like background scenery or updating new game levels.
Although they don’t use generative or modern AI, the four ghosts in Namco’s Pacman are each programmed to simulate intelligent behaviors. The game’s designer, Toru Iwatani, wanted each ghost to behave differently. To do this, each ghost calculates a different target, relative to Pacman’s position and other rules ghosts must follow. This programmed artificial intelligence relies on the state of the ghosts and the player’s choices throughout the game.
As generative AI systems improve, it’s likely that non-player characters will simulate more realistic behaviors, like adjusting movements and behaviors by learning and predicting player behaviors.
To get students to apply computational thinking skills, teachers can use programmed AI behaviors in video games to analyze the flow of code. This simple exercise can be done with any programming language or simply pseudocode. Let’s take a look at this gameplay from Nintendo’s Super Mario Bros.
The Goombas, or mushroom-shaped enemy characters, move from side-to-side until they collide with a pipe or object. There are some if-statements in there too, but let’s try and break down the programmed AI behaviors of these enemies in pseudocode.
Using programmed AI behaviors, students can break down the movements and actions of NPCs using computational thinking skills like decomposition, algorithmic thinking, pattern recognition, and abstraction. Look for some basic gameplay video clips online, single out one or two NPCs, and guide students through breaking down the AI behaviors in pseudocode or a flowchart.
CodeHS offers a full suite of AI resources, including updated AI courses, new projects in the CodeHS Project Catalog, and professional development workshops and courses focused on deepening understanding of AI. Check out this project to help students explore AI in Games!
Interested in learning more about how to unleash the power of AI in your school or district? Request more information here or reach out to hello@codehs.com.
By CodeHS on July 15, 2024.