[m-users.] Mercury for Game AI
David Epstein
davideps at umich.edu
Thu Jan 20 02:55:19 AEDT 2022
Thanks Tomas!
>>> % Define network for navigation
> >>> connected(salon,hallway)
> >>> connected(bedroom,hallway)
> >>> connected(X,Y) :- connected(Y,X)
>
> >This looks fine, except for the rule. Just duplicate the links.
>
Is the rule approach actually wrong (won't work) or just slower (an extra
step) ?
>>> % Assign character status
> >>> dead(dan)
>
> >Depends... but probably not like that. You could have a set of dead
> >people, or a map from people to status, or something else.
>
Yes, I use a lot of dictionaries in Python. However, I thought the
predicate approach was more native to Mercury/Prolog, no?
> >>> % Define some past events (things that actually occurred, regardless
> if anyone saw them)
> >>> attack(bob,dan,bedroom)
>
> >No this needs to be some more complicated data structure. First of all
> >you probably need time points, and then a map from them to events, or
> >to sets of events.
>
Ok, I'll add an integer for time (seconds or turn number). If I want to
express both:
eventA = attack(bob,dan,bedroom,1)
eventB = heard(carl,eventA,1)
Would I want a graph data structure? This looks a bit like RDF.
>>> Parsing and Generating Dialogue
> >>> The GUI will offer the user a set of words that can be translated
> >>> into a Mercury query, for example "What did you hear" asked to bob,
> >>> would become "heard(bob,X)."
>
> >Would become, eh. Nice bit of hand-waving?
>
Yup. You noticed.
>| write_sentence(Data) :-
> >| write_subject(Data),
> >| write_predicate(Data).
>
Thanks again!
-david
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20220119/cf6999cf/attachment.html>
More information about the users
mailing list