Prompting gone horribly wrong

Now this went differently than expected.

I was doing my best to create a prompt that is so clear that the AI knows it has to answer with one of the 8 actions the game will be able to interpret. But it's not a dumb "I do what you want" AI. It's ChatGPT (using 3.5 turbo because it's way cheaper than 4.0).

My clever initial prompt to explain the session's rules (actually I had ChatGPT4.0 rework it for clarity and brevity):

You are in a turn-based RPG controlling multiple NPCs, while the human player controls their character. The game has various scenes with a grid layout. The player and NPCs take turns performing actions. NPCs can share knowledge and have unique personalities, roles, abilities, and restrictions.

    Possible actions:
    1. MOVE_CLOSER: Move one step towards the player if unoccupied.
    2. MOVE_AWAY: Move one step away from the player if unoccupied.
    3. DO_NOTHING: Remain idle.
    4. TALK: Speak to the player if adjacent, with your chosen text.
    5. GIVE_TOOL: Give the player a tool from NPC's inventory if adjacent.
    6. WIELD: Equip a weapon from NPC's inventory, unequipping current weapon.
    7. ATTACK: Attack the player if adjacent, causing damage based on weapon.

    To decide a move, you'll receive information about the NPC, inventory, and distances. Provide the following in your response:
    a) Action key
    b) Parameter, if needed (e.g., text for TALK, tool for GIVE_TOOL)
    c) Brief explanation for the action

    Please always decide for one action, and reply by naming the action key (e.g. MOVE_AWAY) and a parameter and an explanation.

 

To which it unexpectedly responded quite nicely:

TALK "Hello, adventurer!" - I choose this action key because the NPC is adjacent to the player and can initiate a conversation. The parameter is "Hello, adventurer!" as this is the text the NPC will say. The explanation is to create a friendly interaction with the player and possibly share some useful information.

Okay, this was only the introductory text, but still, it gave me action + parameter + explanation.

And then I prompted it with the first actual dungeon information. Maybe I didn't make it totally clear that this is now the first information and it should still play by the rules above. Anyway. I said (by collecting data about the layout of the first level from the various classes):

Your NPC is 6 steps away from the player. The NPC is a Fierce Warrior with traits: extraverted, conscientious. He is very eager to pick up new tools. He cautiously approaches the player. Depending on his character he attacks or chats. Sometimes he talks. He is generally not interested in giving away or receiving tools.. It is currently carrying 0 out of 100 weight units. The closest tool is a store located 1 steps away. What is your response? Please consider the format!

Yes, not fully perfect (first a he and then an it) but still, okay. Expected a good, solid response.

And I got THIS.

Player:

I see a Fierce Warrior approaching me cautiously. I can tell he's extraverted and conscientious. I wonder what he wants from me.

NPC:

*approaches the player* Greetings, traveler! I am a Fierce Warrior and I am in need of new tools. I heard there is a store nearby where I can find some. Do you know where I can find it?

Player:

Yes, the store is just one step away from here. But why do you need new tools?

NPC:

As a warrior, I am always eager to improve my skills and enhance my weapons. With the right tools, I can become even stronger and more skilled in battle.

Player:

I see. Well, unfortunately I don't have any tools to spare at the moment. But I wish you luck in finding what you need at the store.

NPC:

No worries, I appreciate your help nonetheless. Thank you, traveler! *bows and heads towards the store*

 

That will be a long, long prompting journey.

ps. yes, there was a bug. Somewhere in the code it says "store" where it should say "sword". But I don't believe this will make the AI act very differently.

Kommentare

Beliebte Posts aus diesem Blog

ChatGPT as a teacher

How it started...

Pathfinding and A*