inspect; item; pathfinding; terms

master
chimchooree 2 years ago
parent 345662dd70
commit 7b0f7b58c4

@ -9,7 +9,7 @@
<p>The inspect menu ("res://UI/InspectMenu/InspectMenu.tscn") is instanced at declaration and added as a child at ready in the UI singleton. <br></p> <p>The inspect menu ("res://UI/InspectMenu/InspectMenu.tscn") is instanced at declaration and added as a child at ready in the UI singleton. <br></p>
<br> <br>
<h2>logic </h2> <h2>logic </h2>
<p>When tangible entity is right-clicked (@ $Body/Sprite/Clickable), the UI enters InspectMenu with its subject set. The "id_pressed" signal is reset for each subject. InspectMenu connects "about_to_show" the first time it's needed and keeps it forever. Before popup(), it resets, adds a label at an offset with the subject's display name, then adds a UI option for each inspect option. <br></p> <p>When tangible entity is right-clicked (@ $Body/Sprite/Clickable), the UI enters InspectMenu with its subject set. (The subject setter also sets the player's target.) The "id_pressed" signal is reset for each subject. InspectMenu connects "about_to_show" the first time it's needed and keeps it forever. Before popup(), it resets, adds a label at an offset with the subject's display name, then adds a UI option for each inspect option. <br></p>
<br> <br>
<p>When a selection is made, the "id_pressed" signal calls "id_pressed" on the subject, which calls the method at its inspect_options[pressed_id][1]. So 'examine' calls 'examine,' which is in tangible.gd. Most related methods are on tangible.gd, though they may be at a more specific script. <br></p> <p>When a selection is made, the "id_pressed" signal calls "id_pressed" on the subject, which calls the method at its inspect_options[pressed_id][1]. So 'examine' calls 'examine,' which is in tangible.gd. Most related methods are on tangible.gd, though they may be at a more specific script. <br></p>
<br> <br>
@ -20,6 +20,10 @@
<br> <br>
<p>Tangibles and inventory items both have inspect menus, but their code has to be separate. They are too different from each other. <br></p> <p>Tangibles and inventory items both have inspect menus, but their code has to be separate. They are too different from each other. <br></p>
<br> <br>
<p>I intend for the player to be able to pick up an item through the inspect menu without changing his current target. For now, InspectMenu.gd/set_subject(subject) sets the player target. MoveToDestination.gd/handle_moved_result tracks the user's current target using character/find_distance_to_target(). Instead, it would need to receive the relevant subject from the inspect menu or skill or attack target from the character and pass it through character/find_distance_to(target). <br></p>
<br>
<p>It doesn't close the inspect menu if pickup is chosen while item out of range, even after item is picked up. <br></p>
<br>
<h2>works for...</h2> <h2>works for...</h2>
<ul> <ul>
<li>player✓ </li> <li>player✓ </li>

@ -1,4 +1,4 @@
<p>Items - drops, drop table, floor items, base items, inventory items, move to pick up item, shift-move-to-pick-up-item, item spawner, item in container, item inspect, item use, dropping from inv <br></p> <p>Items are objects that may be picked up, purchased, used, equipped, dropped, or sold. They include currency, quest items, equipment, consumables, readables, upgrades, keys, and trinkets. <br></p>
<br> <br>
<h2>four representations </h2> <h2>four representations </h2>
<p>An item changes its form depending on its context. <br></p> <p>An item changes its form depending on its context. <br></p>
@ -22,4 +22,25 @@
<br> <br>
<p>If the item is within the player's <a href="/blessfrey-gdd/proxemics">intimate distance</a>, the character will be prompted to pick up the item. <p>If the item is within the player's <a href="/blessfrey-gdd/proxemics">intimate distance</a>, the character will be prompted to pick up the item.
<br> <br>
<p>Otherwise, pathfinding begins. <br></p> <p>Otherwise, <a href="/blessfrey-gdd/pathfinding">pathfinding</a> begins towards the floor item. Upon arrival, it calls item.pick_up().pick_up(). <br></p>
<br>
<h2>challenges/known issues </h2>
<p>I intend for the player to be able to pick up an item through the inspect menu without changing his current target. For now, InspectMenu.gd/set_subject(subject) sets the player target. MoveToDestination.gd/handle_moved_result tracks the user's current target using character/find_distance_to_target(). Instead, it would need to receive the relevant subject from the inspect menu or skill or attack target from the character and pass it through character/find_distance_to(target). <br></p>
<br>
<h2>works for...</h2>
<ul>
<li>add to wallet✗ </li>
<li>bestow constant keyword effect✗ </li>
<li>buy, sell✗ </li>
<li>container, randomized loot, take out, put in, persist in container✗ </li>
<li>drop from inv✗ </li>
<li>drop from death drop table✗ </li>
<li>equip✗ </li>
<li>inspect inventory item, floor item✗ </li>
<li>pickup in range, out of range, target, inspect✓ </li>
<li>progress quest, open door✗ </li>
<li>read✗ </li>
<li>spawn from spawner✗ </li>
<li>use✗ </li>
</ul>

@ -0,0 +1,30 @@
<p>Pathfinding programmatically moves an entity towards a point. <br></p>
<br>
<h2>move to pick up an item </h2>
<p>If an entity decides to pick up a floor item, UserControl.gd/pickup(floor_item) checks the range. If too far away, it will trigger MoveToDestination.gd/pickup_setup(floor_item). <br></p>
<br>
<p>Signals are disconnected, track is made true, 'item_arrived' signal is connected to UserControl/Move, and the goal target is set. <br></p>
<br>
<p>MoveToDestination.gd's Execute method constantly loops between path_to_point() and choose_velocity(). <br></p>
<br>
<p>path_to_point calls cancel on the player and path_to_object(goal_target). Mobile.gd/path_to_object(goal_target) sets the floor item as the next then reassesses the path with each call. If there is no current_dot, dots are set between the user and the goal_target and the method ends. Otherwise, the last_dot is either the last dot or the current_dot. If the goal hasn't moved, the method ends. If the goal is further, the path is wholly or partially recalculated. If the goal is nearer, the path is recalculated between the last_dot and the goal. <br></p>
<br>
<p>choose_velocity() sets the entity's body's internal velocity to current_dot - current_pos. mobileBody.gd/_process(delta) sets its physics_body_node's move_and_collide to velocity (judged from internal velocity) * speed * delta * KnowledgeBase.logic_time, publishing "moved" and the entity to the MessageBus. <br></p>
<br>
<p>The MessageBus's Moved.gd handler will judge progress and emit a signal. Since "reached", "arrived", etc are connected during MoveToDestination's Enter phase, handle_moved_result handles the package. If it is "arrived" and track is true, 'item_arrived' signal is emitted, the first waypoint is popped off, and the entity calls clear_movement. <br></p>
<br>
<p>MoveToDestination.gd/_on_item_arrived(floor_item) calls arrived to disconnect signals, set track to false, and clear the entity's movement. Then it calls item.pick_up().pick_up(). <br></p>
<br>
<h2>challenges/known issues </h2>
<p>Navigation2D and get_simple_path will be removed in a future version of Godot. <br></p>
<br>
<p>I intend for the player to be able to pick up an item through the inspect menu without changing his current target. For now, InspectMenu.gd/set_subject(subject) sets the player target. MoveToDestination.gd/handle_moved_result tracks the user's current target using character/find_distance_to_target(). Instead, it would need to receive the relevant subject from the inspect menu or skill or attack target from the character and pass it through character/find_distance_to(target). <br></p>
<br>
<h2>works for...</h2>
<ul>
<li>move to item then pick up✓ </li>
<li>move to target then attack✗ </li>
<li>move to target but don't attack✗ </li>
<li>move to target then interact✗ </li>
</ul>

@ -1,13 +1,22 @@
<p><ul> <p><ul>
<li><b><a href="/blessfrey-gdd/item">base item</a></b>: the core of data of an individual item. Floor items and inventory items contain a base item. </li> <li><b><a href="/blessfrey-gdd/item">base item</a></b>: the core of data of an individual item. Floor items and inventory items contain a base item. </li>
<li><b><a href="/blessfrey-gdd/pathfinding">current_dot</a></b>: (variable, StateMachine.gd) the immediate point the entity is pathfinding to in order to ultimately reach the goal_target. </li>
<li><b><a href="/blessfrey-gdd/proxemics">degrees(❥)</a></b>: (concept) the unit of social distance </li> <li><b><a href="/blessfrey-gdd/proxemics">degrees(❥)</a></b>: (concept) the unit of social distance </li>
<li><b><a href="/blessfrey-gdd/pathfinding">dot</a></b>: (variable, StateMachine.gd) a set of coordinates for a global position. </li>
<li><b><a href="/blessfrey-gdd/pathfinding">dots</a></b>: (variable, StateMachine.gd) the discreet path between points, esp. the entity and the goal target. </li>
<li><b><a href="/blessfrey-gdd/item">floor item</a></b>: </li> <li><b><a href="/blessfrey-gdd/item">floor item</a></b>: </li>
<li><b><a href="/blessfrey-gdd/pathfinding">goal target</a></b>: (variable, MoveToDestination.gd) It is set when the entity decides to pathfind and nulled during clear_goal(). mobile.gd/path_to_object(goal_target) is called from MoveToDestination every Execute loop to reassess the path between entity and goal. </li>
<li><b><a href="/blessfrey-gdd/inspect">inspect menu</a></b>: (UI) presents options for interacting with the subject </li> <li><b><a href="/blessfrey-gdd/inspect">inspect menu</a></b>: (UI) presents options for interacting with the subject </li>
<li><b><a href="/blessfrey-gdd/proxemics">intimate distance</a></b>: 45❥, declared at mobile.gd/intimate_space </li> <li><b><a href="/blessfrey-gdd/proxemics">intimate distance</a></b>: 45❥, declared at mobile.gd/intimate_space </li>
<li><b><a href="/blessfrey-gdd/item">inventory item</a></b>: </li> <li><b><a href="/blessfrey-gdd/item">inventory item</a></b>: </li>
<li><b><a href="/blessfrey-gdd/item">item</a></b>: varies in form depending on its context - base item, floor item, inventory item, merchandise </li> <li><b><a href="/blessfrey-gdd/item">item</a></b>: varies in form depending on its context - base item, floor item, inventory item, merchandise </li>
<li><b><a href="/blessfrey-gdd/item">merchandise</a></b>: </li> <li><b><a href="/blessfrey-gdd/item">merchandise</a></b>: </li>
<li><b><a href="/blessfrey-gdd/pathfinding">next</a></b>: (variable, StateMachine.gd) same as the goal_target. The current waypoint for the entity. </li>
<li><b><a href="/blessfrey-gdd/pathfinding">next_dot</a></b>: (variable, StateMachine.gd) the first item in the dots array that is not at the entity's global_position. </li>
<li><b><a href="/blessfrey-gdd/proxemics">personal distance</a></b>: 60❥, declared at mobile.gd/personal_space </li> <li><b><a href="/blessfrey-gdd/proxemics">personal distance</a></b>: 60❥, declared at mobile.gd/personal_space </li>
<li><b><a href="/blessfrey-gdd/proxemics">proxemics</a></b>: (concept) interentitic, mechanical distances </li> <li><b><a href="/blessfrey-gdd/proxemics">proxemics</a></b>: (concept) interentitic, mechanical distances </li>
<li><b><a href="/blessfrey-gdd/proxemics">social distance</a></b>: 90❥, declared at mobile.gd/social_space </li> <li><b><a href="/blessfrey-gdd/proxemics">social distance</a></b>: 90❥, declared at mobile.gd/social_space </li>
<li><b><a href="/blessfrey-gdd/inspect">subject</a></b>: inspect menu has a subject; inspect options will affect it </li>
<li><b><a href="/blessfrey-gdd/pathfinding">track</a></b>: (variable, MoveToDestination.gd) If the AI is pathfinding to a point or object, track is true. Upon arrived(), it is false. It is checked in handle_moved_result(result, entity).</li>
<li><b><a href="/blessfrey-gdd/pathfinding">waypoints</a></b>: (variable, StateMachine.gd) the list of selected points the entity will be traveling to. Usually a patrol route. </li>
</ul></p> </ul></p>

@ -5,7 +5,7 @@
<p>The vision for Blessfrey <br></p> <p>The vision for Blessfrey <br></p>
<br> <br>
<ul> <ul>
% for i in ["cast","credits","ID","inspect menu", "item","job","keyword","mechanics","Mercur","milestones","proxemics","setting","skill","story","style guide","terms","vibe","website"]: % for i in ["cast","credits","ID","inspect menu", "item","job","keyword","mechanics","Mercur","milestones","pathfinding","proxemics","setting","skill","story","style guide","terms","vibe","website"]:
<li class="list">{{random.choice(['.','•','☆','★'])}}&#9;<a href=/blessfrey-gdd/{{i}}>{{i}}</a></li> <li class="list">{{random.choice(['.','•','☆','★'])}}&#9;<a href=/blessfrey-gdd/{{i}}>{{i}}</a></li>
% end % end
</ul> </ul>

Loading…
Cancel
Save