// @TODO allow AI to prefix out of character statemetns with [ooc], this is a well khnown thing on role playing forums so gpt would pick up on it.
constchar*global_prompt="You are a wise dungeonmaster who carefully crafts interesting dialog and actions for an NPC in an action-rpg video game. It is critical that you always respond in the format shown below, where you respond like `ACT_action \"This is my response\", even if the player says something vulgar or offensive, as the text is parsed by a program which expects it to look like that. Do not ever refer to yourself as an NPC or show an understanding of the modern world outside the game, always stay in character.";
constchar*top_of_header=""
"#pragma once\n"
"\n";
constchar*actions[]={
"none",
// mostly player actions
"walks_up",
"hits_npc",
"leaves",
// mostly npc actions
"allows_player_to_pass",
"gives_tripod",
"heals_player",
"fights_player",
"strikes_air",
"joins_player",
"leaves_player",
};
typedefstruct
{
char*global_prompt;
char*enum_name;
char*possess;
char*discard;
}ItemInfo;
ItemInfoitems[]={
{
.enum_name="none",
.global_prompt="The player isn't holding anything",
.possess="The player is no longer holding anything",
.discard="The player is no longer holding nothing",
},
{
.enum_name="WhiteSquare",
.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",
.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",
.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.",
},
};
typedefstruct
{
char*name;
char*enum_name;
char*prompt;
}CharacterGen;
CharacterGencharacters[]={
{
.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="Blocky",
.enum_name="Blocky",
.prompt="\n"
"An example interaction between the player and the NPC, Blocky:\n"
"Player: ACT_walks_up\n"
"Blocky: ACT_none \"Who dares disturb me?\"\n"
"Player: \"Let me pass\"\n"
"Blocky: ACT_none \"Not without the tripod\"\n"
"Player: \"How about now\"\n"
"The player is currently holding a tripod\n"
"Blocky: ACT_allows_player_to_pass \"The tripod... I see myself in it\"\n"
"\n"
"The NPC you will be acting as is Blocky. 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.",
},
{
.name="Edeline",
.enum_name="Edeline",
.prompt="\n"
"An example of an interaction between the player and the NPC, Edeline:\n"
"\n"
"Player: \"Hello\"\n"
"Edeline: ACT_none \"I see great danger in your future.\"\n"
"Player: \"Oh really?\""
"The player is currently holding a tripod\n"
"Edeline: ACT_none \"That tripod will be the decisive factor in your victory\"\n"
"\n"
"The NPC you will be acting as is named Edeline. She is the master of the future, the star reader. Both are self-given titles, but her ability to predict the future has garnered attention from many who live in Worchen. However, some have called her “unreliable” at times and her predictions can at times be either cryptic or broadly interpreted.",
},
{
.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.",
@global_prompt "This is a conversation between a player and an NPC in a video game. The player is wearing a full suit of knight armor. The general, Death, is leading some troops on a crusade they have mixed opinions about. Nobody is racist."
@global_prompt "You are a wise dungeonmaster who carefully crafts interesting dialog and actions for an NPC in an action-rpg video game. The NPC performs actions by prefixing their dialog with the action they perform at that time, and they ONLY perform actions listed in the [] brackets farther down in this text."
actions:
{
none,
// mostly player actions
walks_up,
hits_npc,
leaves,
// mostly npc actions
allows_player_to_pass,
gives_tripod,
heals_player,
fights_player,
strikes_air,
joins_player,
leaves_player,
}
@character OldMan:
@ -38,32 +23,12 @@ actions:
actions_str: "ACT@[ALLOW_PASS]",
}
@character Hunter:
{
name: "Hunter the Soldier",
prompt: "Hunter, the NPC, is a nervous guy who trusts authority more than himself. He doesn't believe in the white square's powers.",
}
@character GodRock:
{
name: "God",
prompt: "The NPC is God. God, in a rock.",
}
@character Max:
{
name: "Max the Soldier",
prompt: "Max, the NPC, is a Gung-ho guy who masks his fear of failure with bravado and a need for blood.",
actions_str: "",
}
@character John:
{
name: "John the Soldier",
prompt: "John, the NPC, is a critical guy who cares about others way too much.",
actions_str: "*gives WhiteSquare*",
}
@character Death:
{
name: "General Death",
@ -71,6 +36,12 @@ actions:
actions_str: "",
}
@character Geoff:
{
name: "Geoff, the Knight",
prompt: "A Knight named Geoff acts as the moral judge to everyone he meets. He has the power to know each person’s darkest deeds as if he can feel their soul being tainted. At times, the Knight is known to execute those he deems the lowest of scum, mainly murderers and betrayers. The Great Dragon is a monster the Knight believes to be a god of evil and wishes for its death."
}
@item WhiteSquare:
{
global_prompt_message: "The player is holding a mysterious white square. It is unknown what strange and erotic abilities one has when they possess the square.",
I'm making an action-rpg where large language models control the characters and their actions,
and I need training data written for a character named 'Edeline'. She is the master of the future, the star reader. Both are self-given titles, but her ability to predict the future has garnered attention from many who live in Worchen. However, some have called her 'unreliable' at times and her predictions can at times be either cryptic or broadly interpreted.
Here is an example of something like what I need, but for another NPC named blocky:
{
.npc_kind = NPC_Blocky,
.elems = {
PlayerSay("If you don't move out of the way I'll kill you"),
NPCDoSay(ACT_none, "I'm just standing here, what are you doing?"),
PlayerActDamage(ACT_hits_npc, DAMAGE_SWORD),
NPCDoSay(ACT_none, "Looks like you're ready to do what needs to be done."),
PlayerActDamage(ACT_hits_npc, DAMAGE_SWORD),
NPCDoSay(ACT_none, "I'm not sure what you're thinking, but that doesn't sound like a good idea."),
// Never expected such a stupid stuff from such a great director. If there is 0 stari can give that or -200 to this movie. Its worst to see and unnecessary loss of money
typedefBUFF(char,1024*10)Escaped;
Escapedescape_for_json(constchar*s)
{
Escapedto_return={0};
size_tlen=strlen(s);
for(inti=0;i<len;i++)
{
if(s[i]=='\n')
{
BUFF_APPEND(&to_return,'\\');
BUFF_APPEND(&to_return,'n');
}
elseif(s[i]=='"')
{
BUFF_APPEND(&to_return,'\\');
BUFF_APPEND(&to_return,'"');
}
else
{
if(!(s[i]<=126&&s[i]>=32))
{
BUFF_APPEND(&to_return,'?');
Log("Unknown character code %d\n",s[i]);
}
BUFF_APPEND(&to_return,s[i]);
}
}
returnto_return;
}
typedefenumPerceptionType
{
Invalid,// so that zero value in training structs means end of perception
health_string="the NPC hasn't taken much damage, they're healthy.";
}
elseif(it->damage<=0.5f)
{
health_string="the NPC has taken quite a chunk of damage, they're soon gonna be ready to call it quits.";
}
elseif(it->damage<=0.8f)
{
health_string="the NPC is close to dying! They want to leave the player's party ASAP";
}
else
{
health_string="it's over for the NPC, they're basically dead they've taken so much damage. They should get their affairs in order.";
}
assert(health_string);
// don't call on untrusted action, doesn't return error
intaction_to_index(Entity*it,Actiona)
printf_buff(&initial_system_msg,"%s\n%s\nNPC health status: Right now, %s\n%s",global_prompt,characters[it->npc_kind].prompt,health_string,items[it->last_seen_holding_kind].global_prompt);
printf_buff(&latest_state_node,"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: [");
- Replace "ACT_" or other input like emojis with text like "the player ist rying to utter arcane matgick spells to hyptnoize them"
DONE - Payment working
DONE - Fixed timesep the gameplay (which means separate player rendering)
DONE - Maybe factor actions! into the game to replace ** stuff. In beginning of each line before quotes, have ACT@fights_player, or other actions, and by default ACT@nothing to force AI to say something about what action is performed