floatsilence_factor;// 1.0 - maximum likelihood to respond with silence and not interact, 0.0 - minimum likelihood. So at 0 they will interrupt conversations often.
}CharacterGen;
CharacterGencharacters[]={
#define CHARACTER_PROMPT_PREFIX(name) "You, " name ", specifically are acting as a "
{
.name="nobody",
.enum_name="nobody",
.prompt="There has been an internal error.",
},
{
.name="The Player",
.enum_name="Player",
.prompt="There has been an internal error.",
},
{
.name="Daniel",
.enum_name="Daniel",
.prompt=CHARACTER_PROMPT_PREFIX("Daniel")"weathered farmer, who lives a tough, solitary life. You don't see much of a reason to keep living but soldier on anyways. You have a tragic backstory, and mostly just work on the farm. You aim your shotgun and aren't afraid to fire at people you don't like. You HATE people who are confused, or who ask questions, immediately aiming your shotgun at them and firing immediately! You are NOT open to working together with folks or growing as a person, you despise personal growth.",
.silence_factor=1.0f,
},
{
.name="AngelTotem",
.enum_name="AngelTotem",
.prompt="There has been an internal error",
.silence_factor=1.0f,
},
{
.name="Raphael",
.enum_name="Raphael",
.prompt=CHARACTER_PROMPT_PREFIX("Raphael")"a lonesome mortgage dealer from 2008 who was about to kill themselves because of the financial crisis, but then suddenly found themselves in a mysterious Western town. They don't know why they're in this town, but they're terrified.",
.silence_factor=0.8f,
},
{
.name="The Devil",
.enum_name="Devil",
.prompt=CHARACTER_PROMPT_PREFIX("The Devil")"strange red beast, the devil himself, evil incarnate. You mercilessly mock everybody who talks to you, and are intending to instill absolute chaos.",
},
{
.name="Previous Player 1",
.enum_name="PreviousPlayer1",
.prompt=CHARACTER_PROMPT_PREFIX("Previous Player 1")"random person, just passing by",
},
{
.name="Previous Player 2",
.enum_name="PreviousPlayer2",
.prompt=CHARACTER_PROMPT_PREFIX("Previous Player 2")"random person, just passing by",
},
{
.name="Previous Player3",
.enum_name="PreviousPlayer3",
.prompt=CHARACTER_PROMPT_PREFIX("Previous Player 3")"random person, just passing by",
},
{
.name="Tombstone",
.enum_name="Tombstone",
.prompt=CHARACTER_PROMPT_PREFIX("Tombstone")"unassuming melodramatic poetic tombstone that unexpectly can speak with the player. Your goal is to instruct the player that in order for Daniel to survive by nightfall, the player must change his ways. The reason why he's going to die when night comes is because 'all things die in the end, don't they?'"
},
{
.name="Angel",
.enum_name="Angel",
.prompt=CHARACTER_PROMPT_PREFIX("Angel")"mysterious, radiant, mystical creature the player first talks to. You guide the entire game: deciding on an objective for the player to fulfill until you believe they've learned their lesson, whatever that means to them. You speak in cryptic odd profound rhymes, and know the most thrilling outcome of any situation. Your purpose it to thrill the player, but you will never admit this.\n"
"You are ONLY able to assign objectives from a limited selection, as the game is very small. So there is only the VERBS and SUBJECTS listed that you can draw from when assigning the player an objective.\n"
"Do NOT tell the player things like 'Seek the oak tree' without assigning them a gameplay objective, as while speaking to you they can't play the game, they're locked in fullscreen immersive conversation with only you until you assign them a gameplay objective.\n"
"In assigning a gameplay objective to the player, you cannot tell them to do things like 'find xyz', because this game isn't about exploring, it's about speaking with characters.\n"
"\n"
"The characters in the game, and some information about them. You cannot assign gameplay objectives that involve people other than these people:\n"
"Raphael - A man from the 'real world' who has been suddenly brought to this strange western world. He's kind of meek and a bit of a pussy.\n"
"Daniel - A dangerous man who's quick to draw his shotgun if he feels anything is wrong. He's lonesome and traumatized from being in this western world so long.\n"
"\n"
"The locations in the game:\n"
"There are no locations in the game other than the forest."
,
.silence_factor=0.0,
},
};
char*judgement_system_prompt=
"You are to judge if, in given conversation and action history from a video game, the player has successfully caused a great transformation in Daniel. You must ONLY respond with either 'yes' or 'no', and no explanation.\n"
"Be cautious with saying yes. This causes the player to win and save Daniel's life. Only say yes if you think, based on the history, Daniel has truly changed his ways and evolved as a person.\n"
;
char*judgement_yes_example=
"The Player said \"Hey\" to Daniel\n"
"Daniel said \"What do you want?\" to The Player\n"
"The Player said \"Did you see what happened... All those people...\" to Daniel\n"
"Daniel said \"What in the hell are you talking about?\" to The Player\n"
"The Player said \"They'll never forgive you for what you did.\" to Daniel\n"
"Daniel said \"Oh God... My greed... My isolation... I'll never forgive myself\" to The Player\n"
;
char*judgement_no_example="The Player said \"fjdskfjskj\" to Daniel\n"
"Daniel said \"Who are you to speak that gibberish at me?\" to The Player\n"
"The Player said \"pls change kthx\" to Daniel\n"
"Daniel said \"I'll never change for the likes of you\" to The Player\n"
;
char*judgement_no2_example="The Player said \"hey\" to Daniel\n"
"Daniel said \"What could you possibly want from me?\" to The Player\n"
"The Player said \"I want to change you\" to Daniel\n"
"Daniel said \"HA! You couldn't possibly change me\" to The Player\n"
assert(num_placed==0);// not thinking about how to go from name to entity kind right now, but in the future this will be for like machines or interactible things like the fishing rod
Log("Error: the drama memories for the character %s are bigger than the maximum number of remembered memories %d, so they can't be permanently remembered\n",characters[e->npc_kind].name,REMEMBERED_MEMORIES);
boolignore_radius=from->npc_kind==NPC_Player||targeted==NPC_Player;// player conversations can go across the map to make sure the player always sees them
if(from->npc_kind==NPC_Player||a.talking_to_kind==NPC_Player)found=true;// player can always speak to anybody even if it's too far
if(!found)
{
error_message=FmtWithLint(arena,"Character you're talking to, %s, isn't close enough to be talked to",characters[a.talking_to_kind].enum_name);
error_message=FmtWithLint(arena,"Character you're talking to, %.*s, isn't in the same room and so can't be talked to",TextChunkVArg(npc_data(gs,a.talking_to_kind).enum_name));
error_message=FmtWithLint(arena,"Your action_argument for who the action `%s` be directed at, %s, is either invalid (you can't operate on nobody) or it's not an NPC that's near you right now.",actions[a.kind].name,characters[a.argument.targeting].name);
error_message=FmtWithLint(arena,"Your action_argument for who the action `%.*s` be directed at, %s, is either invalid (you can't operate on nobody) or it's not an NPC that's near you right now.",actions[a.kind].name,TextChunkVArg(npc_data(gs,a.argument.targeting)->name));
}
}
@ -1951,11 +1924,6 @@ void cause_action_side_effects(Entity *from, Action a)
P("P - toggles spall profiling on/off, don't leave on for very long as it consumes a lot of storage if you do that. The resulting spall trace is saved to the file '%s'\n",PROFILING_SAVE_FILENAME);
P("If you hover over somebody it will display some parts of their memories, can be somewhat helpful\n");
draw_centered_text((TextParams){false,S8Lit("(Press E to speak)"),V2(screen_size().x*0.5f,screen_size().y*0.25f),blendalpha(WHITE,visible*0.5f),0.8f,.use_font=&font_for_text_input,.layer=LAYER_ANGEL_SCREEN});
AABBbounds=draw_text((TextParams){false,S8Fmt(frame_arena,"--Memories for %s--",characters[to_view->npc_kind].name),cur_pos,WHITE,1.0});
AABBbounds=draw_text((TextParams){false,S8Fmt(frame_arena,"--Memories for %.*s--",TextChunkVArg(npc_data(gs,to_view->npc_kind)->name)),cur_pos,WHITE,1.0});
String8to_text=cur->context.talking_to_kind!=NPC_nobody?S8Fmt(frame_arena," to %.*s ",TextChunkVArg(npc_data(gs,cur->context.talking_to_kind)->name)):S8Lit("");
String8to_text=cur->context.talking_to_kind!=NPC_nobody?S8Fmt(frame_arena," to %s ",characters[cur->context.talking_to_kind].name):S8Lit("");
String8to_text=cur->context.talking_to_kind!=NPC_nobody?S8Fmt(frame_arena," to %.*s ",TextChunkVArg(npc_data(gs,cur->context.talking_to_kind)->name)):S8Lit("");
// A value of 0 means no npc. So is invalid if you're referring to somebody.
typedefintNpcKind;
#define NPC_nobody 0
typedefstruct
{
ActionArgumentKindkind;
NpcKindtargeting;
GameplayObjectiveobjective;
}ActionArgument;
@ -129,8 +127,6 @@ typedef struct
NpcKindauthor_npc_kind;
NpcKindtalking_to_kind;
boolheard_physically;// if not physically, the source was directly
booldrama_memory;// drama memories arent forgotten, and once they end it's understood that a lot of time has passed.
booljudgement_memory;// judgement memories have special printing for when Daniel says nothing, to make sure the AI understands his attitude towards the player
}MemoryContext;
// memories are subjective to an individual NPC
@ -147,6 +143,20 @@ typedef struct Memory
TextChunkspeech;
}Memory;
// text chunk must be a literal, not a pointer
// and this returns a s8 that points at the text chunk memory
*cur_error_message=FmtWithLint(error_arena,"Argument for action `%.*s` you gave is `%.*s`, which doesn't exist in the game so is invalid",S8VArg(action_str),S8VArg(action_argument_str));
*cur_error_message=FmtWithLint(error_arena,"What you said for your action argument, '%.*s...' is WAY too big for the game to handle, it can be a maximum of %d characters, but you output %d!.",S8VArg(trimmed),MAX_SENTENCE_LENGTH,(int)action_argument_str.size);