artificial intelligence simulating the otherauthor jari komppa created date 1/24/2011 10:58:29 am
TRANSCRIPT
![Page 1: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/1.jpg)
Practical Game Programming
Copyright 2010 Jari Komppa - http://iki.fi/sol/
Artificial Intelligence
Simulating The Other
![Page 2: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/2.jpg)
Artificial intelligence
Copyright 2010 Jari Komppa - http://iki.fi/sol/
● There's no real intelligence, just a bunch of techniques. Sorry.
● Even the most advanced techniques are just tools.
● More complexity means more stuff to debug.
● Most important thing: fun > realism
![Page 3: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/3.jpg)
Artificial intelligence
Copyright 2010 Jari Komppa - http://iki.fi/sol/
● What is a good AI?● Perfect? (racing, tic-tac-toe..)● Challenging? (chess)● Non-cheating? (civilization)
..or perhaps, you know, it should just be fun?
![Page 4: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/4.jpg)
Artificial intelligence
Copyright 2010 Jari Komppa - http://iki.fi/sol/
● How would you play?● Or better yet, how would a good player play?
● Can you define it as an algorithm?
● Would this be a fun opponent?● What can you do to make it so?
![Page 5: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/5.jpg)
Ai tools: random
Copyright 2010 Jari Komppa - http://iki.fi/sol/
● Random is your friend.● Replayability.● Unpredictability.
● Random is not your friend.● Humans can detect patterns, even random ones.
– Random can be boring.● Non-determinism can make debugging harder.● Randomness may not turn out to be fun.
![Page 6: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/6.jpg)
Ai tools: random
Copyright 2010 Jari Komppa - http://iki.fi/sol/
● "The generation of random numbers is too important to be left to chance"
-- Robert R. Coveyou
● Many pseudorandom number generators are of poor quality (esp. C std lib ones)
● Better ones: Mersenne Twister, WELLhttp://en.wikipedia.org/wiki/Well_Equidistributed_Long-period_Linear
![Page 7: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/7.jpg)
Ai tools: state machines
Copyright 2010 Jari Komppa - http://iki.fi/sol/
● State machines are extremely usable.
● Example; "Thief" AI● Idle● "Heard something"● "I saw you"● Attack● "I guess it was nothing" / "Must have run away"
![Page 8: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/8.jpg)
Ai tools: advanced stuff
Copyright 2010 Jari Komppa - http://iki.fi/sol/
● Fuzzy logic, genetic algorithms, neural nets.● Can simulate more complicated intelligence.
– Learning.– Adapting.
● Generally harder to tweak to be fun.● Usually can be avoided, achieving the same goals
with more deterministic methods.
![Page 9: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/9.jpg)
Pathfinding - a*
Copyright 2010 Jari Komppa - http://iki.fi/sol/
● Fill graph (or grid) nodes.● Starting from point A.● Always filling nodes that are "closest" to target.● When B is reached, travel back using the cheapest
route.
● Common, but not necessarily the best option.
![Page 10: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/10.jpg)
Examples
Copyright 2010 Jari Komppa - http://iki.fi/sol/
![Page 11: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/11.jpg)
Examples
Copyright 2010 Jari Komppa - http://iki.fi/sol/
![Page 12: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/12.jpg)
Examples
Copyright 2010 Jari Komppa - http://iki.fi/sol/
![Page 13: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/13.jpg)
Examples
Copyright 2010 Jari Komppa - http://iki.fi/sol/
![Page 14: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/14.jpg)
Examples
Copyright 2010 Jari Komppa - http://iki.fi/sol/
![Page 15: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/15.jpg)
Examples
Copyright 2010 Jari Komppa - http://iki.fi/sol/
![Page 16: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/16.jpg)
Examples
Copyright 2010 Jari Komppa - http://iki.fi/sol/
![Page 17: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM](https://reader035.vdocuments.site/reader035/viewer/2022071604/614084272e263e64232a1d1f/html5/thumbnails/17.jpg)
homework
Copyright 2010 Jari Komppa - http://iki.fi/sol/
● Create an AI algorithm that plays poker.● Algorithm should consist of several pairs of:
● WHEN (description of situation)● DO (what)
● http://en.wikipedia.org/wiki/List_of_poker_hands● http://en.wikipedia.org/wiki/Poker#Gameplay
● Regular poker, not a variant, thanks.