Giter VIP home page Giter VIP logo

newwby / godot-offscreen-indicator-manager Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 21 KB

Scene and script for Godot that handles automatically setting offscreen indicators for enemies; at-screen-edge sprites that point toward the direction of the enemy relative to the player and allow for the player to know where enemies are, even when they cannot see the enemy.

License: MIT License

GDScript 100.00%

godot-offscreen-indicator-manager's People

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

boyquotes r2d2m

godot-offscreen-indicator-manager's Issues

performance review

  • add check for if enemy is offscreen before handling indicator (see potential implementations in #7 )
  • get some profiler benchmarks

unit testing

implement basic unit tests for

  • adding indicators
  • validating inactive indicators exist
  • transferring inactive indicators to active
  • removing indicator attachments
  • pruning/cleaning the indicator target record

Release Draft

  • Full Documentation of Configuration Options
  • Reddit Post Draft

Define custom indicators

  • Attach script to indicator sprite nodes with custom exports
  • Use trailing affixes on the add_to_indicator_overlay grouping string to determine chosen indicator node
  • Create metagroup from different indicator grouping strings at _process/runtime
  • Update object pooling to handle multiple indicator node types
  • Add indicator sprite node property: groupstring
  • Add indicator sprite node property: edge offset (override constant)
  • Add indicator sprite node property: is_rotating (override constant)

Camera Node Setup

  • Attempt at automatic get_viewport().get_camera() call
  • Link to signal active camera change, if 'current' property unset
  • Implement signal if camera node changes for any other reason
  • Implement signal if camera node current changes - get_viewport().get_camera()
  • Implement signal if camera zoom changes, call update_overlay_bounds()
  • Implement setter for camera node update, call update_overlay_bounds()

Demo Project

Need to develop and include demo project that doesn't include my own game assets

Refactor get_center() method

Currently get_center() uses an invisible sprite, a holdover from the KCC minimap/radar implementation
(would also avoid problems of getting the top-left set anchor)
Simpler to just get the centerpoint of the indicator root ui canvas' rect2D

revised player node setup

  • player node designatable by node path in-editor, aka export(package)
  • add commenting on setting up player node by code

Indicator magnitude/intensity with distance

  • Calculate offscreen magnitude; offscreen_clamp relative to overlay radius (the halfdist, or edge to player distance)
  • Saturation tweening based on offscreen magnitude (2.0 at 0%, 1.0 at 100% or less, scaling down thereafter)
  • Alpha tweening based on offscreen magnitude (0.5 at 0%, 1.0 at 100% or less, scaling down thereafter)
  • Scale tweening based on offscreen magnitude (2.0 at 0%, 1.0 at 100%, scaling down thereafter)

visibility property hardcode

  • add const string for hardcoding what property to check as part of determining whether node is on screen or not

(default property 'visible' but using that base class property instead of (as it is in my game's implementation) something customised like 'is_onscreen' means some peculiar edge cases could arise where the base property is altered as part of another system's behaviour).

  • alternatively check child nodes for if there's a visibility notifier node, and use is_on_screen() method if found

Commenting Tidy-Up

  • Remove notes previous repo todos
  • Remove reference to own game's singleton structure (globalPool, globalDebug, etc)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.