Page 1 of 2

Representing Game Dialogue as Expressions inFirst-Order Logic

Posted: 14 Apr 2019, 11:34
by sirherrbatka
So I found this article https://ir.lib.uwo.ca/cgi/viewcontent.c ... ontext=etd and after thinking about it starts to look very interesting to me, especially for an open world game with procedural generation involved.

Prolog-style world description allows establishing relations between places, events, organizations, and characters in such a way that dialogues and behaviors of characters are more susceptible to change in reaction to the player actions. I am finding this idea very intriguing.

Re: Representing Game Dialogue as Expressions inFirst-Order Logic

Posted: 14 Apr 2019, 17:51
by raevol
I'll have to read this later, but I am very interested, especially with the computational linguistics class I am taking this semester.

Re: Representing Game Dialogue as Expressions inFirst-Order Logic

Posted: 14 Apr 2019, 18:47
by sirherrbatka
Yeah, I am actually going through "The Art of Prolog" currently. Logic programming seems to be one of the most underused programming techniques in existence.

Re: Representing Game Dialogue as Expressions inFirst-Order Logic

Posted: 19 May 2019, 09:59
by raevol
Finally got around to reading this. I feel like the particular courses I chose to take in my schooling where bizarrely specific to prepare me to understand this paper...

Anyway, it's pretty cool. It definitely adds a huge amount of background work to get a system like this running, but I can see how it would make dialog in games much more interesting and rewarding.

Re: Representing Game Dialogue as Expressions inFirst-Order Logic

Posted: 23 May 2019, 17:16
by sirherrbatka
Yes, indeed. I was thinking about this lately and came to some conclusions. For instance, Morrowind (but not only) characters fell unrealistic partly because they don't seem to have any personal connections. If you happen to be on the main quest and they happen to be temple members they will not like you, but all world seems to be very shallow in terms of game mechanics. Barely anything changes, really. I really think that logic programming could be potentially used to reduce this issue and not only that but do this in an extendable way. For instance, modder could add new stuff into the database and modify how the existing (or not yet existing) queries work. This could be huge.

Also, building a reasonably efficient prolog engine is not as complex as it may appear. WAM is daunting; yes, but there are other interpreters that are much simpler. I found an article that describes 2000 java LOC logic interpreter. This would be IMHO a good starting point.

Re: Representing Game Dialogue as Expressions inFirst-Order Logic

Posted: 01 Aug 2019, 17:32
by sirherrbatka
Ok, so I took a shoot at implementing basic prolog interpreter myself. It took a bit to wrap my head around it, but it was kinda fun. Currently, I am doing some rudimentary optimizations (copy loop unrolling is next on the menu). If anyone is interested, here is the link:
https://github.com/sirherrbatka/huginn

Re: Representing Game Dialogue as Expressions inFirst-Order Logic

Posted: 01 Aug 2019, 21:43
by raevol
sirherrbatka wrote:
01 Aug 2019, 17:32
I took a shoot at implementing basic prolog interpreter myself
Yeow! You are a brave man!

Re: Representing Game Dialogue as Expressions inFirst-Order Logic

Posted: 02 Aug 2019, 16:55
by sirherrbatka
I have a habit to take tasks just out of my reach ever since OpenMW. It works very much in my favor when it comes to learning stuff.

Re: Representing Game Dialogue as Expressions inFirst-Order Logic

Posted: 03 Aug 2019, 05:23
by raevol
That's a smart way to do it!

Re: Representing Game Dialogue as Expressions inFirst-Order Logic

Posted: 03 Aug 2019, 20:00
by sirherrbatka
Unfortunately, my implementation right now is just as slow as the paiprolog. I honestly hoped for something better but I will keep working on it.