1. Do you need support for Assetto Corsa Competizione? Please use the proper forum below and ALWAYS zip and attach the WHOLE "Logs" folder in your c:\users\*youruser*\AppData\Local\AC2\Saved. The "AppData" folder is hidden by default, check "Hidden items" in your Windows view properties. If you report a crash, ALWAYS zip and attach the WHOLE "Crashes" folder in the same directory. Do not post "I have the same issue" in an existing thread with a game crash, always open your own thread. Do not PM developers and staff members for personal troubleshooting and support.
  2. As part of our continuous maintenance and improvements to Assetto Corsa Competizione we will be releasing small updates on a regular basis during the esports season which might not go through the usual announcement process detailing the changes until a later version update where these changes will be listed retrospectively.
  3. If ACC doesn't start with an error or the executable is missing, please add your entire Steam directory to the exceptions in your antivirus software, run a Steam integrity check or reinstall the game altogether. Make sure you add the User/Documents/Assetto Corsa Competizione folder to your antivirus/Defender exceptions and exclude it from any file sharing app (GDrive, OneDrive or Dropbox)! The Corsair iCue software is also known to conflict with Input Device initialization, if the game does not start up and you have such devices, please try disabling the iCue software and try again. [file:unknown] [line: 95] secure crt: invalid error is a sign of antivirus interference, while [Pak chunk signing mismatch on chunk] indicates a corrupted installation that requires game file verification.
  4. When reporting an issue with saved games, please always zip and attach your entire User/Documents/Assetto Corsa Competizione/Savegame folder, along with the logs and the crash folder (when reporting related to a crash).

Programming off track penalties - a scenario based analysis of 6 methods

Discussion in 'Chit Chat Room' started by Lucas - Xtremepsionic, Dec 30, 2014.

  1. At the bottom of the post we find out which system offers the most accurate penalties. This post goes through 7 different scenarios of when a racer is off track throughout the race. I've collected the following penalty checking options from another thread and used them to analyze and see which one is best.

    TLDR: Kunos please use Wally's system with 2 modifications, and we'll have an almost perfect penalty system.



    Penalty checking options:

    1. Exceeding 3 off tracks = Drive through penalty
    2. Three zones of penalty. The white zone, orange and the red zone depending on corner apex, outside, or zones where cutting is obviously to gain time advantage.
    3. Iracing type. User initiated throttle cut with wheels off track. (if I misunderstood this please run your corrected version through the 7 scenarios and report :) )
    4. Wally’s corner entry/exit speed based penalties. More than 3 warnings and you get a penalty. (See bottom of post to see how this method works)
    5. Penalties when 2 or 4 wheels off track and position gained
    6. Penalties based on time gained (requires complex algorithms)​


    Scenario check for the above options (bolded answer fits ideal answer)
    • a. T1 at the start, you’re forced off the track and had to cut the apex due to a crash, you gained positions because crashed cars which were ahead of you are now behind you. Ideally you would not get a penalty
    1a. You’ll get an off track recorded but no penalty yet
    2a. You’ll get a penalty because you cut the track
    3a. You’ll get a slow down penalty
    4a. You’ll get a warning
    5a. You’ll get a penalty
    6a. You haven’t set a lap time so nothing happens​



    • b. Deliberate cutting of apexes to gain advantage in time but not position later on lap 1 with only 2 tires off. Ideally you’d get a warning

    1b. You now have 2 off track but no penalties yet
    2b. You’ll get a penalty
    3b. You’ll get a penalty to slow down
    4b. You’ll get a second warning
    5b. You get nothing since you didn’t get position
    6b. You’re on lap one with no time set, so nothing happens​



    • c. Running wide on the outside of a turn due to driver error on lap 2. Ideally nothing happens
    1c. You’re now at 3 off tracks and you get a penalty
    2c. Nothing happens because you’re in the safe zone for being off track
    3c. You’ll get a penalty to slow down
    4c. You’ll have the 3rd warning
    5c Nothing happens because you didn’t gain time or position
    6c You have gained time from lap 1, does this count as a penalty? Or if you cross check with fastest lap (by you? By the WR holder?) then no penalty​



    • d. Lap 3. Someone runs into the back of you and you’re forced off track but not through an apex, slight time lost. Ideally nothing happens.
    1d. You’re now at 4 off tracks and you get a penalty
    2d. Assuming you ran wide, nothing happens
    3d. You get a penalty to slow down
    4d. Nothing happens
    5d. No positions gained, nothing happens
    6d. You haven’t changed position, nothing happens
    • e. 4th lap. You lock up the brakes under pressure and had to cut the corner through the apex, but you yield the position to the car behind you afterwards. Ideally nothing happens
    1e. You’re now at 5 off tracks and you get a really long penalty, sucks to be you
    2e. You cut through the apex, you’ll get a penalty
    3e. You get a slow down penalty
    4e. 4th off track and you get a penalty because you didn’t slow down through the cut apex
    5e. No positions gained, nothing happens
    6e. No time gained vs your best lap or the WR lap (as if you’re that fast anyway?!) nothing happens

    • f. Deliberately cutting of apex to gain time but not position with 2 tires off. Ideally you get a penalty because it’s not your first time.
    1f. You’re probably disqualified by now, 6th off track
    2f. You will get a penalty because you cut the apex
    3f. You get another slow down penalty (wow the first time this penalty actually makes sense)
    4f. You get another penalty5f. Didn’t gain position, no penalty again
    6f.
    You gained time vs your last lap, but say your tires are worn and you actually don’t set a new PB in this sector, you might escape penalty, mmmm​


    • g. Last lap, Deliberately cutting of apex to gain an advantage in time and position with all 4 tires off for the win. Ideally you’d get a penalty
    1g. You’re definitely thrown the books now, 7th penalty
    2g. Another penalty because of apex cut
    3g. You get another slow down penalty
    4g. Another penalty
    5g. Finally you get a penalty that you deserved

    6g. Assuming you set a PB in this sector or lap, maybe you’ll get a penalty, but if you were slower in the lap earlier, maybe you won’t. If your time is compared to WR, then you’ll never get a penalty​

    • Through the 7 scenarios, our score stands at:
    Exceeding 3 off tracks = Drive through penalty 4
    Three zones of penalty. The white zone, orange and the red zone 4
    Iracing type. User initiated throttle cut with wheels off track 2

    Wally’s corner entry/exit speed based penalties. 5
    Penalties when 2 or 4 wheels off track and position gained 4
    Penalties based on time gained (requires complex algorithms) 2


    Conclusion

    So Wally’s off track algorithm was the best. What did it get wrong though?

    Running wide on the outside of a turn due to driver error on lap 2 – This is fixable by defining the outside of the corner, either with programming via AI line or by defining track segments in the kn5 file.

    4th lap. You lock up the brakes under pressure and had to cut the corner through the apex, but you yield the position to the car behind you afterwards. – This is fixable by giving a warning to the driver to give up a position on track before handing out penalties.



    Now there are definitely other scenarios which could happen, and the sequence of events could change the outcome somewhat since some of the penalties are accumulative. As we can see however, Wally’s method requires no extra programming or track modification and it already scored the highest. With some slight modifications it can almost be perfected.



    Please only reply to this thread if you have meaningful and constructive comments on programming a way for AC to recognize and penalize drivers without having it analyze human emotions and motives. The computer doesn't KNOW if an action is deliberate, it can only look at certain things on the track and make a yes/no decision.

    If you have another method of analyzing penalties, it would be nice if you could go through the same 7 scenarios and see what results you get.



    Wally's penalty system:
    [FineTuning]
    ; The maximum time cut (in seconds) to trigger a warning. Default 1.3.
    ; If you make this too long, off-track accidents may trigger cut warnings.
    MAX_CUT_TIME=1.3
    ; The minimum ratio of speed at leaving the track to speed at re-entering the track that will trigger a warning. Default 0.9.
    ; A speed ratio under this means that the car has slowed, and negated any advantage gained, and a warning won't be triggered.
    ; 0.9 means the car is re-entering the track at 90% of the speed at which it left it.
    ; A value < 1 means the car has slowed during the cut; a value > 1 means the car has sped up.
    MIN_SLOW_DOWN_RATIO=0.9
    ; If the track re-entry speed is > this fraction of the car's max speed, a cut triggers a warning even if it takes longer
    ; than MAX_CUT_TIME seconds.
    MAX_SPEED_RATIO_FOR_CUT=0.6
     
    Madsen, Hagen, vladjak and 11 others like this.

  2. Similar Threads
    Forum Title Date
    Programming Language - Apps - GUI Themes Some example for programming an udp app ? Jan 21, 2015
    Programming Language - Apps - GUI Themes Traffic lights programming Nov 12, 2014
    Chit Chat Room What hardware does Kunos have for testing/programming? Jan 18, 2014
    ACC General Discussions Small question about time multiplier / offline Apr 16, 2024
    Bug reports Lap 0 Laptime is way off! Multiplayer Server Mar 17, 2024
    ACC General Discussions An official Assetto Corsa discord server please. (iracing, raceroom, and gt7 has one) Mar 16, 2024
    ACC Online Leagues / Championships room ACC Official Server higher requirement Jan 30, 2024
    ACC Multiplayer Servers are offline Jan 27, 2024
    ACC PS4/PS5/XB1/XBX/S General Discussions Anyone else notice pink (missing textures) and street lights at Monza turning off as you pass them?? Dec 19, 2023
    ACC PS4/PS5/XB1/XBX/S General Discussions Create Public Server, or Class Specific Official Servers Dec 3, 2023
    ACC Graphics - Tracks and Cars How to get official Ferrari 296 livery Nov 26, 2023
    ACC General Discussions Can we get an official announcement on the servers constantly crashing? Nov 4, 2023
    ACC Troubleshooting [Need help] Monitors "turn off" during races. Nov 1, 2023
    ACC Rating & Leaderboards ACC Lobby is offline since 9 hours ago. Any insights? Oct 29, 2023
    ACC Physics v1.9 Tyre grip falls off a cliff May 1, 2023

  3. I believe that with the second method (if i understood it correctly in the other thread), the penalties for cutting the apex in the orange zone are given only with x cut in y lap (where x & y are variabile settings), so at point b the penalty is not given at the first cut, but after x number of times in the last y number of laps.
    The problem at the point E still remains, that's a red zone i assume; that scenario (with this method) will be solved only using a delta with previous/next car in a race to find out if the driver has taked advantage or not from the cut (and by deleting lap in hotlap/qualify of course).

    Sorry if i misunderstood things (and for my crappy english as well) ;)
     
    Lucas - Xtremepsionic likes this.
  4. So for method 2, you might get 1 more score for point a, which brings it up to 5 and a tie with Wally's method. Which means both methods could be used with the same correction required to get them up to 100%. The only difference is that all the tracks will need to have zones programmed in for this method to work, while @WallyM method require no changes on the track kn5, thus easier to implement.

    Having delta is very problematic because, what if someone slows down or have a bad lap? Then you'll be deemed to have gained an advantage even if you didn't. Or if you were driving fast, messed up earlier in the lap but cut a corner later in the lap, then your total delta is zero but you still cut a corner.
     
    Last edited: Dec 30, 2014
    Alessandro Greghi likes this.
  5. Stereo

    Stereo Alien

    The one I suggested on twitter seems to score ok in your scenarios, though I left the actual metrics for warnings/penalties out since I haven't tested it with an app. So I'm gonna say yes to most, no to 'e' (where it might penalize & shouldn't)

    1) calculate player's adjusted speed: length of track times number of AI segments crossed per second. For example if you go 0.01 of the way round the track in 1 second on a 2.5km track, your adjusted speed is 25m/s (90km/h)
    2) calculate AI's optimum speed in your car, over the same interval: clearly this can be done since the AI knows when it should brake. So for example it comes up with 60km/h.
    3) If your speed exceeds AI's by too much for too long, allow a penalty. Vague cause I don't know how accurate the AI predictions are or how much different lines will affect it. Of course, it will be combined with other cut detection - if you're driving fast inside the track limits, allow it. If you're driving slow outside the track limits, allow that too.
    It would look something like: 5%+ too fast over 1 second, give a warning. 5%+ over several seconds (meaning multiple tenths gained in a lap), slow-down penalty. 10%+ too fast, drive-through. To actually calibrate I'd run some hotlaps, some early/late apexes, all running inside track boundaries, and see what it spits out.

    This attacks the problem in two ways. First, of course, in order to gain a useful time advantage, you would be driving faster than the AI can, which can be measured. Second, if you make an off-track excursion to the inside of a corner, your rate of progress around the track will increase because you're driving a shorter circuit. If you cut Monza's first chicane, even at a similar speed to what you'd take through the chicane, you're making the track about 30% shorter over that period, your adjusted speed will be 30% higher.

    The main flaw I see is that in very high speed corners, where your car can't accelerate to its potential, point (2) will always indicate you're going slower than you could be. Maybe there's a way to work in the car's peak acceleration to work out how fast it could be going by that point, given how much it slowed at the most recent corner. Fortunately, that kind of corner being open to significant cutting is rare. This is the point where it fails scenario 'e' too - there's no way to detect a player "giving back" time since they're always going slow on straights.
     
    Last edited: Dec 30, 2014
    Alessandro Greghi likes this.
  6. Ben Lee

    Ben Lee Alien

    Yea, for example, there is no reason for any penalty or warning whatsoever if you say went off on the straight at Monza onto the grass, as there is no way to gain any advantage, so those "zones" should be just null. The zones would vary depending on the track, but using Monza as a chief example, the areas near the 3 chicanes would need to be cut "zones". A big general one covering most of the run off probably for more severe penalties (depending on player actions - is he full throttle etc?), then a smaller one nearer the apexes to dish out different, lesser penalties.
     
    Tony74 likes this.
  7. While what you said would work, it would require the zones be defined on all tracks, which means new ways of defining track limits in the kn5. I still maintain that Wally's method plus the two fixes requires less programming and less work to get the same results. It's not that your idea is wrong, it just requires more work to do which is probably why Kunos have stalled on implementing penalies in the first place.
     
  8. Champion Hero

    Champion Hero Simracer

    [​IMG]Stefano Casillo‏@KunosStefano
    so, removed the penalties from qualify/practice and so on, now working on a slow down system with more flexibility for races.

    4:01 AM - 30 Dec 2014 (12:04 UK Time)

    ===

    I really wish Stefano would actually post on here, so the conversations may take a breather. I won't open that can o'worms again though.

    Fingers crossed he's read these posts and is implementing something like the above. Good to know it's finally being taken seriously though!
     
    Erwin and phil like this.
  9. Whe've been using Wally's app in quite a few league raceswith 24 drivers. There has been no issues at all. Yes you might be given a penalty for something fairly innocuous but that's why you get 3 chances.

    I also don't know why people are talking about penalties for 2 wheels off track when this is legal.
     
    cerebus23 and jasjeet like this.
  10. ears1991

    ears1991 Alien

    yesss thank you stefano!!! i assume he means penalties disabled but then laps disallowed if off track detected for qualifying/hotlap mode.
     

  11. Thanks for the detailed response. Your idea does work. However I see a couple of problems not addressed.

    1. It needs to rely on AI's speed. Which as we all know is rather inconsistent, it's slow into hairpins, slow at corners like Eau Rouge, doesn't brake hard enough on downhills and brakes too early on uphills.
    2. Kunos will need to run the AI on each track config, for every single car, and have a table to compare user's time to that table. Not really practical. What about mod cars and tracks?
    3. What if you're slower on one corner, then you cut the next one, your time delta might appear to be the same but you've actually cut the track.
     
  12. Stereo

    Stereo Alien

    On point 1, I agree, but I'm optimistically assuming the AI can drive as fast as an alien :p maybe someday. Certainly the system will work better on cars/tracks that have 'good' AI.
    With 2, I don't really know enough how the AI works to speculate. It's 'user friendly' in a way that inclines me to believe the system is pretty smart about predicting this sort of thing.
    For point 3, I'd probably accumulate 'advantage' with some sort of exponential decay and ignore disadvantage. Just glancing at Monza's sections.ini, Variante della Roggia is 0.361 to 0.388 so maybe tune the decay to look at performance over the last 5% of the track. If you do a little better than expected, it's forgotten by the time you get to the second Lesmo unless you're given an actual penalty.
     
  13. martcerv

    martcerv Alien

    I think for qualifying its very simple just disallow any lap that exceeds the tyre limits set in the server, for racing using Wally's method has been working well for us. At times its a bit soft but this is just by how the track boundaries are set so not much can be done. Taking it a little further incorporating delta gain over the sector or positions gained vs cars that are still moving at normal speeds would be about all thats needed. For a huge cut like no lift cuts over chicanes like Monza and Imola a direct stop go penalty should be given these could be done by getting a gain of more then 1 second over a clean PB delta time.
     
  14. Naer

    Naer Gamer

    I think the iRacing system about off tracks, cut corner and flags is very useful. Something similar would be enough.

    I would love help with python code but I just started to learn. Good luck.
     
  15. jasjeet

    jasjeet Racer

    This is good, more people need to see this.
     
    Lucas - Xtremepsionic likes this.
  16. Tony74

    Tony74 Racer

    My only question is this :
    How do you intend to bring this to the attention of the developers if they rarely read their own forum ? Having great ideas or a perfect solution are wonderful things - but they need to be presented to the people who can actually make it a reality.
    It seems totally obvious to most intelligent people that the ideas presented here would save some amount of initial thinking & analysis at least. It's useful for a developer to let their customers discuss new ideas because they can then distil the solution from the best ideas available or evolve a better solution using the discussion as a starting point.
    So....
    Are Kunos reading this thread ?
    ;)
     
    Lucas - Xtremepsionic likes this.
  17. Please tweet them about this, i did but it seemed to have been ignored. I only did this to save them some thinking time, since all I've heard so far is how difficult it is to come up with a system that is feasible to program in.
     
    Last edited: Dec 31, 2014
  18. Tony74

    Tony74 Racer

    What me ? er... sorry, I don't do tw4tter. :D

    Anyone else wanna volunteer ? :oops: Now I look like a rite douchebag. :p
     
    Last edited: Dec 31, 2014
  19. Naer

    Naer Gamer

  20. kcheeb

    kcheeb Racer

    I think from a keeping things as simple as possible perspective (minimal code changes) adopting Wallys ruleset is the way to go.

    One thing I haven't seen discussed much is how the penalties pertain to each of the sessions and how to implement.

    My thoughts:

    Sessions:
    1. Practice - Warnings alone are fine, no actual Penalty meted out. This session is just that, practice, when trying to find the limit (yours, the cars or the tracks), going over it helps you find where it is. And practice has no bearing on the outcome of the race.
    2. Qualifying - Warning = lap disqualification. Qualifying can often come down to 100ths of a second, for first, second or any position. To allow someone 3 chances in one lap does not do justice to what qualification should be about.
    3. Race - N Warnings = Penalty. Penalties should be cumulative. If in the time it takes you to take your penalty, you continue to abuse track boundaries, you should have to pay for it.

    Configuration:
    Number of Warnings to Trigger a Penalty should be configurable. Allows server/league admins to set their own rules that work for their servers/leagues.
    Type of Penalty should be configurable - Drive Through, Time Penalty or ???. Allows server/league admins to set their own rules that work for their servers/leagues.
    Time Penalty should be configurable - Allows server/league admins to set their own rules that work for their servers/leagues.

    Implementation:
    When a Drive Through Penalty is not taken or not able to be taken (occurs on the last lap), it becomes a Time Penalty.
    Time Penalties are added to the total running time of the driver.
    For Online Racing the rules must be configurable and enforced on the Server. Having configurable client side parameters will lead to 'inventive ways' around the rules. Configuring and enforcing on the Server virtually eliminates that (as long as the penalty engine is built in to the client ie. not an App).
    For Offline Racing the default rules can be set up via an ini file (would prefer to see .config files used) and changed through a Session setup screen prior to entering a race.
    The Clients 'Penalty Engine' would take it's configuration parameters (see above) from the Server for Online Racing or the Clients Session setup for Offline(it shouldn't care which).

    Bash away :)
     
    Lucas - Xtremepsionic likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice