Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » FreeStars » Race Wizard almost done (but not quite)
Race Wizard almost done (but not quite) Thu, 04 November 2004 08:56 Go to next message
icebird is currently offline icebird

 
Chief Warrant Officer 3

Messages: 178
Registered: September 2003
Location: In LaLa land...
I'v got a spreadsheet that fairly closly replicates most of the race wizard, except for decreasing the hab ranges. Unfortunatly, nearly every race needs to do this, so it's an important thing for me to fix soon.

None the less, if someone has a website that could host this file, please let me know and I'll send it to you. I feel it important that even if my computer crashes, this not be lost. Afterall, I'v put a lot of work into it so far.



-Peter, Lord of the Big Furry Things

Report message to a moderator

Re: Race Wizard almost done (but not quite) Thu, 04 November 2004 09:16 Go to previous messageGo to next message
LEit is currently offline LEit

 
Lt. Commander

Messages: 879
Registered: April 2003
Location: CT
I'll put it on SourceForge. Send it to me at: 9jm0tjj02 sneakemail com.

[Updated on: Thu, 04 November 2004 09:19]




- LEit

Report message to a moderator

Re: Race Wizard almost done (but not quite) Thu, 04 November 2004 18:24 Go to previous messageGo to next message
ForceUser is currently offline ForceUser

 
Lt. Junior Grade
Stars! Nova developer
Stars! Nova developer

Messages: 383
Registered: January 2004
Location: South Africa
Well.. since I have a site, and all the freestars graphics, I might as well host it too Wink Send it to me at user dot force at gmail dot com

Thanx
ForceUser




"There are two types of people in the world. AR players and non-AR players" Nick Fraser

Working on some new stuff: http://sourceforge.net/apps/mediawiki/stars-nova/index.php?t itle=Graphics
And the Mentor Database www.groep7.co.za/Mentor/ ZOMGWTFBBQ!! it still works lol!
Check out my old site with old pics at www.groep7.co.za/Stars/

Report message to a moderator

Re: Race Wizard almost done (but not quite) Tue, 09 November 2004 20:24 Go to previous messageGo to next message
TomT64 is currently offline TomT64

 
Petty Officer 3rd Class

Messages: 45
Registered: August 2003
If you get this hosted please post links!


- TomT64
GStars! - A FreeStars Client (currently dead)
http://gstars.sf.net/

Report message to a moderator

Re: Race Wizard almost done (but not quite) Tue, 15 March 2005 08:06 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2755
Registered: October 2004
Location: Third star to the left
Hi,

icebird wrote on Thu, 04 November 2004 14:56

I'v got a spreadsheet that fairly closly replicates most of the race wizard, except for decreasing the hab ranges.


As some people may already know, there's been recent advances on this, Thumbsup 2 in related fronts:

1) The planet hab calculation quirks have been uncovered and succesfully duplicated in at least 2 platforms: C/C++ and *gasp* JavaScript. Several tests have shown the accuracy of the new formulas. Cool Code is available on request, but should ideally be hosted somewhere for public access.

2) The Racewizard has been shown to heavily rely on planet hab calculation, and its inner logic regarding PRTs, LRTs, econ & science has also been succesfully replicated. Preliminary tests show encouraging results, and working code should be available soon Smile

Comments, suggestions welcome.

C U @ the Board!



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Race Wizard almost done (but not quite) Tue, 15 March 2005 10:04 Go to previous messageGo to next message
ConstB is currently offline ConstB

 
Crewman 1st Class

Messages: 27
Registered: March 2005
Location: Tomsk, Russia
race algo in c++ can be downloaded from http://constb.5u.com

Report message to a moderator

Re: Race Wizard almost done (but not quite) Tue, 15 March 2005 12:46 Go to previous messageGo to next message
Hilton is currently offline Hilton

 
Crewman 1st Class

Messages: 28
Registered: February 2005
Location: Calgary, AB, Canada
Feel free to email me anything Stars! related that needs hosting, at mailto:hjanfield@shaw.ca. I will put it online at http://www.freestars.org/.

Report message to a moderator

Re: Race Wizard almost done (but not quite) Wed, 16 March 2005 05:28 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2755
Registered: October 2004
Location: Third star to the left
Hilton wrote on Tue, 15 March 2005 18:46

Feel free to email me anything Stars! related that needs hosting . I will put it online at http://www.freestars.org/.



Cool Cool! Cool I might send you something soon Smile



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Race Wizard almost done (but not quite) Wed, 16 March 2005 11:44 Go to previous messageGo to next message
icebird is currently offline icebird

 
Chief Warrant Officer 3

Messages: 178
Registered: September 2003
Location: In LaLa land...
The reliance on habability calculations makes a lot of sense, and explains why I can't make heads or tails of the way it works right now with simple algebra, as I would have expected. I'll take a look and investigate next week to see if I can make it work with the hab formula next week (no access to Stars! for a while).


-Peter, Lord of the Big Furry Things

Report message to a moderator

Re: Race Wizard almost done (but not quite) Wed, 16 March 2005 12:45 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2755
Registered: October 2004
Location: Third star to the left
Hi,

icebird wrote on Wed, 16 March 2005 17:44

The reliance on habability calculations makes a lot of sense,


Specially if the Jeffs coded it Wink


Quote:

and explains why I can't make heads or tails of the way it works right now with simple algebra, as I would have expected.


No wonder. As far as I understand ConstB's code, a hundred planets are generated and tested for habitability, and the averaged results are (somehow) used in the final point calculation. Twisted Evil


Quote:

I'll take a look and investigate next week to see if I can make it work with the hab formula next week (no access to Stars! for a while).


My tests with the published code show that it is already very nearly (or wholly) accurate. Might be worth it to seek a simpler/cleaner algorithm, though. Shocked

Note also that the "old" best-fit hab formula is no longer *the* formula. ConstB hit upon the real thing last week. Thumbsup 2


[Updated on: Wed, 16 March 2005 12:46]




So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Race Wizard almost done (but not quite) Thu, 16 February 2006 17:18 Go to previous messageGo to next message
LEit is currently offline LEit

 
Lt. Commander

Messages: 879
Registered: April 2003
Location: CT
ConstB wrote on Tue, 15 March 2005 10:04

race algo in c++ can be downloaded from http://constb.5u.com

Almost a year later....

I just noticed this, and it's very good.

The code does seem to be missing one else however:
if (facOperate>10 || tenFacRes>10)
probably needs an else, so it can correctly calculate points for -f and AR races, for ARs I assumed that factories were 10/10/10, but that doesn't seem to get the right values either.

I wrote a simple parser to take a race on one line and populate the playerDataStruct. If anyone is interested, I'll post that.



- LEit

Report message to a moderator

Re: Race Wizard almost done (but not quite) Thu, 16 February 2006 17:22 Go to previous messageGo to next message
LEit is currently offline LEit

 
Lt. Commander

Messages: 879
Registered: April 2003
Location: CT
Looking at the code some more, that seems fine, there is another calculation later that works on the factories.

I'm not sure what's wrong, but -f and AR races don't get the right points compared to the RW.

Hmm, I found my problem with -f races, I'd written it down wrong, this code is correct for -f races, assuming you give it valid data...


[Updated on: Thu, 16 February 2006 17:45]




- LEit

Report message to a moderator

Re: Race Wizard almost done (but not quite) Thu, 16 February 2006 19:26 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2755
Registered: October 2004
Location: Third star to the left
LEit wrote on Thu, 16 February 2006 23:22

Looking at the code some more, that seems fine, there is another calculation later that works on the factories.

I'm not sure what's wrong, but -f and AR races don't get the right points compared to the RW.

Hmm, I found my problem with -f races, I'd written it down wrong, this code is correct for -f races, assuming you give it valid data...


Hi,

I was wondering if nobody else wanted to tinker with the code... Wink

I'd be interested in your parser. I've already got a working JavaScript version of the RW code as published, which has shown accuracy at a variety of races tested. Very Happy



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Race Wizard almost done (but not quite) Thu, 16 February 2006 21:22 Go to previous messageGo to next message
LEit is currently offline LEit

 
Lt. Commander

Messages: 879
Registered: April 2003
Location: CT
After double checking my races, I found that most of the errors were mine. However, no amount of checking fixed the problems with ARs. It may be that my assumption that ARs have factory settings of 10/10/10 are invalid, but I don't think that's it.

Still, getting all the rest of the things right is a big step in the right direction.



- LEit

Report message to a moderator

Re: Race Wizard almost done (but not quite) Fri, 17 February 2006 05:14 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2755
Registered: October 2004
Location: Third star to the left
LEit wrote on Fri, 17 February 2006 03:22

After double checking my races, I found that most of the errors were mine. However, no amount of checking fixed the problems with ARs. It may be that my assumption that ARs have factory settings of 10/10/10 are invalid, but I don't think that's it.


IIRC, the code ignores AR's factory and mine settings. It only takes the "AR eff" division factor into account, in place of the "colonist eff" of other races.

I shall check things a bit more with AR, and perhaps finish integrating the RW calculations into my html/javascript-based race econ calculator (which already has all the input interface conveniently in place) where they should fit in nicely. Smile

Pls send me your AR settings (in the traditional format), just in case. Are the differences in results very significative?


Quote:

Still, getting all the rest of the things right is a big step in the right direction.


Glad to hear that. You might notice the RW code includes the *exact* Hab value calculation code, which I rewrote to simplify it (and published somewhere in The Academy), and also tested to 100% accuracy. Very Happy

PS: I got your PM. It seems I'll have a busy weekend. Sherlock
PPS: I see some of your AR testcases in your code. Good. We might want to standardize racedescription "DNA", though. Wink
PPPS: You might notice the "GravClicksToGrav" array is no longer needed, as we also nailed down the accurate GravFromGravClicks calculation. Smile


[Updated on: Fri, 17 February 2006 06:20]




So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Race Wizard almost done (but not quite) Fri, 17 February 2006 10:06 Go to previous messageGo to next message
LEit is currently offline LEit

 
Lt. Commander

Messages: 879
Registered: April 2003
Location: CT
m.a@stars wrote on Fri, 17 February 2006 05:14

You might notice the RW code includes the *exact* Hab value calculation code, which I rewrote to simplify it (and published somewhere in The Academy), and also tested to 100% accuracy. Very Happy

I'll look for it

m.a@stars wrote on Fri, 17 February 2006 05:14

PPS: I see some of your AR testcases in your code. Good. We might want to standardize racedescription "DNA", though. Wink

Any standard would be fine, just as long as it's fairly easy to parse. The parser I've written is fairly rigid in some ways, and forgiving in others, but if there was a clear standard, it should be easy to parse it.

m.a@stars wrote on Fri, 17 February 2006 05:14

PPPS: You might notice the "GravClicksToGrav" array is no longer needed, as we also nailed down the accurate GravFromGravClicks calculation. Smile

Where is this?



- LEit

Report message to a moderator

Re: Race Wizard almost done (but not quite) Fri, 17 February 2006 15:06 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2755
Registered: October 2004
Location: Third star to the left
LEit wrote on Fri, 17 February 2006 16:06

I'll look for it

<snip>

Any standard would be fine, just as long as it's fairly easy to parse. The parser I've written is fairly rigid in some ways, and forgiving in others, but if there was a clear standard, it should be easy to parse it.

<snip>

Where is this?


See this Academy thread:

http://starsautohost.org/sahforum/index.php?t=msg&th=229 9&start=0&rid=625&S=fdfca492d0e72c55f919e79b9d3f df95

Also, I still would need the "standard" description of your AR races to test the RW code, just in case your "DNA" is faulty. Sherlock


[Updated on: Fri, 17 February 2006 15:07]




So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Race Wizard almost done (but not quite) Fri, 17 February 2006 16:02 Go to previous messageGo to next message
LEit is currently offline LEit

 
Lt. Commander

Messages: 879
Registered: April 2003
Location: CT

AR;ARM,IS,NAS,RS;15;-1,-1;-96,16;18,84;10;N=W-P+C-E+B+;0
doesn't work, returns -93
A bit longer version of the race is:
AR; ARM ISB NAS RS; 15% growth, gIMM, -96C to 16C, 18mR to 84mR; divisor 10; w&c cheap, energy normal, rest expensive; 0 points left over

AR; ARM ISB NAS RS IFE NRSE; 16% -1g -1g, -40C 96C, 54mR 84mR; 10; n-w-p+c-l+b+; 8
doesn't work, returns 41

AR; ARM ISB NAS IFE NRSE; 16% -1g -1g, -40C 96C, 53mR 85mR; 10; n-w-p+c-l+b+; 0
doesn't work, returns 32

The others I think are clear, and if not, I can clarify them too.



- LEit

Report message to a moderator

Re: Race Wizard almost done (but not quite) Sat, 18 February 2006 07:36 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2755
Registered: October 2004
Location: Third star to the left
LEit wrote on Fri, 17 February 2006 22:02


AR;ARM,IS,NAS,RS;15;-1,-1;-96,16;18,84;10;N=W-P+C-E+B+;0
doesn't work, returns -93
A bit longer version of the race is:
AR; ARM ISB NAS RS; 15% growth, gIMM, -96C to 16C, 18mR to 84mR; divisor 10; w&c cheap, energy normal, rest expensive; 0 points left over

AR; ARM ISB NAS RS IFE NRSE; 16% -1g -1g, -40C 96C, 54mR 84mR; 10; n-w-p+c-l+b+; 8
doesn't work, returns 41

AR; ARM ISB NAS IFE NRSE; 16% -1g -1g, -40C 96C, 53mR 85mR; 10; n-w-p+c-l+b+; 0
doesn't work, returns 32



All of those are OK in my Javascript version. It must be some trick of integer math or something I fixed when playing with constB's code.

{It seems it was simpler than that, as tech costs are coded somewhat counter-intuitively in the RW code. Once that's been taken into account, all races tested are giving correct results. Cool }

By the way, my version has a bit more comments and clearer variable names and such Very Happy though it still would benefit from a thorough polishing/simplifying/cleanup. Sherlock


[Updated on: Mon, 20 February 2006 11:41]




So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Race Wizard almost done (but not quite) Fri, 17 August 2007 11:07 Go to previous messageGo to next message
mazda is currently offline mazda

 
Lieutenant

Messages: 655
Registered: April 2003
Location: Reading, UK
ConstB wrote on Tue, 15 March 2005 15:04

race algo in c++ can be downloaded from http://constb.5u.com


Has anybody else looked at this yet ?

In essence the habpoints are calculated as follows :-
For each of three terraforming scenarios (0,5,15) the code looks at a selection of habitable planets at that terra level and pretends you have terra'ed up to that value.

It splits each band into 10 chunks (so 11 values) and gets the planetvalue at all 11x11x11 planets.
For each planetvalue it reduces the value for planets further from the centre and then squares the value - so it is biased towards the values of the good, central greens for that terra scheme.

In general the algorithm is biased towards what happens with terra of +/-15 as this will create more, bigger greens that are closer to the centre points.

Note that bands 20 wide or 40 wide still get divided into 10 chunks, so there are no extra planets looked at for wider habs.
In fact narrower habs will do better as they improve faster through terra.
Wider habs use more points because there is a simple multiplication by habwidth/100 for each hab variable.

Also, for some reason, it multiples the total values for each terra scenario by some random constants (7, 5 and 6) before giving a grand total.
This number is divided by 10, and then again by 2000 before multiplying by a growth_rate factor to get RW points.

For races with TT it uses (0,8 and 17) instead of (0,5 and 15) as the available terra.

Now, I can see nothing that takes account of the tapering in Grav and Temp. But we already know the RW ignores that.

Nor can I see anything that would makes a difference from moving a narrow centered band to the left or right a click or two, not until the edges are hit with +/-15.

Not sure I've seen anything that explains the difference between shifting left and right yet either.
You could put it down to rounding, but as the bands are split into 10 chunks there ought not to be any rounding with widths that are multiples of 10 :-s

Am I missing something ?

Report message to a moderator

Re: Race Wizard almost done (but not quite) Mon, 20 August 2007 04:41 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2755
Registered: October 2004
Location: Third star to the left
mazda wrote on Fri, 17 August 2007 17:07

ConstB wrote on Tue, 15 March 2005 15:04

race algo in c++ can be downloaded from http://constb.5u.com


Has anybody else looked at this yet ?

In essence the habpoints are calculated as follows :-



AFAIK, that particular section of code has been more or less "taken for granted" with other functions getting all the attention. Sherlock Seems your neat summary is the 1st. Cool

Quote:

Also, for some reason, it multiples the total values for each terra scenario by some random constants (7, 5 and 6) before giving a grand total.


That could be some modifiers for "feasibility" (or even for the overall econ impact) of each terra level. Though it's hard to be sure with the Jeffs. Twisted Evil

Quote:

Nor can I see anything that would makes a difference from moving a narrow centered band to the left or right a click or two, not until the edges are hit with +/-15.


Now this is an interesting one. I've always assumed the effect owed to the way planet habs are generated, with centered ones being more abundant than shifted, and thus gathering more habpoints. But perhaps we must look for some other cause? Whip

Quote:

Not sure I've seen anything that explains the difference between shifting left and right yet either.
You could put it down to rounding, but as the bands are split into 10 chunks there ought not to be any rounding with widths that are multiples of 10 :-s

Am I missing something ?


Well, shift left vs shift right always seemed a minor effect to me, but indeed I would like to know *why* is there any difference, as the probabilities of each side are the same. Confused



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Race Wizard almost done (but not quite) Thu, 06 September 2007 07:40 Go to previous messageGo to next message
mazda is currently offline mazda

 
Lieutenant

Messages: 655
Registered: April 2003
Location: Reading, UK
BTW I did find an interesting cost in the RW code.

If
a) you have really expensive tech ( 0 or 0.5 cheap to use the usual notation )
AND
b) you have set the col/res divisor to less than the default 1000 (so more resources per colonist)
THEN
it costs you an additional 63 points (190 code points).

So it penalises you for trying to buy better resources by taking expensive tech.

Given that few people play a) and even fewer play b) then maybe there aren't any races out there that actually pay this cost.

M

Report message to a moderator

Race Wizard disection Thu, 06 September 2007 10:02 Go to previous messageGo to next message
mazda is currently offline mazda

 
Lieutenant

Messages: 655
Registered: April 2003
Location: Reading, UK
mazda wrote on Fri, 17 August 2007 16:07

Nor can I see anything that would makes a difference from moving a narrow centered band to the left or right a click or two, not until the edges are hit with +/-15.


Got this bit.
Further down where it is counting up immunities and before it takes account of the interaction between high factory resources and high factory operation there is an innocous line -

points += abs(playerData->centerHab[j] - 50)*4;

So each click left or right costs inherently 4 internal points (which is 1.33 as we see them).
I'll check this later and hope it matches.

Report message to a moderator

Race Wizard disection Fri, 07 September 2007 05:51 Go to previous messageGo to next message
mazda is currently offline mazda

 
Lieutenant

Messages: 655
Registered: April 2003
Location: Reading, UK
mazda wrote on Fri, 17 August 2007 16:07

Not sure I've seen anything that explains the difference between shifting left and right yet either.


Got this bit now !
Not yet made up my mind whether I think it is intended or not.
Difficult to tell with no comments in the code.

Code is as follows :-

planetDesir = planetValueCalc(testPlanetHab);
v100 = v108[0]+v108[1]+v108[2];
IF (v100>TTCorrFactor)
{
planetDesir -= v100-TTCorrFactor;
if (planetDesir<0) planetDesir=0;
)

At this point it is calculating the habs of the 1331 test planets and adding them all together to get a point score.
The more total hab then the more it costs in the RW. Simple.

The array v108[] is a set of three values representing the distance between the the ideal for the race and the planet hab being tested.

If the v108[] values are sufficiently positive then the RW thinks the test planet is less desirable and hence it costs you less.
However these values have a sign - if the planet value is higher (to the right of) than the centre point of the race band then these values are instead negative and so unlikely to produce a reduction in desirability and hence no reduction in RW cost.

So the more test planets you have with hab values left of your ideal values then the less points you will pay.

Comparing a left-shifted hab scheme with a right-shifted hab scheme it is easy to see which of them will have more test planets left of your ideal values.
As soon as the notional terra of 15 clicks hits the left edge then you start to lose planets because you can't go any further left.
The right-shifted scheme doesn't lose these planets and hence you pay less.

I think there are quite complicated interactions between distance from the edge and rounding that give rise to the odd behaviour that we see in these regions of the hab screen.


[Updated on: Fri, 07 September 2007 05:56]

Report message to a moderator

Re: Race Wizard disection Sat, 08 September 2007 14:00 Go to previous messageGo to previous message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2755
Registered: October 2004
Location: Third star to the left
mazda wrote on Fri, 07 September 2007 11:51

If the v108[] values are sufficiently positive then the RW thinks the test planet is less desirable and hence it costs you less.
However these values have a sign - if the planet value is higher (to the right of) than the centre point of the race band then these values are instead negative and so unlikely to produce a reduction in desirability and hence no reduction in RW cost.

So the more test planets you have with hab values left of your ideal values then the less points you will pay.


Wouldn't that kind of quirk lead to a large difference in left vs right? I was under the impression that the observed differences were minimal. Sherlock Whip



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Previous Topic: Detailed mineral mining table
Next Topic: Just a Clone?
Goto Forum:
  


Current Time: Tue Mar 26 00:08:16 EDT 2019