---
title: "AI in Computer Games"
description: "How computer opponents choose game actions using fixed rules, move search or learning from examples; difficulty adjustment and level generation; why changed behavior alone does not prove learning"
canonical: https://lightmysky.com/learn/computing/ai-in-computer-games-mt_fT4G0QloX5
source: https://lightmysky.com/learn/computing/ai-in-computer-games-mt_fT4G0QloX5.md
retrieved: 2026-10-19
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# AI in Computer Games

How computer opponents choose game actions using fixed rules, move search or learning from examples; difficulty adjustment and level generation; why changed behavior alone does not prove learning

Subject: Computing · Area: Artificial Intelligence · Ages 7 to 9
Page: https://lightmysky.com/learn/computing/ai-in-computer-games-mt_fT4G0QloX5

## Ready when they can

- Explain how instructions help a computer opponent choose an action
- Distinguish fixed rules from learning from examples, and explain why changed behavior alone does not prove learning
- Describe difficulty adjustment and explain why a new level layout alone does not prove that AI generated it

## Lesson: How game characters 'decide' what to do

You have learned that computers follow instructions. Game AI, short for artificial intelligence, is software that chooses actions for computer opponents. A game-controlled character is often called an NPC, or non-player character. People write the software that makes its choices.

**Example.** A guard follows this fixed rule: if the player is in sight, chase; otherwise, patrol. Its action changes when the player comes into view, but its rule stays the same. A changed action does not prove that the guard learned.

*(drawing: Match each situation to its action. The guard follows the same rule in both situations.)*

Learning AI uses examples to learn patterns. Some game systems learn before play starts; others can learn during play. People write the learning software. A chess program can also compare possible moves using its existing software, without learning from its opponent during that game.

A fixed rule can adjust difficulty: after three wins, choose a harder track. Some games also use AI tools to create levels. Other games create layouts with rules and chance. Seeing a new layout alone does not tell you which method made it.

*(drawing: This rule changes the challenge without learning a new rule.)*

Game AI can use rules, compare possible moves or learn patterns. A prediction is a guess about what could happen next. Past moves can provide clues, but they do not guarantee your next move. The game's software also decides what information its computer opponent can use.

**Recap.** Game AI uses software to choose actions. Changing an action, adjusting difficulty or making a new layout does not by itself prove learning.

## Practice

8 questions on this page, each with its working shown.

## Needs first

- [Step-by-Step Instructions](https://lightmysky.com/learn/computing/step-by-step-instructions-mt__p5n8z5soJ)
- [Patterns and Classification](https://lightmysky.com/learn/computing/patterns-and-classification-mt_ofOGCQ7FWj)

## Opens up

- [Events: Programs That React to What the User Does](https://lightmysky.com/learn/computing/events-programs-that-react-to-what-the-user-does-mt_HFtGUhZHz4)
