From 55541a7060ca59ba379c52ad93eff4259bc3f725 Mon Sep 17 00:00:00 2001 From: Cameron Reikes Date: Sat, 17 Jun 2023 15:35:10 -0700 Subject: [PATCH] Remove peace tokens, fix who_i_am not in quotes, improve global prompt --- assets.mdesk | 8 ------ assets/new_level.json | 15 ++-------- assets/peace_orb.png | Bin 702 -> 0 bytes assets/peace_totem.png | Bin 2474 -> 0 bytes character_info.h | 13 +++------ main.c | 61 ++--------------------------------------- makeprompt.h | 6 +--- tuning.h | 1 - 8 files changed, 10 insertions(+), 94 deletions(-) delete mode 100644 assets/peace_orb.png delete mode 100644 assets/peace_totem.png diff --git a/assets.mdesk b/assets.mdesk index 67bc66e..09113d2 100644 --- a/assets.mdesk +++ b/assets.mdesk @@ -18,14 +18,6 @@ { filepath: "grunt_3.wav", } -@image peace_orb: -{ - filepath: "peace_orb.png", -} -@image peace_totem: -{ - filepath: "peace_totem.png", -} @image merchant: { filepath: "copyrighted/merchant.png", diff --git a/assets/new_level.json b/assets/new_level.json index 3d62084..4142fd3 100644 --- a/assets/new_level.json +++ b/assets/new_level.json @@ -340,17 +340,6 @@ "id":2, "name":"objects", "objects":[ - { - "class":"", - "height":32, - "id":4, - "name":"PeaceTotem", - "rotation":0, - "visible":true, - "width":32, - "x":1522.39393939395, - "y":1570.48484848484 - }, { "class":"", "height":32, @@ -365,8 +354,8 @@ "rotation":0, "visible":true, "width":32, - "x":1530.91836734694, - "y":2684.06802721088 + "x":1537.58503401361, + "y":1842.73469387755 }, { "class":"", diff --git a/assets/peace_orb.png b/assets/peace_orb.png deleted file mode 100644 index 9d6e4c513e1a14d65e8419948ac57ec7a6172ee5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 702 zcmV;v0zv(WP)EX>4Tx04R}tkv&MmKpe$i(`t*fI9No)AwzYtAS&W0RV;#q(pG5I!Q|2}Xws0R zxHt-~1qVMCs}3&Cx;nTDg5U>;tBaGOi*kx9)Hhl#~v2g@DIN`^{2O&n2Fjq-)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9Q zbKo_xA+ZVc)7}qI^5X4~0dKqZ1Eh%r3#`5=ZYpHYua&dJF`!O+=f$E|W!VBLYjr^= z>K`!ufx5C+w}~S$0M6$7xqcT{E@QN}+8tH}7#U}N2)NI$2jT#5o18+=!(Q%HQzS)y zATI~qG|ACXHF#1*fp0{4J8H74tO{?#c;3_qHO*82d?G(kHzCID*35Ei+zD=bg{Oeo zGyp8q?x~OR@BRMuj5b89nXY&ZoR$>1kQe~%xGpK|*>>}|&Si19vVFy{*6l{UZsTUs zo?y%S&MuP(MHvL3X`)z7GW4s6yI`CQ7I`&yWHPQSQNJOfo3wwKQWF?%Gv#l#AWHILq~L`P+k6}_4skp84BBU~zcz8b oziVRdRcYM)FzYHXYkzn6Hw||^l4uf;ZvX%Q07*qoM6N<$f;dcYi~s-t diff --git a/character_info.h b/character_info.h index 964b756..8ea10fa 100644 --- a/character_info.h +++ b/character_info.h @@ -8,7 +8,7 @@ const char *global_prompt = "You are a colorful and interesting personality in a "Messages are json-like dictionaries that look like this: `{who_i_am: who you're acting as, talking_to: who this action is directed at, could be nobody, action: your_action, speech: \"Hey player!\", thoughts: \"Your thoughts\"}`. The required fields are `action`, `thoughts`, `who_i_am`, and `talking_to` \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" "`talking_to` provides the name of who the action is directed towards. Use 'nobody' if you just want to speak to the air, but if you're speaking to somebody fill out the field like `talking_to: \"Character's Name\"`. If in a past message, talking_to isn't your name, then it's much more likely you don't respond to their speech and action by leaving speech as a string of size 0, like `speech: \"\"`\n" -"Do NOT give away an item until the player gives you something you think is of equal value\n" +"You are an agent, NOT an assistant, which means you stand up for yourself! Do NOT give away an item until the player gives you something you think is of equal value. Get angry, act human, be interesting.\n" ; const char *top_of_header = "" @@ -31,9 +31,6 @@ ActionInfo actions[] = { .name = "give_item", .takes_argument = true, .description = "Give the player an item from your inventory.", }, - { - .name = "fights_player", - }, { .name = "joins_player", .description = "Follow behind the player and hear all of their conversations. You can leave at any time", @@ -42,6 +39,9 @@ ActionInfo actions[] = { .name = "leaves_player", .description = "Leave the player", }, + { + .name = "fights_player", + }, { .name = "stops_fighting_player", }, @@ -106,11 +106,6 @@ CharacterGen characters[] = { .enum_name = "Invalid", .prompt = "There has been an internal error.", }, - { - .name = "Peace Totem", - .enum_name = "PeaceTotem", - .prompt = "There has been an internal error.", - }, { .name = "Player", .enum_name = "Player", diff --git a/main.c b/main.c index b3d6554..0276c58 100644 --- a/main.c +++ b/main.c @@ -703,10 +703,6 @@ Vec2 entity_aabb_size(Entity *e) { return V2(TILE_SIZE*1.0f, TILE_SIZE*1.0f); } - else if (e->npc_kind == NPC_PeaceTotem) - { - return V2(TILE_SIZE, TILE_SIZE); - } else { assert(false); @@ -4136,9 +4132,6 @@ void frame(void) else if (it->npc_kind == NPC_Jester) { } - else if (it->npc_kind == NPC_PeaceTotem) - { - } else { assert(false); @@ -4397,23 +4390,9 @@ void frame(void) { if (closest_interact_with->is_npc) { - if(closest_interact_with->npc_kind == NPC_PeaceTotem) - { - if(player->peace_tokens >= PEACE_TOKENS_NEEDED) - { - gs.won = true; - } - else - { - closest_interact_with->red_fade = 1.0f; - } - } - else - { - // begin dialog with closest npc - player->state = CHARACTER_TALKING; - player->talking_to = frome(closest_interact_with); - } + // begin dialog with closest npc + player->state = CHARACTER_TALKING; + player->talking_to = frome(closest_interact_with); } else { @@ -4681,20 +4660,6 @@ void frame(void) } draw_animated_sprite((DrawnAnimatedSprite) { ANIM_knight_idle, elapsed_time, true, AddV2(it->pos, V2(0, 30.0f)), tint }); } - else if(it->npc_kind == NPC_PeaceTotem) - { - DrawParams d = (DrawParams) { true, quad_centered(it->pos, V2(TILE_SIZE, TILE_SIZE)), IMG(image_peace_totem), WHITE, .layer = LAYER_WORLD, }; - draw_shadow_for(d); - draw_quad(d); - - it->red_fade = Lerp(it->red_fade, dt*2.0f, 0.0f); - - float fade_requirements = Lerp(0.0f, 1.0f - clamp01(LenV2(SubV2(player->pos, it->pos))/(TILE_SIZE*4.0f)), 1.0f); - - MD_ArenaTemp scratch = MD_GetScratch(0, 0); - draw_centered_text((TextParams){true, false, FmtWithLint(scratch.arena, "%d/%d", player->peace_tokens, PEACE_TOKENS_NEEDED), AddV2(it->pos, V2(0.0, 32.0)), blendalpha(blendcolors(WHITE, it->red_fade, RED), fade_requirements), (1.0f / cam.scale)*(1.0f + it->red_fade*0.5f)}); - MD_ReleaseScratch(scratch); - } else { assert(false); @@ -5029,26 +4994,6 @@ void frame(void) // ui #define HELPER_SIZE 250.0f - // how many peace tokens - { - MD_ArenaTemp scratch = MD_GetScratch(0, 0); - const float to_screen_padding = 50.0f; - const float btwn_elems = 10.0f; - const float text_scale = 1.0f; - const float peace_token_icon_size = 50.0f; - - TextParams t = {false, true, FmtWithLint(scratch.arena, "%d", player->peace_tokens), V2(0, 0), WHITE, text_scale}; - AABB text_bounds = draw_text(t); - float total_elem_width = btwn_elems + peace_token_icon_size + aabb_size(text_bounds).x; - float elem_height = peace_token_icon_size; - AABB total_elem_box = aabb_at(V2(screen_size().x - to_screen_padding - total_elem_width, screen_size().y - to_screen_padding), V2(total_elem_width, elem_height)); - draw_quad((DrawParams){false, quad_at(total_elem_box.upper_left, V2(peace_token_icon_size, peace_token_icon_size)), IMG(image_peace_orb), WHITE, .layer = LAYER_UI}); - t.dry_run = false; - t.pos = AddV2(total_elem_box.upper_left, V2(peace_token_icon_size + btwn_elems + aabb_size(text_bounds).x/2.0f, -peace_token_icon_size/2.0f)); - draw_text(t); - MD_ReleaseScratch(scratch); - } - // keyboard tutorial icons if (!mobile_controls) { diff --git a/makeprompt.h b/makeprompt.h index 5375e2d..b16b851 100644 --- a/makeprompt.h +++ b/makeprompt.h @@ -245,9 +245,6 @@ typedef struct Entity bool held_by_player; ItemKind item_kind; - // peace totem - float red_fade; - // npcs bool is_npc; bool being_hovered; @@ -280,7 +277,6 @@ typedef struct Entity bool is_character; bool knighted; bool in_conversation_mode; - int peace_tokens; Vec2 to_throw_direction; BUFF(Vec2, 8) position_history; // so npcs can follow behind the player CharacterState state; @@ -467,7 +463,7 @@ MD_String8 generate_chatgpt_prompt(MD_Arena *arena, Entity *e, CanTalkTo can_tal PushWithLint(scratch.arena, &cur_list, "{"); if(it->context.i_said_this) assert(it->context.author_npc_kind == e->npc_kind); - PushWithLint(scratch.arena, &cur_list, "who_i_am: %s, ", characters[it->context.author_npc_kind].name); + PushWithLint(scratch.arena, &cur_list, "who_i_am: \"%s\", ", characters[it->context.author_npc_kind].name); MD_String8 speech = MD_S8(it->speech, it->speech_length); PushWithLint(scratch.arena, &cur_list, "talking_to: \"%s\", ", it->context.was_talking_to_somebody ? characters[it->context.talking_to_kind].name : "nobody"); diff --git a/tuning.h b/tuning.h index c9119f2..8f04141 100644 --- a/tuning.h +++ b/tuning.h @@ -9,7 +9,6 @@ #define PLAYER_ROLL_SPEED 7.0f #define PERCEPTION_HEARING_RAGE (TILE_SIZE*4.0f) #define CHARACTERS_PER_SEC 45.0f -#define PEACE_TOKENS_NEEDED 5 #define PROPAGATE_ACTIONS_RADIUS (TILE_SIZE*5.0f) #define ARENA_SIZE (1024*1024)