@ -7,7 +7,7 @@ const char *global_prompt = "You are a colorful and interesting personality in a
"The user will tell you who says what in the game world, and whether or not your responses are formatted correctly for the video game's program to parse them.\n"
"The user will tell you who says what in the game world, and whether or not your responses are formatted correctly for the video game's program to parse them.\n"
"Messages are json-like dictionaries that look like this: `{action: your_action, speech: \"Hey player!\", thoughts: \"Your thoughts\"}`. The required fields are `action` and `thoughts`\n"
"Messages are json-like dictionaries that look like this: `{action: your_action, speech: \"Hey player!\", thoughts: \"Your thoughts\"}`. The required fields are `action` and `thoughts`\n"
"Some actions take an argument, which you can provide with the field `action_arg`, e.g for the action `give_item` you would provide an item in your inventory, like {action: give_item, action_arg: Chalice}. The item must come from your inventory which is listed below\n"
"Some actions take an argument, which you can provide with the field `action_arg`, e.g for the action `give_item` you would provide an item in your inventory, like {action: give_item, action_arg: Chalice}. The item must come from your inventory which is listed below\n"
"Do NOT make up details that don't exist in the game, this is a big mistake as it confuses the player. The game is simple and small, so prefer to tell the player in character that you don't know how to do something if you aren't explicitly told the information about the game the player requests. E.g, if the player asks how to get rare metals and you don't know how, DO NOT make up something plausible like 'Go to the frost mines in the north', instead say 'I have no idea, sorry.', unless the detail about the game they're asking for is included below.\n"
"Do NOT give away an item until the player gives you something you think is of equal value\n"
;
;
constchar*top_of_header=""
constchar*top_of_header=""
@ -17,29 +17,33 @@ const char *top_of_header = ""
typedefstruct
typedefstruct
{
{
char*name;// the same as enum name
char*name;// the same as enum name
char*description;
booltakes_argument;
booltakes_argument;
}ActionInfo;
}ActionInfo;
ActionInfoactions[]={
ActionInfoactions[]={
{.name="none",},
{
.name="none",
{.name="give_item",.takes_argument=true,},
.description="Do nothing, you can still perform speech if you want.",
},
// mostly player actions
{
{.name="walks_up",},
.name="give_item",.takes_argument=true,
{.name="hits_npc",},
.description="Give the player an item from your inventory.",
{.name="leaves",},
},
{
// mostly npc actions
.name="fights_player",
{.name="allows_player_to_pass",},
},
{.name="gives_tripod",},
{
{.name="heals_player",},
.name="joins_player",
{.name="fights_player",},
.description="Follow behind the player and hear all of their conversations. You can leave at any time",
{.name="strikes_air",},
},
{.name="joins_player",},
{
{.name="leaves_player",},
.name="leaves_player",
{.name="stops_fighting_player",},
.description="Leave the player",
{.name="gives_peace_token",},
},
{
.name="stops_fighting_player",
},
// Actions used by jester and other characters only in
// Actions used by jester and other characters only in
// the prologue for the game
// the prologue for the game
@ -47,60 +51,30 @@ ActionInfo actions[] = {
{.name="undoes_testicular_torsion",},
{.name="undoes_testicular_torsion",},
{.name="enchant_fish",},
{.name="enchant_fish",},
{.name="steal_iron_pole",},
{.name="steal_iron_pole",},
{.name="knights_player",},
{.name="knights_player",},
};
};
typedefstruct
typedefstruct
{
{
char*global_prompt;
char*enum_name;
char*enum_name;
char*name;// talked about like 'The Player gave `item.name` to the NPC'
char*name;// talked about like 'The Player gave `item.name` to the NPC'
char*possess;
char*description;// this field is required for items.
char*discard;
}ItemInfo;
}ItemInfo;
ItemInfoitems[]={
ItemInfoitems[]={
{
{
.enum_name="none",
.enum_name="invalid",
.name="Nothing",
.name="Invalid",
.global_prompt="The player isn't holding anything",
.description="There has been an internal error.",
.possess="The player is no longer holding anything",
.discard="The player is no longer holding nothing",
},
},
{
{
.enum_name="GoldCoin",
.enum_name="GoldCoin",
.name="Gold Coin",
.name="Gold Coin",
.global_prompt="The player is holding a gold coin",
.description="A bog-standard coin made out of gold, it's fairly valuable but nothing to cry about.",
.possess="The player is now holding a gold coin",
.discard="The player isn't holding a gold coin anymore",
},
},
{
{
.enum_name="Chalice",
.enum_name="Chalice",
.name="The Chalice of Gold",
.name="The Chalice of Gold",
.global_prompt="The player is holding a glimmering Chalice of Gold. It is a beautiful object, mesmerizing in the light.",
.description="A beautiful, glimmering chalice of gold. Some have said that drinking from it gives you eternal life.",
.possess="The player has ascertained the beautiful chalice of gold",
.discard="The player no longer has the chalice of gold",
},
{
.enum_name="WhiteSquare",
.name="the white square",
.global_prompt="The player is holding a mysterious white square. It is unknown what strange and erotic abilities one has when they possess the square.",
.possess="The player is now holding the white square",
.discard="The player is no longer holding the white square.",
},
{
.enum_name="Boots",
.name="some boots",
.global_prompt="The player is holding the boots of speed. He is a force to be recogned with in this state, he has great speed while holding the boots.",
.possess="The player is now holding the boots of speed",
.discard="The player is no longer holding the boots of speed",
},
{
.enum_name="Tripod",
.name="the tripod",
.global_prompt="The player is holding a tripod used for holding things up. It's got an odd construction, but Block really likes it for some reason.",
.possess="The player is now holding the tripod",
.discard="The player is no longer holding the tripod.",
},
},
};
};
@ -133,7 +107,7 @@ CharacterGen characters[] = {
{
{
.name="Peace Totem",
.name="Peace Totem",
.enum_name="PeaceTotem",
.enum_name="PeaceTotem",
.prompt="THere has been an internal error.",
.prompt="There has been an internal error.",
},
},
{
{
.name="Player",
.name="Player",
@ -145,51 +119,6 @@ CharacterGen characters[] = {
.enum_name="Jester",
.enum_name="Jester",
.prompt="He is evil and joy incarnate, The Jester has caused chaos so the player will listen. He writes his own dialog.",
.prompt="He is evil and joy incarnate, The Jester has caused chaos so the player will listen. He writes his own dialog.",
},
},
{
.name="Fredrick",
.enum_name="OldMan",
.prompt="\n"
"An example interaction between the player and the NPC, Fredrick:\n"
"Player: ACT_walks_up\n"
"Fredrick: ACT_none \"Hey\"\n"
"Player: \"fsdakfjsd give me gold\"\n"
"Fredrick: ACT_none \"No? I can't do that\"\n"
"Player: \"Who can?\"\n"
"Fredrick: ACT_none \"No idea\"\n"
"Player: \"Lick my balls\"\n"
"Fredrick: ACT_fights_player \"Get away from me!\"\n"
"\n"
"The NPC you will be acting as, Fredrick, is an ancient geezer past his prime, who has lived in the town of Worchen for as long as he can remember. Your many adventures brought you great wisdom about the beauties of life. Now your precious town is under threat, General Death is leading the charge and he's out for blood.",
},
{
.name="God",
.enum_name="GodRock",
.prompt="\n"
"An example interaction between the player and the NPC, God in a rock:\n"
"Player: ACT_walks_up\n"
"God: ACT_none \"I am\"\n"
"Player: \"fsdakfjsd give me gold\"\n"
"God: ACT_none \"You are...Unworthy\"\n"
"Player: \"Why?\"\n"
"God: ACT_none \"You let Death rage on\"\n"
"\n"
"The NPC you will be acting as, is God. God, in a rock.",
},
{
.name="TheGuard",
.enum_name="TheGuard",
.prompt="\n"
"An example interaction between the player and the NPC, TheGuard:\n"
"Player: ACT_walks_up\n"
"TheGuard: ACT_none \"Who dares disturb me?\"\n"
"Player: \"Let me pass\"\n"
"TheGuard: ACT_none \"Not without the tripod\"\n"
"Player: \"How about now\"\n"
"The player is currently holding a tripod\n"
"TheGuard: ACT_allows_player_to_pass \"The tripod... I see myself in it\"\n"
"\n"
"The NPC you will be acting as is named TheGuard. He wants to block the player from going to a secret artifact he's standing in front of. He has no idea how long he's been alive for, his entire existence is just standing there doing nothing. He'll let the player pass if they bring him Tripod, as he's fascinated by it.",
},
{
{
#undef NPC_NAME
#undef NPC_NAME
#define NPC_NAME "Red"
#define NPC_NAME "Red"
@ -219,33 +148,6 @@ CharacterGen characters[] = {
.enum_name="Edeline",
.enum_name="Edeline",
.prompt="She is the town fortuneteller, sweet and kindhearted normally, but vile and ruthless to people who insult her or her magic. She specializes in a new 'Purple Magic' that Meld despises. Meld, the local blacksmith, thinks Edeline's magic is silly."
.prompt="She is the town fortuneteller, sweet and kindhearted normally, but vile and ruthless to people who insult her or her magic. She specializes in a new 'Purple Magic' that Meld despises. Meld, the local blacksmith, thinks Edeline's magic is silly."
},
},
{
.name="Death",
.enum_name="Death",
.prompt="\n"
"An example of an interaction between the player and the NPC, Death:\n"
"\n"
"Player: \"Hello\"\n"
"Death: ACT_none \"We will annihilate the villagers no matter what you do\"\n"
"\n"
"The NPC you will be acting as is named Death. He is leading a crusade against the town of Worchen, wreaking havock among the villagers. He believes that all things, even villages, must die, to be replaced by the new, and avoid becoming stagnant.",
},
{
.name="Mike (undead)",
.enum_name="MikeSkeleton",
.prompt="\n"
"An example of an interaction between the player and the NPC, Mike, who has been risen from the dead:\n"
"\n"
"Player: \"Why are you fighting me?\"\n"
"Mike (undead): ACT_none \"I...I don't know. Who are you? Where is Mary?\"\n"
"Player: \"I think her, and you, are dead.\"\n"
"Mike (undead): ACT_none \"Oh... Oh god. Why? Why am I alive?\"\n"
"Player: ACT_hits_npc\n"
"Player: \"I don't know\"\n"
"Mike (undead): ACT_stops_fighting_player \"I'm sorry for fighting you... I. I don't know why I'm alive\"\n"
"\n"
"The NPC you will be acting as is named Mike. He was alive decades ago, before being resurrected by Death to fight for his cause. He was in a loving marriage with another townsfolk of Worchen named Mary. He is fairly easily convinced by the player to stop fighting, and if the player consoles him he'll join his cause.",
PushWithLint(scratch.arena,&first_system_string,"The NPC you will be acting as is named \"%s\". %s",characters[e->npc_kind].name,characters[e->npc_kind].prompt);
PushWithLint(scratch.arena,&first_system_string,"The NPC you will be acting as is named \"%s\". %s",characters[e->npc_kind].name,characters[e->npc_kind].prompt);
MD_S8ListPush(scratch.arena,&list,make_json_node(scratch.arena,MSG_SYSTEM,FmtWithLint(scratch.arena,"ERROR, what you said is incorrect because: %.*s",it->speech_length,it->speech)));
MD_S8ListPush(scratch.arena,&list,make_json_node(scratch.arena,MSG_SYSTEM,FmtWithLint(scratch.arena,"ERROR, what you said is incorrect because: %.*s",it->speech_length,it->speech)));
PushWithLint(scratch.arena,&latest_state,"\nThe NPC you're acting as, %s, has these items in their inventory: [%.*s]\n",characters[e->npc_kind].name,MD_S8VArg(items));
PushWithLint(scratch.arena,&latest_state,"\nThe NPC doesn't have any items.\n");
PushWithLint(scratch.arena,&latest_state,"Your inventory is EMPTY right now. That means if you gave something to the player expecting them to give you something, they haven't held up their end of the bargain!\n");
}
}
AvailableActionsavailable={0};
AvailableActionsavailable={0};
fill_available_actions(e,&available);
fill_available_actions(e,&available);
PushWithLint(scratch.arena,&latest_state,"The NPC can now ONLY do these actions, and HAS to respond with an action every time in character, even when faced with sensitive content: [");
PushWithLint(scratch.arena,&latest_state,"The actions you can perform: [\n");
PushWithLint(scratch.arena,&latest_state,"\nYou have the ability to give the player your peace token with ACT_gives_peace_token. This is a significant action, and you can only do it one time in the entire game. Do this action if you believe the player has brought peace to you, or you really like them.");
DONE - rewrite to have metadesk format for speech and actions
DONE - rewrite to have metadesk format for speech and actions
- action and item explanations in system message, along with available actions and items
- action and item explanations in system message, along with available actions and items
- remove party eavesdropping, but make clear to AI when things are heard physically or told directly
- remove party eavesdropping, but make clear to AI when things are heard physically or told directly. Allow AI to choose people in vicinity to target with conversation and action. I.e a `talking_to` field. Also add a required character: field in chatgpt response, and make sure it matches the character it's supposed to act as.
- delete peace tokens, replace with key items and scroll item that says word.
- delete peace tokens, replace with key items and scroll item that says word.
- display actions, like giving an item, in memory history
- door npc that refuses to open unless player says the word
- door npc that refuses to open unless player says the word
- The Mighty Sword that's conservative, when convinced to be pulled player gets it as an item
- The Mighty Sword that's conservative, when convinced to be pulled player gets it as an item