Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Extensions » Calculating Race Scores
Calculating Race Scores Mon, 11 February 2019 17:43 Go to next message
ricks03 is currently offline ricks03

 
Petty Officer 1st Class

Messages: 65
Registered: January 2012
Location: NC
I often play/host games where we use a handicapping system, requiring more advanced players to leave points left over in the race design wizard. That's also helpful to apply race point design adjustments (like paying an extra 95 for NAS if JoAT).

I'd like to code a utility that automatically checks the race design points left over.

When I look at the PlayerBlock code up on GitHub, I don't think that the point total is included in the race file (it must be calculated by the EXE). Does anyone know of code that duplicates the calculation from the Race Design Wizard?

Thanks!

Rick



http://www.irelandbybicycle.com
http://totalhost.sinister.net:999

Report message to a moderator

Re: Calculating Race Scores Sat, 16 February 2019 20:22 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
IIRC, both FreeStars and Nova have the RaceWizard code, points calculation included. I should have my own (js) version stashed somewhere too. Rolling Eyes


So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Calculating Race Scores Sat, 16 February 2019 22:07 Go to previous messageGo to next message
raptor is currently offline raptor

 
Senior Chief Petty Officer

Messages: 89
Registered: June 2014
If FreeStars really has it correct, then I think here is a good chunk of it:

https://sourceforge.net/p/freestars/code/HEAD/tree/trunk/Ser ver/Race.cpp#l136

Report message to a moderator

Re: Calculating Race Scores Sat, 16 February 2019 22:30 Go to previous messageGo to next message
ricks03 is currently offline ricks03

 
Petty Officer 1st Class

Messages: 65
Registered: January 2012
Location: NC
That's awesome - thanks! Now hopefully I can tease the race file values out, and then calculate the race score.

[Updated on: Sat, 16 February 2019 22:33]




http://www.irelandbybicycle.com
http://totalhost.sinister.net:999

Report message to a moderator

Re: Calculating Race Scores Sat, 16 February 2019 22:41 Go to previous messageGo to next message
raptor is currently offline raptor

 
Senior Chief Petty Officer

Messages: 89
Registered: June 2014
I think I found more code from Nova:

https://sourceforge.net/p/stars-nova/svn/HEAD/tree/trunk/Com mon/RaceDefinition/RaceAdvantagePointCalculator.cs

I can't verify accuracy of any of these.

Report message to a moderator

Re: Calculating Race Scores Sun, 17 February 2019 02:56 Go to previous message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2755
Registered: October 2004
Location: Third star to the left
Yep, that's the beast, hardcodes and all. Notice the Freestars team tried to make it more readable. Cool

Also, beware integer math. You better test results thoroughly.



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Previous Topic: Utility to reset Stars! passwords
Next Topic: Open-source M and H file merger tool available
Goto Forum:
  


Current Time: Wed Aug 21 06:09:24 EDT 2019