Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight collectible resources, take 2 #37

Merged
merged 26 commits into from
Mar 22, 2023

Conversation

nucleartide
Copy link
Owner

@nucleartide nucleartide commented Mar 21, 2023

Job Story

Player: When I am facing a collectable resource in collectable range, I want to see the resource display an E above it (as well as an outline), so that I know that this resource can be collected by pressing E.

Notion

Provide a link to the Notion block corresponding to this job story.

(Sorry folks, these blocks are internal to my Notion workspace!)

https://www.notion.so/nucleartide/Player-When-I-am-facing-a-collectable-resource-in-collectable-range-I-want-to-see-the-resource-dis-9296858040dc4fa8bfeef710211d6848?pvs=4

Development Checklist

Run through the following steps to complete your work.

  • First draft. Implement a working first pass at the problem.
  • TODO: Draw an E, then move it to the closest raycast hit
  • Final draft. Once done, perform a general review of Files changed and revise anything that needs to be cleaned up.

Quality Assurance Checklist

Ensure that your work adheres to the following principles.

  • Modular. Are you touching the scene file? If so, can you limit your changes to prefab files instead?
  • Editable. Has any configuration been moved into ScriptableObjects, so that modified values persist even after exiting Play mode?
  • Debuggable. Do you have debug views for the prefabs/systems that you are creating?
  • Learnable. Consider how the player will learn what you implement in this pull request. Are the affordances appropriately communicated with signifiers?

Screen Recording

Record a quick 5 to 10 second clip of your feature in action.

Untitled.mov

Changelog

Provide a bulleted list of changes that were made in this pull request.

  • Add a PlayerCollectableRadius script that checks for collectibles within range, and highlights them
  • Update resource prefabs with colliders
  • Some refactoring
    • Delete some unused files
    • Ensure scene consists of only prefabs so work can proceed without touching the scene file. This is important for teamwork.
    • Convert MonoBehaviours (that don’t need to see the entire Unity lifecycle) into ScriptableObjects
    • Revise pull request template so I can work faster next time

How it works

Explain what you did, how you did it, and why you did it. Discuss any lessons that might be useful to others.

(Note to self: it's easiest to do a stream-of-consciousness write-up of what you did.)

This pull request adds a “signifier” for in-game resources that are collectible by the player.

In other words, the game will now outline (in green) nearby resources that can be collected.

The resource that the player is facing directly will also display an “E” text overlay, to signify that you can press “E” on your keyboard to collect the resource.

The work for this pull request took a lot longer than I expected. There were a couple of phases of work:

  1. Figuring out how to render outlines in Unity
  2. Learning the concepts behind URP, ShaderGraph, URP shaders, and HLSL
  3. Deciding to give up and use a rock-solid library called UnityFx.Outline (/~https://github.com/Arvtesh/UnityFx.Outline)
  4. Once the feature was done, refactoring my scene file so that I could develop in a more modular way in the future

Though it took awhile, I’m glad that I’m now familiar with Unity’s URP, and that this pull request process is becoming more effective at enforcing quality.

Creating “signifiers” for future user stories should be a lot faster.

Final Checklist

Perform some final tasks for sign-off.

  • Update readme with new pull request

@nucleartide nucleartide marked this pull request as ready for review March 22, 2023 22:53
@nucleartide nucleartide merged commit 2a0ebf4 into master Mar 22, 2023
@nucleartide nucleartide deleted the jason/highlight-collectible-resources-take-2 branch March 22, 2023 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant