assetto-server-manager icon indicating copy to clipboard operation
assetto-server-manager copied to clipboard

Multi server PQ and splits

Open cheesegrits opened this issue 4 years ago • 1 comments

This is long. My apologies. I've tried to be as explicit and clear as I can.

Is your feature request related to a problem? Please describe.

The "problem" is that I need to run championships for more drivers than will fit on one server. The existing Race Weekend format in a multi-server setup goes some way to allowing for this, but doesn't quite get there, at least for the format our league uses.

What we currently do is a week of PQ (pre-quali) prior to the race, with a looping 3h quali session, logging to stracker. This allows everyone to get their practice in and do their PQ on their own schedule. We then have some provisioning that we run 1 hour before race time, which takes everyone's fastest PQ laps from stracker, and builds X number of entry lists and server configs, to evenly split everyone who PQ'ed (and is also registered for the series) across as many servers as we need, taking the number of track grid slots into account.

Each split then runs (concurrently) as a normal AC self contained race, with it's own P, Q and R sessions.

We then have a dynamic scoring system which essentially concatenates the results from all the splits, as if it had been one big race, such that the last place in the bottom split gets 1 point, the winner of the top split gets "total number of drivers in all splits" points ... sprinkle in a few extra points for a podium in any split ... then apply a fudge factor to that so it's scored out of a predetermined max points (like 150 for feature race, 100 for sprint).

Describe the solution you'd like

I would like to achieve something similar in the multi-server version of server-manager. This would require at least some minimal awareness within server-manager that it is part of a multi-server cluster. I know you are trying to avoid this, but I don't see how a multi-server deployment can be truly useful without some level of awareness that it can utilize other servers for things like splits.

I think perhaps two additional config.yml settings, like 'max_splits' and 'split_number', which the multi-server installer adds, so split_number is basically the SERVER_X number (but starting at 1), so a three server deployment would have split_number 1, 2 and 3, and max_splits of 3.

When setting up a championship, if max_split is non 0, allow for a "Splits with PQ" option on the championship. If this is set, it would remove the sanity check when creating a race, which currently doesn't let you pick a track with pit boxes < championship entrants. If set, race configs would not require the entry list to be manually created, and ignore pit box limitations.

We already have the "Practice Session" mode for championship events, so if "Splits with PQ" is enabled, allow for a "PQ Session", which does essentially the same, but runs a quali session, with grip fixed (no track evolution) at some pre-set amount (we use 98%), 0 fuel use, 0 tire wear, and only a single weather panel (so no random weather or temps). Basically so every PQ session is the same grip, same temps, same weather, same constant fuel and tire condition. I'm not sure how the existing Practice Session handles building the entry list for multi-car / class races (how many of each car to configure), but I assume this is already handled.

In the "Manage Event" options for the Championship events, if Splits is enabled, have a "Grid from PQ" option, which builds the entry lists from the PQ results files. This is where it gets a bit kludgy, as each server would need to be aware of PQ results files from other servers (PQ could run on one, some or all servers). But given the fixed folder structure imposed by the multi-server installer, and knowing max_splits, it could still use broadly the same method as the existing Race Manager ListAvailableResultsFilesForSession() to find the matching PQ session results from each server - knowing max_splits 3 is 3 servers, and being able to build the paths as ../SERVER_X/<ServerInstallPath>/results.

Of course, there is an added complication in that race configs are currently shared, so individual servers in a multi-server setup currently can't have separate pre-booked entry lists. A while back I played with a new option for "Local Entry List" ...

https://github.com/cheesegrits/assetto-server-manager/commit/f219697b1a82fc7e7103aa280dab44c4e0af6a2e

... which actually works pretty well. It just uses an additional folder in the local JSON store for entry lists, and splices them in/out of the race config in the JSON store code if LocalEntryList is enabled for that race.

So the "Grid from PQ" function would read all quali results for the race session from across all servers (probably with some additional date range checking, if Start PQ sets a date/time in the config, and use that as the lower bound), build the required number of entry lists from the combined PQ results, and write out the local entry list for each server, as needed to meet the split count.

Then of course there's the points handling, but I haven't got that far yet. :)

Describe alternatives you've considered

This is about the only workable approach I can think of.

Additional context

None.

cheesegrits avatar Jan 09 '20 07:01 cheesegrits

Sorry for the slow response here. I'm gonna try my best to work through what you've described and see what we have and what is missing. Ideally, any solutions we implement should be as generic as possible - so that other people might use them in other ways (I think Race Weekends for example have achieved this mostly pretty well.)


I'm going to start with the description of your "problem" first and see what I can think of with our existing platform...

What we currently do is a week of PQ (pre-quali) prior to the race, with a looping 3h quali session, logging to stracker. This allows everyone to get their practice in and do their PQ on their own schedule. We then have some provisioning that we run 1 hour before race time, which takes everyone's fastest PQ laps from stracker, and builds X number of entry lists and server configs, to evenly split everyone who PQ'ed (and is also registered for the series) across as many servers as we need, taking the number of track grid slots into account.

This certainly seems like it would be achievable with what we have already in Race Weekends. You could set up a PQ event (custom race) and have it looping1. Then, you can use the 'Fastest Lap Across Multiple Results Files' filter type in a Race Weekend to order your groups and do the splits for each race. Each session could be scheduled to run on whichever multiserver instance you want.

A flaw I see with this is that you are running P Q R events, and using a Race Weekend would involve a lot of disconnecting/connecting.

We then have a dynamic scoring system which essentially concatenates the results from all the splits, as if it had been one big race, such that the last place in the bottom split gets 1 point, the winner of the top split gets "total number of drivers in all splits" points ... sprinkle in a few extra points for a podium in any split ... then apply a fudge factor to that so it's scored out of a predetermined max points (like 150 for feature race, 100 for sprint).

You could also achieve this with Race Weekends, given that you can do points per session. It would take some figuring out though, but I worry anything that helps this may be too specific to just your league and could be an inconvenience for others.

I think a lot of this comes down to how far you want this to be automated. (I know ;P the answer is clearly "as much as possible please").


[1]: I think right now this doesn't support our multiserver setup, given that results folders are separated. that might be worth addressing.

cj123 avatar Jan 21 '20 16:01 cj123