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

 
Officer Cadet 1st Year
Creator of TotalHost and Stars! utilities
Created TotalHost and Stars! utilities

Messages: 222
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



https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHost

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: 2765
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

 
Chief Warrant Officer 1
Creator of StarsWine
Created StarsWine

Messages: 138
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

 
Officer Cadet 1st Year
Creator of TotalHost and Stars! utilities
Created TotalHost and Stars! utilities

Messages: 222
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]




https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHost

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

 
Chief Warrant Officer 1
Creator of StarsWine
Created StarsWine

Messages: 138
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 messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
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

Re: Calculating Race Scores Tue, 08 February 2022 01:47 Go to previous message
ricks03 is currently offline ricks03

 
Officer Cadet 1st Year
Creator of TotalHost and Stars! utilities
Created TotalHost and Stars! utilities

Messages: 222
Registered: January 2012
Location: NC
I've spent ... a while ... looking at, and testing bits and pieces of the Freestars code for determining the Advantage point scores for a race.

And my final conclusion is even the basic PRT/LRT code is wrong, even taking into account the PRT/LRT combos that do something extra in combination with other things (mostly TT and NAS). So I can't see how it's really worth trying to fix that part, yet expect the more complicated part of the calculation to be correct.

Nova code appears to have similar problems.

So while there's certainly the problem of me just having it wrong, even at a fairly basic level it's not quite right even before I get into all the variation built in.

Anyway, other ideas and pointers appreciated if you've got them.



https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHost

Report message to a moderator

Previous Topic: Detecting (and correcting for) the FreePop Hack
Next Topic: Public Messages
Goto Forum:
  


Current Time: Thu Mar 28 06:46:42 EDT 2024