Javascript Race Wizard |
Mon, 15 June 2009 21:51  |
|
sirgwain |  | Chief Petty Officer | Messages: 82
Registered: March 2004 Location: Tucson | |
|
Did someone post a link to a javascript RaceWizard? I seem to remember seeing it mentioned, but I can't find it in my searches of the forum.
Anyone have a copy of it?
Report message to a moderator
|
|
|
|
|
|
|
Re: Javascript Race Wizard |
Tue, 16 June 2009 14:39   |
|
craebild |  | Lieutenant | Messages: 568
Registered: December 2003 Location: Copenhagen, Denmark | |
|
That would be in C++, not Javascript. Still, AFAIK the logic and math commands are the same in C++ and Javascript, so the fact that I do not know C++ should not be a major obstacle.
You mention "calculating a bunch of planets". The code for the hab and econ calculator contains code for calculating the theoretical spread, i.e. the equivalent of averaging an infinite number of random planets.
If Stars! uses a sufficiently low number of planets, then that means that creating the same race twice could give different point totals in Stars!. I would suggest using the theoretical spread for any Stars! clone instead of a limited number of random planets. In my opinion, there is no need to reproduce the bugs in Stars! in a Stars! clone.
I haven't taken a look at the code you linked to yet, but I will - It might not be today, though.
Med venlig hilsen / Best regards / Mit freundlichen Grüßen
Christian Ræbild / Christian Raebild
Report message to a moderator
|
|
|
|
|
Re: Javascript Race Wizard |
Tue, 16 June 2009 16:46   |
|
m.a@stars |  | Commander | Messages: 2765
Registered: October 2004 Location: Third star to the left | |
|
craebild wrote on Tue, 16 June 2009 20:39 | You mention "calculating a bunch of planets". The code for the hab and econ calculator contains code for calculating the theoretical spread, i.e. the equivalent of averaging an infinite number of random planets.
If Stars! uses a sufficiently low number of planets, then that means that creating the same race twice could give different point totals in Stars!. I would suggest using the theoretical spread for any Stars! clone instead of a limited number of random planets. In my opinion, there is no need to reproduce the bugs in Stars! in a Stars! clone.
I haven't taken a look at the code you linked to yet, but I will - It might not be today, though.
|
That "equivalent of averaging an infinite number of random planets" is not done randomly at all. It's wholly deterministic for a given race design. 
Odds are it's not completely fair across all possible race designs, though, by giving more points to habs that aren't so much better than other hab schemes that get less points. 
So many Stars, so few Missiles!
In space no one can hear you scheme!  Report message to a moderator
|
|
|
|
|
|
|
Re: Javascript Race Wizard |
Wed, 17 June 2009 21:23   |
|
|
sirgwain wrote on Thu, 18 June 2009 04:20 |
for (h = 0; h < 3; ++h)
|
the difference between h++ and ++h the is order of the incrementing of h and evaluation of the expression as a whole:
++h increments h before the evaulation and thus affects the evaluation.(preinc)
h++ increments h after the evaluation and thus does not affect the evaluation.(postinc)
The simplest examples are:
h=1;
x=(++h);
//A
h=1;
y=(h++);
//B at both points (A&B) h has been incremented so h=2 but at A, x=2 and at B, y=1.
The third part of the for loop tuple is a statement to be run after each iteration. As a stand alone statement not included as part of a larger expression, both h++ and ++h have the same effect since the evaluation is never used - such as in a for loop.
[Updated on: Wed, 17 June 2009 21:30] Report message to a moderator
|
|
|
|
|
|
Re: Javascript Race Wizard |
Thu, 18 June 2009 18:36   |
|
|
sirgwain wrote on Fri, 19 June 2009 10:16 | My calculations appear to be slightly off. The standard humanoid race comes out at a value of 26, but when I change the cost of mines it is sways way more than the standard race wizard. This guy's race wizard appears to be more accurate:
http://www.gible.net/WebStars/WebStars%20-%20RW.html
Anyone know who's that is and whether the source is published somewhere?
|
Flash Race Wizard
author: ninja_squirrel (Andrew)
Abode Flash version of the Stars! race wizard.
Report message to a moderator
|
|
|
Re: Javascript Race Wizard |
Fri, 19 June 2009 11:15  |
|
sirgwain |  | Chief Petty Officer | Messages: 82
Registered: March 2004 Location: Tucson | |
|
I emailed his address and it bounced back. I did find a flash decompiler (for Mac even!) that allowed me to peruse a terribly obfuscated version of his source code and I determined that his logic was the same as the freestars logic. At the end he divided his advantage points by 3, which freestars was doing at a later step, and I did see it.
My code is mostly functional though a bit off. I think my planet hab calculations are to blame because making a tri-immune race comes out with the correct numbers.
Report message to a moderator
|
|
|