proposed alien vision change
roxxkatt
Join Date: 2014-12-28 Member: 200431Members
was talking to obraxis about a few changes, and sent some stuff to some CDT team members, but didnt get a response from them, and got a "not until 272 is out", and then a "not until 273" from obraxis, and he suggested i make a forum account and post in the meantime, so i made this topic.
i got into ns2 when i saw it in a humble bundle about a year ago iirc.
i have been programming for about 15-20 years now, and created my first shader last month after looking in ukes av and wanting more.
other people wanted more as well, so i made a few different av shaders, which then hit first page of steam workshops months most popular in a day, 3 months most popular in a week, and 6 months most popular in a month, and am currently page 2 and 3 of years most popular.
i basically only play alien team, so this is especially important to me.
there were a few things i wanted to implement in the shaders that were not possible within the constraints set by the lua.
my proposal: move some control out of the lua and into the shader, and into the hands of the modders (more easily)
this is not a request to change how the alien vision LOOKS, but how it WORKS, and it gives more control to the people making custom av.
it does this by passing more information about the world to the shader.
proposed changes:
the cdt teams trello has a lot of items regarding av, and this is a good move, as it allows people making av to instantly convey more information to the (alien) user, with no negative consequences, and it is a small, easy change to make and the change is completely invisible to the user.
however, it may be only be appreciated by people trying to make complex av shaders, of which there are really only a few, and for those who arent very good, i am more than willing to release a proof of concept example shader.
i got into ns2 when i saw it in a humble bundle about a year ago iirc.
i have been programming for about 15-20 years now, and created my first shader last month after looking in ukes av and wanting more.
other people wanted more as well, so i made a few different av shaders, which then hit first page of steam workshops months most popular in a day, 3 months most popular in a week, and 6 months most popular in a month, and am currently page 2 and 3 of years most popular.
i basically only play alien team, so this is especially important to me.
there were a few things i wanted to implement in the shaders that were not possible within the constraints set by the lua.
my proposal: move some control out of the lua and into the shader, and into the hands of the modders (more easily)
this is not a request to change how the alien vision LOOKS, but how it WORKS, and it gives more control to the people making custom av.
it does this by passing more information about the world to the shader.
proposed changes:
Alien_Client.lua line 540
if isLocal and self:GetIsAlive() then local darkVisionState = self:GetDarkVisionEnabled() if self.lastDarkVisionState ~= darkVisionState then if darkVisionState then self.darkVisionStartTime = Shared.GetTime() self.darkVisionEndTime=0 self:TriggerEffects("alien_vision_on") else self.darkVisionStartTime=0 self.darkVisionEndTime = Shared.GetTime() self:TriggerEffects("alien_vision_off") end self.lastDarkVisionState = darkVisionState end local useShader = Player.screenEffects.darkVision if useShader then local teamInfo = GetTeamInfoEntity(kTeam2Index) local bioMass = teamInfo and teamInfo.GetBioMassLevel and teamInfo:GetBioMassLevel() or 0 local maxBioMass = teamInfo and teamInfo.GetMaxBioMassLevel and teamInfo:GetMaxBioMassLevel() or 0 useShader:SetActive(alienVisionEnabled) useShader:SetParameter("on",darkVisionState and 1 or 0) useShader:SetParameter("time",Shared.GetTime()) useShader:SetParameter("starttime",self.darkVisionStartTime or 0) useShader:SetParameter("endtime",self.darkVisionEndTime or 0) useShader:SetParameter("alive",self:GetIsAlive() and 1 or 0) useShader:SetParameter("health",self:GetHealth()/self:GetMaxHealth()) useShader:SetParameter("armor",self:GetArmorAmount()/self:GetMaxArmor()) useShader:SetParameter("energy",self:GetEnergy()/self:GetMaxEnergy()) useShader:SetParameter("speed",self:GetSpeedScalar()) useShader:SetParameter("shield",self:GetHasMucousShield() and 1 or 0) useShader:SetParameter("bio",bioMass/maxBioMass) end self:UpdateRegenerationEffect() end
the cdt teams trello has a lot of items regarding av, and this is a good move, as it allows people making av to instantly convey more information to the (alien) user, with no negative consequences, and it is a small, easy change to make and the change is completely invisible to the user.
however, it may be only be appreciated by people trying to make complex av shaders, of which there are really only a few, and for those who arent very good, i am more than willing to release a proof of concept example shader.
Comments
the second reason I am making this topic is because I have never used lua before, and I would like to implement ALIENSPEEDPERCENT ALIENHEALTHPERCENT ALIENENERGYPERCENT by myself, which is not the real way of doing it in lua, so i can send the cdt team 100% finished code so that way the cdt team, which is apparently very busy, do not have to do it themselves, thereby lightening their load, and learning some lua and ns2 object structure in the process.
third topic:
a frequent idea brought up by players is a night vision goggles item available in the proto lab.
the code to make this happen already exists in the alien vision shader support, and would be easily ported by simply adding an item and another hlsl file.
would this be possible?
it seems the only negative would be people that argue that it could be overpowered.
forked to http://forums.unknownworlds.com/discussion/136383/marine-night-vision-goggles
fourth topic:
it seems that the vertex shader in the alien vision hlsl file is not used at all.
is there an example of its use anywhere?
fifth topic:
have some free av shaders
Original
Minimalistic
Blue+Green
Black
Black: Red
Black: Green
Black: Blue
(response to deleted post)
Ps you can use
i just made it a poll for shits and giggles, would be interesting to gauge how people feel about it
(response to edit)
good for transparency and etc
tried to get a trello box for this earlier and got beat down with the usual "approval process and etc" thing
https://trello.com/c/dLsN38ZK
it might be a good idea to add an armor percent variable as well
and if anyone knows where to find the shader for the batman arkham origins detective mode, that would be very helpful
Also, you can edit your posts, instead of making a new post every 20 minutes.
it would be nice to have a av changer similar to the one in ns2+ to be able to change to a specific av without having to reload map, possibly populated by hlsl files in a folder
OP even said it himself:
Making a community poll for this gave me a good chuckle.
I would like to see one more, the biomass level.
I think it would be nice if we start with a not so nice alien vision, like the current one and that each biomass level makes it look prettier.
One thing for sure, NS2 should really get a nice alien vision back so I don't have to play with those human eyes anymore.
and SELF.ALIENARMORPERCENT by Player:GetArmorAmount()/Player:GetMaxArmor()
and SELF.ALIENENERGYPERCENT by Alien:GetEnergy()/Player:GetMaxEnergy()
and SELF.ALIENSPEEDPERCENT by Player:GetSpeedScalar()
and SELF.ALIENBIOMASSPERCENT by AlienTeamInfo:GetBioMassLevel()/AlienTeamInfo:maxBioMassLevel()
and SELF.ISALIVE by Player:GetIsAlive()
is anyone who actually knows lua able to verify this?
do i have to use Player and Alien, or can i just use self? probably not for AlienTeamInfo?
does lua use ":" like java uses "."?
i added the SELF.ISALIVE for when the player is dead and spectating other people, will GetIsAlive() still return false while spectating someone else that is alive?
Also https://docs.google.com/document/d/1ZRUSV-Ajv_o4SGIe2t3X0nvsObBm2SRubDaeWd8Aroc/mobilebasic this is the lua conventions for NS2
local p=Client.GetLocalPlayer()
and then do
p:GetHealth()
1) is doing Client.GetLocalPlayer():GetHealth() valid?
2) is doing Player:GetHealth() valid?
3) is Player a reference to a class of some kind?
4) is ~= in lua same as != everywhere else?
5) in the context of Alien_Client.lua, what does self in self:function() refer to? where can it be found?
6) i updated the main post, is it still correct, are all the values still percentages, and will dead remain the same while spec?
8) what needs to happen to get the trello box moved to the "needs approval" column?
7) lol a typo in a function name: GetMuscousShieldAmount()
P.S. edit your existing posts and put extras at the bottom, no need to clog the thread up to generate discussion, the thread will do that itself.
Try to use quotes as often as possible then as this breaks up the screen more nicely and makes a more pleasant reading experience , anyways enough of forum etiquette, hope this gets put in eventually.
http://steamcommunity.com/sharedfiles/filedetails/?id=368314529
so as it turns out, doing something as simple as adding a few copies of a variable to a shader goes very deep into the game engine and causes lots of problems
i finally managed to get it running, but i suck at lua, so it is currently usable, but unplayable, as it has the curious effect of causing fps to slowly go down until it reaches < 1
however it still shows that it is possible, even if all the percents are ints instead of floats for some reason, and it doesnt turn off after turning on, even after switching to marine team
while in use, cpu and gpu use remain low/unchanged, so i am fairly certain the problem is in the lua somewhere
the only time metric i know about doesnt have enough granularity for me to do any worthwhile benchmarking to find the bottleneck
someone who knows what they are doing is going to have to go over this and figure out whats going on here
like why is Alien:UpdateClientEffects() run twice a frame instead of only once?
why does this thing stay active?
how does it stay active even after changing to marine team?
tl;dr it works and looks good, but something is horribly wrong, and its not done yet
however since servers check all lua files, i have not been able to see how it looks at 12 biomass instead of only 1, as the effects stack with biomass
...and i still suspect some floats are still ints
so if anyone reading this is a server owner, feel free to run this mod on your server to test it out and let me know
it doesnt affect gameplay at all
link again http://steamcommunity.com/sharedfiles/filedetails/?id=368314529
or Mod ID: 15f408a1
top 2 screenshots are at biomass 1 of 12, which is about 25% maximum effect, bottom 2 are at biomass 9, which is about 75%