#on screen radar

1 messages · Page 1 of 1 (latest)

severe aspen
#

👀

signal junco
#

@severe aspen so the entire thing was based on this html css file i found on github, and i figured it could be recontextualized to work with the uitoolkit pretty well

#

The way it works is that the system uses a script called "ThreatDetector.cs" to scan for nearby enemies and calculate their relative angle and distance to the player

#

Then you have "ThreatRadar" which is the uitoolkit element

#

gimme a sec

#

the way threatradar works is relatively simple and based on that previously mentioned html file, it procedurally generates the waves by modulating a base circles radius and opacity with Perlin noise centered on those detected angles

#

now the actual circle consists of segments

#

some 200 of them

#

so when its distorting and moving im just moving those segments, so its not actually continous, its entirely discrete

#

i have absouletely no clue what kind of effect this has on performance

severe aspen
#

Ah I was wondering about that. It looks pretty good.
Id say it depends how the noise is sampled

signal junco
#

im sampling the noise by passing the each segments angle and elapsed time into a perlin noise function

#

this gives a value between 0 and 1

#

which determines howthat specific part of the line wiggles at any exact moment

severe aspen
#

Makes sense. It looks great but I wonder if it would be also possible with a vector (if its possible to modify verts in those)

signal junco
#

honestly no clue

#

there could be a way

#

probably more efficient but this was the first thing i thought ofit

#

and it worked pretty well, only had 2 real iterations

#

you could also have like per vertex coloring allowing gradients

#

right now the color is pretty limited to just 1 and the opacity

#

i tried to add a more "noise" like distortion the closer enemies got, like making the line "panic" more but thats where the segment implementation falls apart because you can tell the line is just small segments and breaks the illussions

#

i would have to triple the segment count and at that point performance might actually start becoming a problem

severe aspen
#

I could see in the video gaps sometimes but its not that bad.
is that because the segments are not connected?

signal junco
#

yeah they arent

#

each segment is treated as a unique path

#

so each segment is its own individual "thing" placed on the outside radius of the circle

#

im still tweeking the amount of segments i need

#

but 200 seems fine with barely any performance overhead