Jump to content

Recommended Posts

How to implement a `widget` or `screen` that visualizes sanity aura with a color transparency? For example, for a given map location, calculate the sanity aura of that location by looking around within some radius objects that has sanity aura, and calculate the aura at that spot, and convert that into transparency ratio (alpha number), than overlay a color (say purple) on that spot? Should be possible to do in DS and DST without host and client only. Seems like an interesting idea.

Hmm, it's an interesting idea. I'm unfortunately inept when it comes to adding anything visually to the game, but on a code level I would think it'd just be easier to identify what level of sanity aura they have and then tie the "aura ring" size to that. There is no physical aura to base it off of since the game only calculates how close you are to a particular object in order to determine your sanity gain/drain, but if you know what type/how potent their sanity aura is you can just assign them a "ring" based on that.

There's 10 different aura levels, 5 for sanity and 5 for insanity, so you'd just have to make 5 different sized circles and then color code them as you wish. Maybe someone with better knowledge of adding assets to the game will be of more help as far as how to execute that tho :\

Well I was only saying rings as an example, but the point I was trying to make is that there is no "stacked aura" to see. There is no physical thing in the game world you can change its opacity to in order to see what sanity aura something has. All the game does is detect whether or not you're within a certain radius of a particular object, if you are, do a fraction of the aura depending on how close you really are.

As far as actually being able to see the aura, you're going to have to implement your own visual aid. The reason I suggested doing it based on their potency of aura is because you know there's only 5 levels you need to track, each having their own static range and levels. If you can determine the distance needed for all 5 of those levels, you have yourself a measurement for your visual aid.

On 10/16/2017 at 9:26 AM, w00tyd00d said:

Well I was only saying rings as an example, but the point I was trying to make is that there is no "stacked aura" to see. There is no physical thing in the game world you can change its opacity to in order to see what sanity aura something has. All the game does is detect whether or not you're within a certain radius of a particular object, if you are, do a fraction of the aura depending on how close you really are.

As far as actually being able to see the aura, you're going to have to implement your own visual aid. The reason I suggested doing it based on their potency of aura is because you know there's only 5 levels you need to track, each having their own static range and levels. If you can determine the distance needed for all 5 of those levels, you have yourself a measurement for your visual aid.

The sanity's ratescale is just for use on the sanity icon itself.

 

Otherwise it's a function based on the distance from the player to the source given via:  (someentity).components.sanityaura:GetAura((theplayer)) / math.max(1, (theplayer):GetDistanceSqToInst((someentity)))

Or in simpler terms: (negative sanity rate per second) / (distance between the player and entity squared or 1.0- whichever is higher)

 

This leads to a gradient of sanity loss of up to 10 in-game units before it actually stops, but more strongly near the object than not, with a plateau at or less than 1 unit away.

UqorU2J.png

 

As for the OP to do this with a mod, the mod will need to know the actual aura values from each which as far as I know aren't networked to the client, just the delta sanity ticks.

So you'd need to create a client table of all the values for every prefab or have the server network them, then create some gradient image on each entity that has it projected to the ground based on the intensity of each- it's not linearly as powerful so in the image make it exponentially darker the further it goes out and then you can linearly increase the intensity of the image.

 

For making your own infographics on the sanity ranges and such, you may just write a simple script on the server to iterate over points that you want in a grid fashion, polling for all entities within 10 units and check if they have the sanity aura component and get its sum value, and then printing out the value.

Then using these points plot it out using some spreadsheet program or 3D plotter to get some representation of it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...