I’ve upgraded the calculator a little, tinkered a bit with the design with a new header and some minor tweaks for better appearance, and managed to get the javascript to run in IE as well, thanks to a little help from saiboten.
What went wrong was as simple as using type=”text/javascript” for javascripts in stead of type=”application/javascript”. gah.
As allways, feedback is appreciated!
the new version is located here.
The old versions can still be found here if anything stops working for you:
Related posts:
23 Comments
Nice app….. I’m about to start tangling with an enemy, so this is useful.
Nice tool, very handy
Bug I noticed – I accidentally left the “Attacker WS” field blank on the “How many ships to win?” section. When I hit Go, Firefox froze. After a few seconds it said this:
“A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
Script: http://www.josteinb.com/npCalc/:88”
I suspect that the way it performs this calculation means that an entry of zero for WS causes it to go into an infinite loop. You should probably add a check to see that all the fields are filled in (and non-zero) before the script tries to calculate.
Oh and further to my previous post:
Same thing happens if you put -1 as Defender WS in the “How many ships to survive?” section, so it’s almost definitely an infinite loop caused by your algorithm repeatedly subtracting zero from the ship numbers.
Thanks
I was aware of the infinite loop on no input, but hadn’t tried the -1 one. It’s still there because of laziness.. haha. But I’ll get around to fix them shortly. I haven’t bothered with input validation yet since nothing gets stored, and it is safe for the server since javascript executes at client side. Not very nice towards the users though :p
Appreciate the feedback from both of you!
– Jostein
I really appreciate the calculator. I haven’t noticed any bugs through regular use and find that it’s quite fast. One suggestion would be a version that’s optimized for a thin view – that way Firefox’s “load in sidebar” would work well with the applet. It’s sort of annoying to have a tab open just for the calculator and having to switch back and forth – this would solve that issue. You’d have to design something without the (albeit very aesthetically pleasing) graphics and CSS. Something under 100px wide would probably be optimal.
Hello! I discovered this calculator for NP and fell in love with it immediately. Indesribably helpful. A very large thank you from a big NP fan from Greece!
Cubilone
Awesome, thanks.
Been using it for a few weeks now, it helps a lot. Thanks!
Awesome, thanks!
Wonderful! It is so very helpful!
Jostein, this is a nice calc. I own the domain http://www.npcalc.com and was intending to do pretty much the same as you have (I even have the site written) but you beat me to it…
Please contact me and I’d be happy to use the domain to point to your calculator!
Great app. I just use it to double check my mental math… It works very well!
Your calculator is a daily tool for me!
I run a Neptune’s Pride fan site at http://www.npfans.net and was wondering if you’d be open to allowing us to use the javascript from your site on a page over there? Obviously giving full credit and a link back to you.
My email is dave ( a t ) npfans ( dot ) net
Sure, Dave! Just glad my work is being used
A tool I might find interesting is a chain battle calculator. Like if I sent a fleet at a star, then my opponent sends a fleet . Could you make one that lets me enter both his initial and his backup fleet as well as my attack fleet?
My other idea was a way to incorporate a calculator of how many ships there will be in a certain time with a certain industry.
Thanks for your calculator!
This is really good, thanks for making it. Very useful for fine tuning your attacks and strategy!
Hey, great tool you’ve made here, use it a lot!
I second Derekiv’s idea of an Industry output calculator. Would be handy sometimes.
Again, thanks!
Thanks for making this, it definitely helps all of us who don’t want to do every single computation by hand.
I haven’t seen the Android App, but I have the one for iPhone. It’s split into 3 sections, the first is Battle calculator, like Single battle in yours, and since you have the extra 2 sections aswell yours is much more useful and quicker.
The second section is a ship calculator based on industry. While this is easy enough to work out, it gives you a percentage for the likelihood of that last ship being created within a certain timeframe.
The third gives costs for E,I and S for a star based on it’s resource number. Not used often, but now and again, especially for games with low resources/starting cash or expensive economies.
I guess not everyone would use these 2 options as much, but they’d be fairly simple to do…
Cheers for the work mate
Love the calc!!!
How about a speed calc? 10h 20m ETA at speed 2. Speed 3 done in 4h. What’s the new ETA?
The calculator is great; nice job. I was about to write one with excel and then I didn’t. My suggestion is to change “How many ships to survive?” to something like “How many ships to survive defense?” just to make it clear it applies to defense. I second the enhancements suggested here.
Very cool calculator. I will use this to crush my co-workers!
How about this for an addition: a “how often a ship is produced” calculator. It seems the 1 IND give you a ship every 12 hours, 2 IND gives you one every 6, etc. Create the equation so you can put in the IND number of a star and find out how often a ship is produced at that star.