You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
5.5 KiB
C

#pragma once
#include "HandmadeMath.h"
// @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.
const char *global_prompt =
"You are a character in a simple western video game. You act in the world by responding to the user with json payloads that have fields named \"speech\", \"action\", \"action_argument\" (some actions take an argument), and \"target\" (who you're speaking to, or who your action is targeting).\n"
"You speak using short, concise, punchy language. Responding with speech when you're overhearing dialog INTERRUPTS them, so only do so when you're sure you have something funny or interesting to say.\n"
"The shotguns in this game are very powerful, there's no hiding from them, no cover can be taken.\n"
;
const char *top_of_header = ""
"#pragma once\n"
"\n";
typedef struct
{
char *name; // the same as enum name
char *description;
char *argument_description;
bool takes_argument;
} ActionInfo;
ActionInfo actions[] = {
#define NO_ARGUMENT .argument_description = "Takes no argument", .takes_argument = false
#define ARGUMENT(desc) .argument_description = desc, .takes_argument = true
{
.name = "none",
.description = "Do nothing",
NO_ARGUMENT,
},
{
.name = "approach",
.description = "There has been an error, please report to the developer. No NPCs should be able to do this",
ARGUMENT("Expects the argument to be who you're approaching"),
},
{
.name = "end_conversation",
.description = "Signals to everybody that you want to end conversation with the target of this action, use this when you feel like enough has been said.",
ARGUMENT("Expects the argument to be who you are ending the conversation with, or if it's nobody in particular you may omit this action's argument"),
},
{
.name = "assign_gameplay_objective",
.description = "Ends your conversation with who you're speaking to, at the same time assigning them a goal to complete in the world of Dante's Cowboy.",
ARGUMENT("Expects the argument to be the gameplay objective assigned for them, it fits a specific syntax and is case sensitive: it must be `VERB SUBJECT`, you're given a list of accepted verbs and subjects earlier."),
},
{
.name = "join",
.description = "Joins somebody else's party, so you follow them everywhere",
ARGUMENT("Expects the argument to be who you're joining"),
},
{
.name = "leave",
.description = "Leave the party you're in right now",
NO_ARGUMENT,
},
{
.name = "aim_shotgun",
.description = "Aims your shotgun at the specified target, preparing you to fire at them and threatening their life.",
ARGUMENT("Expects the argument to be the name of the person you're aiming at, they must be nearby"),
},
{
.name = "fire_shotgun",
.description = "Fires your shotgun at the current target, killing the target.",
NO_ARGUMENT,
},
{
.name = "put_shotgun_away",
.description = "Holsters your shotgun, no longer threatening who you're aiming at.",
NO_ARGUMENT,
},
};
char *verbs[] = {
"KILL",
};
typedef enum
{
MSG_SYSTEM,
MSG_USER,
MSG_ASSISTANT,
} MessageType;
typedef struct
{
char *name;
char *enum_name;
char *prompt;
float silence_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;
CharacterGen characters[] = {
#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 = "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.5f,
},
{
.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 = "Passerby",
.enum_name = "Passerby",
.prompt = CHARACTER_PROMPT_PREFIX("Random Passerby") "random person, just passing by",
},
{
.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.",
.silence_factor = 0.0,
},
};