ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

NPC Task Library

This forum is the place to learn about and discuss ADRIFT 5. Feel free to mention any bugs you find here, but please also add these to the Bugs & Enhancements list.

Please also refer to the ADRIFT 5 Wiki for more information.

NPC Task Library

Postby ElliotM » Mon Aug 06, 2012 12:07 am

I've just finished a conversion of most of the standard library into tasks usable by NPCs. The syntax is generally "'character name', command". Also, these should be useful for being called from Actions within Character conversation topics because these npc tasks accept a character parameter, whereas the player centric versions in the standard library do not.

Currently implemented: Attacking, Character Movement, Character Position, Eat and Drink, Give, Take and Drop Objects, Look and Examine, Open and Close Objects, Push and Pull, and Wear and Remove.

On the list to be implemented: Conversation (right now I just have one task in there, which I will explain later).

Still to do: Testing (there might be some mistakes), dealing with one potential priority conflict, and editing the amf export to exclude the standard library (so no duplicates).

For now I will upload that TAF version while I start editing the exported amf by hand. :|

If you'd like to make some tests, download the taf and start adding locations, characters, etc. to it.
Attachments
NPC Task Library.taf
Taf version, corrects priority conflict
(17.11 KiB) Downloaded 28 times
ElliotM
 
Posts: 507
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA

Re: NPC Task Library

Postby ElliotM » Mon Aug 06, 2012 1:45 am

The heart to controlling this library might be the settings on the task "Character, Comment" in the Conversation folder. Because it matches to "%character%{,} %text%" and has a higher priority than all of the other npc tasks, it will always execute first.

Right now I have match multiple turned on, so it will be easier to test things, but I'm considering turning multiple matching on that task off because I'm still thinking about what the best way would be to get these to play nicely with conversation topics and actions. If multiple matching is off, then none of the NPC tasks will run unless they are called from a conversation topic action or some other task. For an actual game, this could save the author a lot of work, so they wouldn't have to make so many overrides for the tasks they're not using in their game.
ElliotM
 
Posts: 507
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA

Re: NPC Task Library

Postby saabie » Mon Aug 06, 2012 2:34 am

i would have made "Character, Comment" the lowest priority so you dont get messages like "Fred ignores you. He opens the large cupboard." due to the conversation system trying to run first and givng a message when it fails to find a match.
That way "%character%{,} %text%" will only match if none of the commands can be matched to the user input.

I also noticed that you can tell an NPC to do something when the player is nowhere near that location.
You may want to check that the NPC is in the same location as the player (or that they are talking over a telephone at the time)
saabie
 
Posts: 304
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia

Re: NPC Task Library

Postby ElliotM » Mon Aug 06, 2012 3:17 am

Thanks for taking a look at this, Saabie. The ignore output is showing up because I left multiple matching turned on for the "Character, Comment" task.

I'm still thinking about the best way this library could be used, but I also want to make sure authors can use it how they want. Here are my thoughts at the moment:

Option 1: Leave "Character, Comment" as highest priority, but turn multiple matching off.
  • NPC behavior could be controlled through conversation topics
  • Custom task output possible though topic text output, but might be more difficult to control.
This would require that each npc have conversation topics of type general command that match the syntax of commands the author wants to allow for that npc. This means that the NPC tasks will only run when called by conversation topics, and would also mean that the player would need to be in conversation with the npc for any of these commands to work, so no further changes required.

Option 2: Change "Character, Comment" to lowest priority and turn multiple matching off.
  • The default ignore case would only catch player input unmatched by any task or topic.
  • Controlling npc behavior and task text output would likely be dependent on Specific Tasks
  • Would need new restrictions added to all of the tasks to make sure the npc and player were in conversation with each other somehow.
ElliotM
 
Posts: 507
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA

Re: NPC Task Library

Postby saabie » Mon Aug 06, 2012 3:24 am

Option 2 would probably also need an NPC "friend of player" property that decides whether a particular NPC will do as the player asks.
saabie
 
Posts: 304
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia

Re: NPC Task Library

Postby ElliotM » Mon Aug 06, 2012 4:11 am

I would agree, authors would likely need some kind of "friend of player" property or maybe a sliding scale of "subservient to dominant" to model their relation to the player character.
ElliotM
 
Posts: 507
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA

Re: NPC Task Library

Postby Campbell » Mon Jan 07, 2013 10:16 pm

How did you get on with the AMF version of this ElliotM? This is a great addition - I must have missed this thread earlier.
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 3852
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland

Re: NPC Task Library

Postby ElliotM » Tue Jan 08, 2013 3:54 am

Not sure how far I got, I probably decided to wait for proper AMF export, because at the time there were key conflicts. I'll see what I have going when I have a moment, as I believe we got that fixed recently.
ElliotM
 
Posts: 507
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA

Re: NPC Task Library

Postby Campbell » Tue Jan 08, 2013 8:46 am

I have taken the liberty of converting your TAF to an AMF file so it can be used as a library. I haven't tested this extensively, so you might want to do so, but I thought it might assist you in creating a finished version.

For some reason the forum isn't letting me upload the AMF file, so I have had to ZIP it up.
Attachments
NPC Task Library.zip
(8.18 KiB) Downloaded 15 times
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 3852
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland


Return to ADRIFT 5.0

Who is online

Users browsing this forum: NickyDude and 3 guests