Neptune’s Pride Battle Calculator v0.3

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:

version 0.1

version 0.2

Related posts:

  1. Neptune’s Pride Battle Calculator
This entry was posted in JavaScript, web and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

23 Comments

  1. Posted April 30, 2010 at 10:14 | Permalink

    Nice app….. I’m about to start tangling with an enemy, so this is useful.

  2. Brian
    Posted April 30, 2010 at 14:47 | Permalink

    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.

  3. Brian
    Posted April 30, 2010 at 15:14 | Permalink

    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.

    • admin
      Posted April 30, 2010 at 15:38 | Permalink

      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

  4. John
    Posted May 13, 2010 at 16:50 | Permalink

    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.

  5. Posted June 2, 2010 at 11:33 | Permalink

    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

  6. Homeowner
    Posted June 9, 2010 at 13:03 | Permalink

    Awesome, thanks.

  7. Golden Fleece
    Posted June 14, 2010 at 00:04 | Permalink

    Been using it for a few weeks now, it helps a lot. Thanks!

  8. Eric
    Posted June 19, 2010 at 05:20 | Permalink

    Awesome, thanks!

  9. Aliende
    Posted August 11, 2010 at 23:27 | Permalink

    Wonderful! It is so very helpful!

  10. Posted August 21, 2010 at 15:37 | Permalink

    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!

  11. Zack
    Posted September 4, 2010 at 03:20 | Permalink

    Great app. I just use it to double check my mental math… It works very well!

  12. Posted September 4, 2010 at 22:07 | Permalink

    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

    • admin
      Posted September 6, 2010 at 12:41 | Permalink

      Sure, Dave! Just glad my work is being used ;)

  13. Derekiv
    Posted September 15, 2010 at 19:01 | Permalink

    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!

  14. Omegatron
    Posted December 11, 2010 at 18:00 | Permalink

    This is really good, thanks for making it. Very useful for fine tuning your attacks and strategy!

  15. Yk
    Posted February 7, 2011 at 10:50 | Permalink

    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!

  16. Byron
    Posted May 16, 2011 at 12:55 | Permalink

    Thanks for making this, it definitely helps all of us who don’t want to do every single computation by hand.

  17. Kal
    Posted August 6, 2011 at 18:58 | Permalink

    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

  18. Jeremy
    Posted October 6, 2011 at 17:58 | Permalink

    Love the calc!!!

    How about a speed calc? 10h 20m ETA at speed 2. Speed 3 done in 4h. What’s the new ETA?

  19. ray
    Posted October 29, 2011 at 11:21 | Permalink

    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.

  20. Posted January 11, 2012 at 22:26 | Permalink

    Very cool calculator. I will use this to crush my co-workers!

  21. Posted January 15, 2012 at 22:48 | Permalink

    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.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>