Jump to content
Xena_Dragon

Player-Owned Ports: Voyage Calculator

Recommended Posts

Okay, so finally after experiencing problems with this calculator for quite some time now, I've finally decided to come to the forums for help. Okay so a while back probably a few weeks to a month ago, when I used the calculator after I'd type in what was necessary for my voyage and hit calculate the whole calculator would freeze the page (As in I couldn't scroll up or down) while it calculated the voyage. Now lately when I've been using the calculator, it has stopped freezing the page when I click calculate and I'm able to scroll down the page but the calculator takes FOREVER.

 

Also not to mention, when the calculator has finished calculating my voyage, it now completely freezes the page in definitely and I end up having to close out the tab and re-open a new one and start the process all over again.

 

Hi TearGod, I'm fairly sure that the calculator is expected to freeze the page while it is calculating. Mine has always froze during that time and I am also unable to scroll. However, I never have any issues once it is finished with the calculations. If you have four ships, the first calculation takes a bit of time but it gets faster when you have less ships to check. I'd suggest just clicking on the tab to start the calculation and just wait it out before scrolling or clicking anything. Perhaps that will help. I'm sure Xena_Dragon will be notified and will get you all fixed. Good luck! :D

Share this post


Link to post
Share on other sites

The calculator freezing during a calculation is normal and to be expected. You can speed up the calculation in two ways:

1) When you can expect a certain crew member to be included in the result, use the 'force' checkbox to force that crew member to be included.

2) When you can expect a certain crew member to *not* be included in the result, uncheck the 'available' check box for that crew member. Do remember to set it back to available later of course.

 

Other than that I have no tips for you. The calculator has been tested on numerous platforms, and numerous browsers, and it always behaves the same. It takes some time to calculate voyages when lots of crew members are available, and speeds up as you assign crew to a ship and perform the calculation for the next ship, etc.


Xena_Dragon.png

Share this post


Link to post
Share on other sites

Thanks, Xena. Calculating always takes time. Glad you confirmed it. Great job, as always! :thumbsup:

Share this post


Link to post
Share on other sites

I love this calculator. Thanks so much!

 

However, since the last time it was updated (Feb 13, 2015 apparently), it's not been 100% accurate in its results. After triple checking that all my input is correct, I started looking through the code.

 

Let me first say, WOW that's a lot of variables!!

 

At line 444, you have this:

 

//Bonus %
moraleBonus = 1;
combatBonus = 1;
seafaringBonus = 1;
Then a bunch of if's for each of the different shipwrights. The first thing I noticed was ship #6 (which the select has as "luxurious") says this:

if (shipw == 6)
{
	moraleBonus = 1.05;
	combatBonus = 1.03;
	seafaringBonus = 1.03;
}
That's correct based on the game's description of Luxurious: Boosts ship stats by 3% + Boosts Morale stat by an additional 2%, so

Luxurious = Morale +5%, Combat +3%, Seafaring +3%.

 

However, percentages for numbers 8, 9 and 10 ("Ostentatious", "Battleship", and "Maritime", respectively) appear to be backwards (i added the comments myself):

if (shipw == 8) // ostentatious
{
    moraleBonus = 1.03;
    combatBonus = 1.05;
    seafaringBonus = 1.05;
}
if (shipw == 9) // battleship
{
    moraleBonus = 1.05;
    combatBonus = 1.03;
    seafaringBonus = 1.05;
}
if (shipw == 10) // maritime
{
    moraleBonus = 1.05;
    combatBonus = 1.05;
    seafaringBonus = 1.03;
}
 

Or...

Ostentatious = Morale +3%, Combat +5%, Seafaring +5%.

The problem is, Ostentatious' in game description says "Boosts ship stats by 5% and Morale by and Additional 3%.

 

To me that means:

Ostentatious = Morale +8%, Combat +5%, Seafaring +5%.

 

 

So yeah, just thought i'd point it out :) Thanks again for all the hard work you all do :)

 

(Also, not sure why the colors in the code sections look all weird, sorry about that.)

  • Like 1

Share this post


Link to post
Share on other sites

 

 

 

I love this calculator. Thanks so much!
 
However, since the last time it was updated (Feb 13, 2015 apparently), it's not been 100% accurate in its results. After triple checking that all my input is correct, I started looking through the code.
 
Let me first say, WOW that's a lot of variables!!
 
At line 444, you have this:
 

//Bonus %
moraleBonus = 1;
combatBonus = 1;
seafaringBonus = 1;
Then a bunch of if's for each of the different shipwrights. The first thing I noticed was ship #6 (which the select has as "luxurious") says this:
if (shipw == 6)
{
	moraleBonus = 1.05;
	combatBonus = 1.03;
	seafaringBonus = 1.03;
}
That's correct based on the game's description of Luxurious: Boosts ship stats by 3% + Boosts Morale stat by an additional 2%, so
Luxurious = Morale +5%, Combat +3%, Seafaring +3%.

However, percentages for numbers 8, 9 and 10 ("Ostentatious", "Battleship", and "Maritime", respectively) appear to be backwards (i added the comments myself):
if (shipw == 8) // ostentatious
{
    moraleBonus = 1.03;
    combatBonus = 1.05;
    seafaringBonus = 1.05;
}
if (shipw == 9) // battleship
{
    moraleBonus = 1.05;
    combatBonus = 1.03;
    seafaringBonus = 1.05;
}
if (shipw == 10) // maritime
{
    moraleBonus = 1.05;
    combatBonus = 1.05;
    seafaringBonus = 1.03;
}
 
Or...
Ostentatious = Morale +3%, Combat +5%, Seafaring +5%.
The problem is, Ostentatious' in game description says "Boosts ship stats by 5% and Morale by and Additional 3%.
 
To me that means:
Ostentatious = Morale +8%, Combat +5%, Seafaring +5%.
 
 
So yeah, just thought i'd point it out :) Thanks again for all the hard work you all do :)

(Also, not sure why the colors in the code sections look all weird, sorry about that.)

 

 

 

 

 

Done - was that all that was needed, or are there other things...? I was under the impression that it was a bit more complicated, but if that was all cheers, and sorry it took a bit! :)


"Fight for what you believe in, and believe in what you're fighting for." Can games be art?

---

 

 

cWCZMZO.png

l1M6sfb.png

My blog here if you want to check out my Times articles and other writings! I always appreciate comments/feedback.

Share this post


Link to post
Share on other sites

Yeah, I think that's it. The percentage was the only thing I could find that was incorrect, and my numbers are matching now.

 

Thanks so much! :)

 

 

Also, if I were able to come up with a more efficient `calculator` function, could I post a link to it here? I'm working on one, but haven't finished it yet. I'll post run time complexity on both... Just curious. :)

Share this post


Link to post
Share on other sites

Sure, you can feel free to post it (or PM me). My impression was that it was looked into before, but if there is a way to improve it without tearing the whole code apart..I'm open to suggestions :D.


"Fight for what you believe in, and believe in what you're fighting for." Can games be art?

---

 

 

cWCZMZO.png

l1M6sfb.png

My blog here if you want to check out my Times articles and other writings! I always appreciate comments/feedback.

Share this post


Link to post
Share on other sites

Hi,

 

I just started using this calc after it was mentioned ingame and I've noticed that some crew members are missing such as the drowned ghost. I've also noticed that the values for some crew members aren't correct at their level, usually by about 20 or 30 or so. Is there any way to add this info or suggest additions?

 

Also is it possible for the crew listing to be alphabetical to make it easier to find various crew members? If the current order is there for a reason, that's fine, but what is it?

 

Thanks :-)

Share this post


Link to post
Share on other sites

Random low-priority bug report.

 

Calc got me 16333 M / 16183 S for 20485 M/S voyage, and called it 79%.

 

16183/20485 = 0.78999267756...

 

Jagex apparantly rounds (well floors) this down to 78%, while calc rounds up to 79%.

 

I'm too tired to check the source code, but I'm pretty sure that JS arithmetic is precise enough to handle that.

 

 

Also regarding the algorithm/efficiency discussion above -- last time I read the source code looking for ways to improve it (which admittedly may have been over a year ago), I remember that, although it is written with the obviously inefficient brute-force algorithm, it was very well optimized, and I really not sure if there is a better algorithm.


Pdj.png

[02] -RuneScript- *** [ END ]: You gained 444,384 prayer exp in 5secs. That's 319,956,480 exp/h.

Share this post


Link to post
Share on other sites

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...

Important Information

By using this site, you agree to our Terms of Use.