Ever play a game where the computer fights back? Where it seems SMART? That's AI! Today we learn about game AI! ๐ฎ
NPC = Non-Player Character. These are the characters in games that aren't controlled by YOU. They're controlled by AI! ๐ค
Remember Scratch? We programmed everything! Let's compare:
WE told the sprite EXACTLY what to do:
The sprite does EXACTLY what we programmed. Nothing more, nothing less. ๐ค
AI DECIDES what to do based on what YOU do:
The AI THINKS and REACTS to what you do! ๐ง โจ
Computer cars try to win! They learn your strategy!
Computer players defend and attack smartly!
Enemies react to YOUR moves!
Zombies hunt you down!
Computer thinks many moves ahead!
Citizens act on their own!
Let's trace how a game AI makes a decision:
๐๏ธ AI looks at the game and sees WHERE YOU ARE
๐ง AI decides what STRATEGY to use
๐ฏ AI picks the BEST move (attack, defend, run, etc.)
โ๏ธ AI moves, attacks, or does something IN THE GAME
The smarter games learn patterns from how YOU play!
So next time, AI uses what it learned!
Example: "Player always jumps left... so I'll attack LEFT this time!" โ๏ธโจ
Games have different AI difficulty levels:
Makes dumb mistakes ๐คช
Slow reactions โธ๏ธ
Easier to beat โ
Smart but fair ๐ง
Good reactions โก
Good challenge! ๐ฏ
Almost impossible ๐ฑ
Super fast reactions โกโก
Very hard to beat โ
Let's identify which games use AI opponents!
Which ones do YOU think have AI? Why? ๐ค
Next time you play a game with an opponent...
Remember: That computer AI is THINKING and REACTING to what YOU do! ๐ง ๐ฎ
Next Session: Smart Predictions โ Autocorrect and autocomplete! โจ๏ธ