kuro11 Posted February 8, 2017 Share Posted February 8, 2017 I couldn't find a way to display DPS/Ohms at a glance so I made this. Just put that in 'data/scripts/lib/tooltipmaker.lua' at line 360 (Should be right before 'return tooltip' within the 'makeTurretTooltip' function.) Video with description / install instructions better made than my two lines: Made a little spotlight video that your free to add and install instructions at the end. if turret.stoneEfficiency == 0 and turret.metalEfficiency == 0 then tooltip:addLine(TooltipLine(15, 15)) local multiShotMod = 1 if turret.simultaneousShooting then multiShotMod = math.pow(0.85,turret.numWeapons - 1) -- hack for multi-shooting weapons with heat issues? found with very poor sample size of a 'study' end local averageHeat = turret.heatPerShot * turret.shotsPerSecond - turret.coolingRate local hotFireTime = multiShotMod*turret.maxHeat*0.85 / averageHeat local coolTime = turret.maxHeat*0.85 / turret.coolingRate local modifier = 1 if turret.maxHeat > 0 then modifier = hotFireTime / (hotFireTime + coolTime) end local line = TooltipLine(lineHeight, fontSize) line.ltext = "N-DPS: " .. round(turret.dps * modifier,0) line.lcolor = ColorRGB(1.0, 0.7, 0.7) tooltip:addLine(line) local line = TooltipLine(lineHeight, fontSize) line.ltext = "S-DPS: " .. round(turret.dps * modifier * turret.shieldDamageMultiplicator,0) line.lcolor = ColorRGB(0.7, 0.7, 1.0) tooltip:addLine(line) local line = TooltipLine(lineHeight, fontSize) line.ltext = "H-DPS: " .. round(turret.dps * modifier * turret.hullDamageMultiplicator,0) line.lcolor = ColorRGB(0.7, 1.0, 0.7) tooltip:addLine(line) if turret.maxHeat > 0 then local line = TooltipLine(lineHeight, fontSize) line.ltext = "Hot Fire Time: " .. round(hotFireTime,1) line.lcolor = ColorRGB(1, 1, 1) tooltip:addLine(line) local line = TooltipLine(lineHeight, fontSize) line.ltext = "Cool Time: " .. round(coolTime,1) line.lcolor = ColorRGB(1, 1, 1) tooltip:addLine(line) local line = TooltipLine(lineHeight, fontSize) line.ltext = "HR/SPF/CR: " .. round(turret.heatPerShot, 1) .. "/" .. round(turret.shotsPerFiring, 1) .. "/" .. round(turret.coolingRate, 1) line.lcolor = ColorRGB(1, 1, 1) tooltip:addLine(line) elseif turret.shotsPerFiring > 1 then local line = TooltipLine(lineHeight, fontSize) line.ltext = "SPF: " .. round(turret.shotsPerFiring, 1) line.lcolor = ColorRGB(1, 1, 1) tooltip:addLine(line) end if turret.simultaneousShooting then local line = TooltipLine(lineHeight, fontSize) line.ltext = "Multifire: " .. turret.numWeapons line.lcolor = ColorRGB(1, 1, 1) tooltip:addLine(line) end end Here is what it looks like: http://imgur.com/a/RVw3C N-DPS is the nominal without mods S-DPS is shield DPS H-DPS is hull DPS Hot Fire Time is how long the gun will shoot after one overheat->cooldown cycle while holding the trigger Cool Time is how long the gun will shoot after one overheat->cooldown cycle while holding the trigger HR/SPF/CR: HR = heat gained per bullet/heat rate, SPF = shots per pull of trigger, CR = cooling rate Multifire = #, the number of barrels that fire in one pull of trigger I was able to make some really odd turrets like a SPF of 3 on a Multifire of 4 to fire 12 rounds each trigger bull. SPF is like the "burst fire" and Multifire is where all the bullets come out at once. Anyway, not guaranteed to work 100%, but it at least gives you an easy glance approximation. Likely easily applied to fighters because turrets and fighters share so many of the same properties. but I don't use them, so... :P Code under WTFPL tooltipmaker.zip Link to comment Share on other sites More sharing options...
LordMaddog Posted February 8, 2017 Share Posted February 8, 2017 O WOW THANK YOU!!!! Testing it now. Link to comment Share on other sites More sharing options...
LoSboccacc Posted February 9, 2017 Share Posted February 9, 2017 Can you also add dps adjusted with cooldown directly on the lines there? It's nice to know the dps at regime while holding the mouse button down, especially for cannons that overheat every burst. Link to comment Share on other sites More sharing options...
WARGAMES Posted February 9, 2017 Share Posted February 9, 2017 my question would be is this showing the actual dps when double, triple or multishot are all added in. in some cases that more than one barrel seem to not do more but others have multiple shots instead. Link to comment Share on other sites More sharing options...
kuro11 Posted February 9, 2017 Author Share Posted February 9, 2017 DPS listings take into account both cooldown times AND multi-barreled / "burstfire" and whatever combination thereof. Or, should be somewhat accurate - it is designed to do that (no warrenty on it REALLY doing that) Link to comment Share on other sites More sharing options...
WARGAMES Posted February 9, 2017 Share Posted February 9, 2017 I heard some barrels aren't more than 1 shot but others show it is for some dps stats. is it just the energy weapons that more than one barrel don't mean anything? because then it may clear up some things. Link to comment Share on other sites More sharing options...
Kane Hart Posted February 9, 2017 Share Posted February 9, 2017 Thank god this has been finally made. thank you so much :) Link to comment Share on other sites More sharing options...
lyravega Posted February 9, 2017 Share Posted February 9, 2017 DPS listings take into account both cooldown times AND multi-barreled / "burstfire" and whatever combination thereof. Or, should be somewhat accurate - it is designed to do that (no warrenty on it REALLY doing that) maxHeat can go over 10; if you have a cannon that generates 9.5 heat per shot for example, 2nd shot will take it up to 18. The game has 2 variables called shootingTime and coolingTime but due to this the latter is incorrect. Depending on the cooldownRate, shootingTime wildly varies as well but they both can be used for approximations. Link to comment Share on other sites More sharing options...
kuro11 Posted February 9, 2017 Author Share Posted February 9, 2017 @WARGAMES All visuals aside, the key to DPS calc from my testing (again, not 100% confident) are two things: * "simultaneousShooting" * "shotsPerFiring" These two properties are represented as "Multibarrel" on the bottom and "SPF" respectively in this mod. I forced all combinations of those two on testing. An easy example are cannons, which seem to have a higher incidence of "Multibarrel"- when you click once there are X bullets that appear at once. SPF > 1 represents the "burstfire" So, in this gun (an odd case): http://i.imgur.com/C5eoF6C.png There are 9.4 Damage projectiles. A "Fire" occurs 2 times per second. And Multifire = 3 Thus, 9.4*2*3=56.4 visual. The "TurretTemplate" type itself has a "dps" property, which is displayed as the N-DPS value (from what I see, this is likely more accurate than calculating it myself each time based on shots and stuff) (rate of fire, damage are rounded in the UI AND I round the DPS - so that is why we have that 56.4 vs 58) Thus, you get - at a glance - reasonable DPS with all factors accounted for. This includes heat, which is significantly trickier to deal with and before this mod you had basically NO idea how much that factored into a weapons effectiveness. @lyravega That is a really good point - I don't take that into account. I did find a really strange thing ('addressed' by the hack comment in the code) where multibarrel weapons heat up MUCH faster (at 4 barrels - with simultaneousShooting == true ) than expected. Cooldown times were (in the cases I tested, about 20-50 guns generated with /inventory mod) very close to expected in all cases - it was only the getting to overheat that seemed to behave strangely. However, these numbers are accurate enough for me thus far so I don't think I'm going to try and improve them at the moment (I want to actually play the game :P) Link to comment Share on other sites More sharing options...
lyravega Posted February 9, 2017 Share Posted February 9, 2017 @lyravega That is a really good point - I don't take that into account. I did find a really strange thing ('addressed' by the hack comment in the code) where multibarrel weapons heat up MUCH faster (at 4 barrels - with simultaneousShooting == true ) than expected. Cooldown times were (in the cases I tested, about 20-50 guns generated with /inventory mod) very close to expected in all cases - it was only the getting to overheat that seemed to behave strangely. However, these numbers are accurate enough for me thus far so I don't think I'm going to try and improve them at the moment (I want to actually play the game :P) Each weapon ("barrel") generates that much heat, so if simultaneousShooting==true then heatPerShot=2 actually generates 8 heat for that turret as all weapons are fired at the same time. cooldownRate is for turret so it is what you see unlike heatPerShot. And I get you. I've been working on my tooltip thing for a while, now just wanna play the game :) Link to comment Share on other sites More sharing options...
Kane Hart Posted February 9, 2017 Share Posted February 9, 2017 Made a little spotlight video that your free to add and install instructions at the end. Link to comment Share on other sites More sharing options...
kuro11 Posted February 9, 2017 Author Share Posted February 9, 2017 @Kane Hart Neat. I feel internet famous now 8) I'll put that video in the OP since it helps people install it. Not a big fan of having a download / overwrite of the whole script - but if that is the standard at the moment I'll go ahead and do so. Ideally, the dev will allow for decoration of methods as a separate file - much reducing the chance of an update / conflicting mod breaking things. (New to LUA, normally in C# land so I don't know how reasonable that is. Disclaimer my knowledge on that front is ~5 minutes google to here: http://lua-users.org/wiki/DecoratorsAndDocstrings ) Link to comment Share on other sites More sharing options...
Kane Hart Posted February 9, 2017 Share Posted February 9, 2017 Yeah I agree your method is better but then again you have to sometimes put your shoes in theirs. I prefer your method but then 80% of people will have more issues with it sadly till modding gets a bit of a fix. That being said is the n-dps for example counting the cooldowns and such? Someone kept saying they did not think it did in the video and found it useless and did not want to lie in the comments with a reply on it hehe. Link to comment Share on other sites More sharing options...
kuro11 Posted February 9, 2017 Author Share Posted February 9, 2017 It SHOULD be taking into account cooldown time loop. e.g. A gun that shoots 1 damage bullets 3 times per second with a Cool Time of 5 seconds and a Hot Fire Time of 2 seconds The calculator would show: 1*3 * ( 2 / (2+5) ) ~= 0.85 DPS (it would round but whatever) In your demo video, the gun does: 196.7 Damage per bullet 24 times per second with a Cool time of 1.8 and a Hot Fire Time of 0.8 that means: 196.7 * 24 * ( 0.8 / ( 0.8 + 1.8 ) ~= 1452 Now, it IS different than the 1521 displayed there in the video, but likely because the display values are not the full (unrounded) values. Also, I use the "dps" property of the weapon provided by the engine as I assumed it is more accurate. Still, that is like a 6% error depending on how I calculate it - still valid for apples to apples and since all guns are calculated the same way you at least know if one gun is better than the next (except Multi fire > 1 and overheating - which, as mentioned, is odd/hacky in how I 'solved' it) Link to comment Share on other sites More sharing options...
Kane Hart Posted February 10, 2017 Share Posted February 10, 2017 I wish this mod could do something with Power ones like say WARNING SHITTY WEAPONS DETECTED lol.. So many power lasers I get can't even run more then 2 seconds hehe. Link to comment Share on other sites More sharing options...
kuro11 Posted February 10, 2017 Author Share Posted February 10, 2017 The only things I can think of that are not already part of the UI would be something like: "Power draw: 1/10/30 (MW)" i.e. show how much power the gun draws after 1 second, 10 seconds, and 30 seconds of continual firing. Also, maybe "1MW N-DPS: xyz" i.e. show what the DPS would be if you wanted to keep the power draw at 1MW (e.g. at 1 second fire rate) So if you wanted to stutter fire manually you'd know what the DPS would be. I don't see a way to get the current ship's power draw - and that might not be useful anyway with many guns. Power management is hard to relate without taking into context things like systems. Any other ideas's you'd to see? Both of those are kinda meh in terms of usefulness in my opinion, so not really sold on the effort. Link to comment Share on other sites More sharing options...
Kane Hart Posted February 10, 2017 Share Posted February 10, 2017 Yeah I would not know the best method tbh. I just wish I could easily tell if a weapon sucks bad enough for power usage. I really need to pay attention I guess to my own ships power storage etc. I always just add it to my ship and like NOOOOPE lol and remove it. Link to comment Share on other sites More sharing options...
Crazey Wayne Posted April 9, 2017 Share Posted April 9, 2017 Is this server side only? Link to comment Share on other sites More sharing options...
Azulius Posted January 24, 2018 Share Posted January 24, 2018 it appears that it is not line 360 anymore, i think is 655 now ( in 0.15.8 ) Link to comment Share on other sites More sharing options...
Azulius Posted January 24, 2018 Share Posted January 24, 2018 something weird is going on. i had to re download some files, i went back to this file and it have only 471 lines now, when i pasted this to line 655 before it was working, but now what should be in line 360 appears to be in 363. Link to comment Share on other sites More sharing options...
T4Ken Posted February 23, 2018 Share Posted February 23, 2018 does it work with this change ? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now