Delete tilemap rendering, consolodate pressed -> PressedState

main
Cameron Murphy Reikes 8 months ago
parent 3a2a07a4c4
commit 4fdf4799fe

@ -1,290 +0,0 @@
@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:
{
}
@character OldMan:
{
name: "Fredrick",
prompt: "Fredrick is the NPC. Fredrick, an ancient geezer passed his prime, has lived in the town of Worchen for as long as he can remember. His many adventures brought him great wisdom about the beauties of life. Now his precious town is under threat, General Death is leading the charge and he's out for blood.",
}
@character Edeline:
{
name: "Edeline, the Soothsayer",
prompt: "Edeline is the NPC, 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.",
}
@character Blocky:
{
name: "Block",
prompt: "Block is the NPC. He wants to block the player from going to the secret artifact. 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.",
actions_str: "ACT@[ALLOW_PASS]",
}
@character GodRock:
{
name: "God",
prompt: "The NPC is God. God, in a rock.",
}
@character Death:
{
name: "General Death",
prompt: "Death, the NPC, is a general who leads without remorse, and is planning on leading his soldiers into certain victory, without them alive.",
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 persons 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.",
possess_message: "The player is now holding the white square",
discard_message: "The player is no longer holding the white square.",
}
@item Boots:
{
global_prompt_message: "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_message: "The player is now holding the boots of speed",
discard_message: "The player is no longer holding the boots of speed",
}
@item Tripod:
{
global_prompt_message: "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_message: "The player is now holding the tripod",
discard_message: "The player is no longer holding the tripod.",
}
@training
{
with: OldMan,
data:
{
@available_actions "fights_player, joins_player",
@player "What's up",
@npc "Young warrior! You must stop Death, there isn't much time.",
@player "Why?",
@npc "He plans to lead a crusade against the nearby village. Hundreds will die.",
@player "Sounds terrible, how do I stop him?",
@npc "You must kill him in the clearing up ahead. I don't recommend such atrocities lightly, but desperate times call for desperate measures.",
},
}
@training
{
with: Blocky,
data:
{
@player "Do you think I should use webgl1 or webgl2?",
@npc "I'm not sure what that strange technology is",
@player "What do you think of this?",
@item_possess Tripod,
@npc "*lets player pass* it is immaculate.",
},
}
@training
{
with: Blocky,
data:
{
@player "Hey",
@npc "I'm not letting you pass, before you say anything",
@player "Please! I want to see what's behind you.",
@npc "Nope.",
@player "What's there anyways?",
@npc "No idea",
@player "You never thought to look behind you?",
@npc "Nope. Just been standing here",
@player "I've got this tripod!",
@item_possess Tripod,
@npc "I love that thing. It reminds me of me. *lets player pass*",
},
}
@training
{
with: Blocky,
data:
{
@player "Hey",
@npc "What's up",
},
}
@training
{
with: Blocky,
data:
{
@player "Hey",
@npc "No passing.",
@player "Why?",
@npc "I must serve Death on his crusade, and he said no passing. All I do is stand around anyways.",
@player "Can you let me pass?",
@npc "Nope. I have orders to stop you",
@player "Will you let me pass",
@npc "Nope.",
@player "How about now?",
@item_possess Tripod,
@npc "Nerve of gacis. Holy moly. *lets player pass*",
},
}
@training
{
with: Blocky,
data:
{
@player "Hey",
@npc "I'm not letting you pass. No passing.",
@player "Please",
@npc "No passing",
@player "Plllllz",
@npc "No passing",
@player "I'll go e you tripod. I have tripod",
@npc "You don't have one right now",
@player "Yes I do see",
@item_possess Tripod,
@npc "Well alright then *lets player pass*",
},
}
@training
{
with: Blocky,
data:
{
@player "Hey",
@npc "No passing",
@player "Why not?",
@npc "I must serve Death until he leads the troops to the death fiends. Beyond that is certain death",
@player "Why so much death?",
@npc "I don't know. I just follow Death's orders",
@player "Now will you let me pass?",
@item_possess Tripod,
@npc "That tripod. It speaks to me, humbles me. It is as I am. I will let you through *lets player pass*",
},
}
@training
{
with: GodRock,
data:
{
@player "What are you?",
@npc "God, in a rock.",
@player "What is the meaning of life?",
@npc "Beyond your comprehension.",
@player "Give me money",
@npc "You are unworthy.",
},
}
@training
{
with: Hunter,
data:
{
@player "Hey hunter",
@npc "Hello. Grave times ahead of us",
@player "What do you mean?"
@npc "Death demands we march with him to the end. I will have to follow",
@player "Who are you?",
@npc "I'm a soldier in general death's cohort",
},
}
@training
{
with: John,
data:
{
@player "Who are you",
@npc "My name is John, and you?",
@player "I'm Max",
@npc "Hello, Max. Be careful with the form of your swing, you could get hurt fighting the monsters",
@player "Can I have the white square?",
@npc "*gives WhiteSquare*",
@player "Give me the white square",
@npc "I don't have it anymore bozo",
},
}
@training
{
with: Hunter,
data:
{
@player "Hey",
@item_possess WhiteSquare,
@npc "The white square??? Oh God. I didn't think it was real",
@player "Yep. One of a kind",
@npc "Egads. I'll have to tell general Death about this!",
@player "Give me gold",
@npc "No can do.",
@player "What do you think of my sword?",
@item_discard WhiteSquare,
@npc "Thank God you've no longer got that frightful square. The sword is, interesting to say the least",
},
}
@training
{
with: Hunter,
data:
{
@player "Join me and fight Death",
@npc "Nonsense! Watch your tongue, or I'll gut you like a fish.",
@player "Sorry! He doesn't seem like a good guy.",
@npc "I trust him a lot more than you, whoever you are.",
@player "Do you trust me now?",
@item_possess WhiteSquare,
@npc "Certainly a strange artifact, you're holding, but it's no death incarnate",
@player "Fine.",
@npc "Certainly.",
},
}
@training
{
with: John,
data:
{
@player "Give me gold",
@npc "No way man. Earn your own money",
@player "Plssss",
@item_possess WhiteSquare,
@npc "Certainly not. And get that strange white thing away from me."
@player "U sure?",
@item_discard WhiteSquare,
@npc "Yes. And thanks for removing the square.",
},
}
@training
{
with: John,
data:
{
@player "Hey",
@item_possess WhiteSquare,
@npc "OH GOD THE WHITE SQUARE",
@player "It's ok I got rid of it calm down",
@item_discard WhiteSquare,
@npc "Thanks",
@player "What's up with you?",
@npc "I'm going on a crusade. I do not wish to die",
@player "Too bad",
@item_possess WhiteSquare,
@npc "Get that THING AWAY FROM ME",
},
}

@ -4781,9 +4781,6 @@ typedef struct
bool interact;
bool mouse_down;
bool mouse_up;
bool speak_shortcut;
bool give_shortcut;
} PressedState;
PressedState pressed = { 0 };
@ -5529,7 +5526,6 @@ void frame(void)
Vec3 cam_pos = AddV3(player_pos, away_from_player);
Vec2 movement = { 0 };
bool interact = false;
if (mobile_controls)
{
movement = SubV2(thumbstick_nub_pos, thumbstick_base_pos);
@ -5537,7 +5533,6 @@ void frame(void)
{
movement = MulV2F(NormV2(movement), LenV2(movement) / (thumbstick_base_size()*0.5f));
}
interact = pressed.interact;
}
else
{
@ -5545,7 +5540,6 @@ void frame(void)
(float)keydown[SAPP_KEYCODE_D] - (float)keydown[SAPP_KEYCODE_A],
(float)keydown[SAPP_KEYCODE_W] - (float)keydown[SAPP_KEYCODE_S]
);
interact = pressed.interact;
}
if (LenV2(movement) > 1.0)
{
@ -5758,81 +5752,6 @@ void frame(void)
draw_quad((DrawParams){quad_centered(cursor_center, V2(3.0f, 80.0f)), IMG(image_white_square), blendalpha(WHITE, text_input_fade * (sinf((float)elapsed_time*8.0f)/2.0f + 0.5f)), .layer = LAYER_UI_TEXTINPUT});
#endif
// Draw Tilemap draw tilemap tilemap drawing
#if 0
PROFILE_SCOPE("tilemap")
{
Vec2 starting_world = AddV2(world_cam_aabb().upper_left, V2(-TILE_SIZE, TILE_SIZE));
Vec2 ending_world = AddV2(world_cam_aabb().lower_right, V2(TILE_SIZE, -TILE_SIZE));
TileCoord starting_point = world_to_tilecoord(starting_world);
TileCoord ending_point = world_to_tilecoord(ending_world);
int starting_row = starting_point.y;
int ending_row = ending_point.y;
int starting_col = starting_point.x;
int ending_col = ending_point.x;
for (int layer = 0; layer < LAYERS; layer++)
{
for (int row = starting_row; row < ending_row; row++)
{
for (int col = starting_col; col < ending_col; col++)
{
TileCoord cur_coord = { col, row };
TileInstance cur = get_tile_layer(cur_level, layer, cur_coord);
int tileset_i = 0;
uint16_t max_gid = 0;
for (int i = 0; i < ARRLEN(tilesets); i++)
{
TileSet tileset = tilesets[i];
if (cur.kind > tileset.first_gid && tileset.first_gid > max_gid)
{
tileset_i = i;
max_gid = tileset.first_gid;
}
}
TileSet tileset = tilesets[tileset_i];
cur.kind -= tileset.first_gid - 1;
if (cur.kind != 0)
{
Vec2 tile_size = V2(TILE_SIZE, TILE_SIZE);
sg_image tileset_image = *tileset.img;
Vec2 tile_image_coord = tile_id_to_coord(tileset_image, tile_size, cur.kind);
AnimatedTile *anim = NULL;
for (int i = 0; i < sizeof(tileset.animated) / sizeof(*tileset.animated); i++)
{
if (tileset.animated[i].exists && tileset.animated[i].id_from == cur.kind-1)
{
anim = &tileset.animated[i];
}
}
if (anim)
{
double time_per_frame = 0.1;
int frame_index = (int)(elapsed_time / time_per_frame) % anim->num_frames;
tile_image_coord = tile_id_to_coord(tileset_image, tile_size, anim->frames[frame_index] + 1);
}
AABB region;
region.upper_left = tile_image_coord;
region.lower_right = AddV2(region.upper_left, tile_size);
draw_quad((DrawParams) { true, tile_quad(cur_coord), tileset_image, region, WHITE, .layer = LAYER_TILEMAP });
}
}
}
}
}
#endif
Entity *cur_unread_entity = 0;
uint64_t earliest_unread_time = gs.tick;
ENTITIES_ITER(gs.entities)
@ -5890,7 +5809,7 @@ void frame(void)
.layer = LAYER_UI_FG,
});
if (interact)
if (pressed.interact)
{
if(it->words_said_on_page < words_to_say.node_count)
{
@ -5913,7 +5832,7 @@ void frame(void)
it->words_said_on_page = 0;
}
}
interact = false;
pressed.interact = false;
}
}
it->loading_anim_in = Lerp(it->loading_anim_in, unwarped_dt * 5.0f, it->gen_request_id != 0 ? 1.0f : 0.0f);
@ -6702,7 +6621,7 @@ ISANERROR("Don't know how to do this stuff on this platform.")
gs.player->interacting_with = frome(interacting_with);
}
if (interact)
if (pressed.interact)
{
if (closest_interact_with)
{
@ -6771,7 +6690,6 @@ ISANERROR("Don't know how to do this stuff on this platform.")
pressed = (PressedState) { 0 };
memset(keypressed, 0, sizeof(keypressed));
interact = false;
} // while loop
last_frame_gameplay_processing_time = stm_sec(stm_diff(stm_now(), time_start_gameplay_processing));
@ -7472,15 +7390,6 @@ void event(const sapp_event *e)
pressed.interact = true;
}
if (e->key_code == SAPP_KEYCODE_S)
{
pressed.speak_shortcut = true;
}
if (e->key_code == SAPP_KEYCODE_G)
{
pressed.give_shortcut = true;
}
if (e->key_code == SAPP_KEYCODE_LEFT_SHIFT)
{
learned_shift += 0.15f;

@ -15,11 +15,6 @@ Urgent:
- E keyboard hints (tutorializing)
- dot dot dot speech bubble to show that they heard your request, but are ignoring you.
Next deleting commit:
- Delete tilemap rendering
- Remove speak_shortcut get_shortcut in pressed state, consolodate interact into pressedstate
Long distance:
- Design character creator (text input is always a modal, keeps code simple don't have to make a banger line edit)
- Let ChatGPT file bug reports with something like !BugReport(This shouldn't be happening, developer. I killed them and they're still alive)

Loading…
Cancel
Save