artificial intelligence simulating the otherauthor jari komppa created date 1/24/2011 10:58:29 am

17
Practical Game Programming Copyright 2010 Jari Komppa - http://iki.fi/sol/ Artificial Intelligence Simulating The Other

Upload: others

Post on 16-Aug-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Artificial Intelligence Simulating The OtherAuthor Jari Komppa Created Date 1/24/2011 10:58:29 AM

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.