Proof of Red
This post is a break from the AI beat - no tokens, no margins, not a single datacenter. It's about a small side project, and the one clever trick in it, engineered in 2019.
Better Traffic Laws is a GTA 5 mod that makes traffic laws exist. Vanilla GTA couldn't care less how you drive - you can run every red light in Los Santos in front of a parked patrol car and nobody blinks. The mod makes ten offences stick, from speeding to riding without a helmet - the same mod whose delayed release opened my GitHub Actions outage post. Most of those offences are easy, because the game itself will tell a script that the player drove against traffic, hit a pedestrian, or is mid-burnout. One offence is not like the others.
Rockstar tried it in 2001
Obbe Vermeij, then a technical director at Rockstar North, gave GTA 3 players a wanted level for running reds. "This was not popular with the team. I quickly removed it," he wrote last year. The police in every GTA since react to murder, not to traffic - by design.
Modders keep disagreeing, in every GTA that can be modded - a roleplay niche, but a stubborn one. San Andreas had a CLEO script that already required a police witness, GTA IV had Traffic Felony, and GTA 5 grew a whole family: a 2015 Traffic Laws that shipped five offences and skipped the red light entirely, Pull Me Over from 2017 with 385,000 downloads on its final version, two active recreations of it, and mine, at it since June 2019.
The game will not tell you the light is red
To ticket a red-light run you need one fact: the light the player just crossed was red. The game holds that fact and will not share it.
ScriptHookV .NET (SHVDN), the layer GTA 5 script mods are written against, exposes thousands of the game's native functions. Grep its entire surface for TRAFFIC_LIGHT and you get exactly one hit: IS_VEHICLE_STOPPED_AT_TRAFFIC_LIGHTS. Note what it describes - a vehicle, not a light. The wider catalogue is no richer: the FiveM native database, the community's most complete, adds only a setter that paints a light's bulbs, which the game's own drivers ignore. A function that reads a light's state exists in neither.
My first version still carries the corpse of the obvious attempt: a function called GetNearestTrafficLight, holding the model hashes of seven traffic-light props, defined and never called. You can find the light. You cannot ask it anything - the prop is scenery. Even in GTA 3, per Vermeij, the cycle lived not in the prop but in the road nodes, keyed off the prop's orientation - cars kept obeying a light after a truck knocked it over. A quarter of a century later, the object you can see is still not something a script can question.
Ask the traffic instead
IS_VEHICLE_STOPPED_AT_TRAFFIC_LIGHTS, the one native that does exist, is a fact about an AI driver - its driving task knows why it is waiting. The light won't testify, but the drivers will. So the mod stopped asking where the light is and started asking who else has stopped for it.
The question goes to a vote, re-run every frame: every car within 25 metres with a driver at the wheel, pointing your way within 30 degrees, votes on what color your light is - and each ballot is weighted by where the voter stands:
// slightly simplified: every co-directional driver within 25 m votes,
// discounted by distance and by how far into another lane it sits
foreach (Vehicle v in nearbyCoDirectionalCars) {
float weight = DistanceFalloff(v) * LaneFalloff(v);
if (v.Speed != 0)
greenWeight += weight * ForwardSpeed(v) / FlowSpeed; // movers vote green
else if (v.IsStoppedAtTrafficLights)
redWeight += weight; // held cars vote red
}
// past the whole queue and red wins the vote: latch the crossing,
// capture the witness, judge the net turn 4 seconds later
if (pastTheQueue && redHasQuorum && redWinsTheVote)
LatchCrossing();
Movers vote green, because flow at speed happens only on a green - the game's own drivers never run a red. Stopped cars flagged by the game vote red, and red needs a quorum - a lone half-heard witness at the edge of the radius can't reach it. And the weights do the lane-splitting: your lane speaks at full volume, the adjacent lane at a murmur, two lanes over is near-silent, so a turn lane held on red beside your green can't outvote the moving traffic in your own. The same arithmetic covers the traps. A single witness would fine everyone a fresh flip catches still rolling through the intersection, but the tail's flow votes down the first driver braked at the line - only an established red convicts. A traffic jam is stopped cars without the flag, and cross traffic fails the direction check.
The case opens the moment the last car of the queue falls clearly behind you, never below a crawl. The verdict then waits 4 seconds and judges the net turn: a right is a legal right-on-red, a left from a standstill is excused as a green arrow the vote can't see, anything else stands if the officer captured at the crossing saw it.

Every ballot is discounted by where the voter stands: full volume in your lane, a murmur one lane over, silence beyond - fading with distance out to 25 metres.
Petrol stations earned an exemption too - no native answers "am I at a station" either, so the mod finds the fuel pumps, because cutting across a forecourt past a stopped queue looks exactly like overtaking at the line.
The ones that came before
Better Traffic Laws was the first mod that detected a red-light run reliably. Not the first to try - Pull Me Over listed the offence in October 2017, twenty months before me, and its last release is from August 2018. Mine is also the only one of the family whose method you can read in the source.
The scheme has honest limits. An intersection with no traffic is a free run - no witnesses, no case, though that much is consistent: every offence in the mod needs an officer with line of sight, and real law leans on witnesses the same way. The whole construction trusts a game flag it cannot audit. The witnesses are only as good as the game's own drivers - which is also true outside the game.
Still alive
The mod turned seven in June and had a busy week. Violations now build a rap sheet with consequences you can actually pay for: pulling over near an officer, unarmed and still for three seconds, settles it - fine collected, stars gone.
Vermeij pulled red-light enforcement from GTA 3 because the team hated it. Twenty-five years later I sell it as a feature. They were probably right about most players - the downloads say they weren't right about all of them.