[m-users.] Mercury for Game AI

David Epstein davideps at umich.edu
Sun Jan 23 22:32:30 AEDT 2022


For me, the attraction of Prolog (and perhaps of Mercury) for game AI is
resolution via unification over a complex set of rules and facts. For
example, say bob is a person who is hiding. If he stops hiding, he will
become vulnerable:

person(bob)
hiding(bob)
vulnerable(Person) :- not(hiding(Person))

I could accomplish this with lists or dictionaries in C# to represent
people, hiding people, vulnerable people, etc and maintain validity by
checking who is hiding and changing who is vulnerable. But, Prolog (and
perhaps Mercury) can do all that automatically if I just query
vulnerable(bob). Furthermore, the system can explain to me why he is
vulnerable (because he is not hiding) or not vulnerable (because he is
hiding). *Julien*, in the fruitbowl example, I'm worried that we lose this
functionality because the predicates have become just values in a map. If
there were further rules about fruits, would those rules still work? *M.
McDonough*, could you explain how you change game state while avoiding
changing Mercury predicate definitions? Did relying on data structures like
lists and maps still permit you to leverage traditional logic programming
approaches?

-david
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20220123/fac0e2b2/attachment.html>


More information about the users mailing list