---
title: A Unity City Where Bad PLC Code Made Cars Crash
description: A REST-controlled traffic-light sim for a cybersecurity event. Wrong control logic didn't print "incorrect"; it piled cars into the junction.
date: 2026-05-01
period: 'July-August 2018'
thumbnail:
  src: ./_assets/city-simulation.jpg
  alt: Screenshot of a Unity traffic simulation.
article:
  tags: ['simulation', 'systems']
  role: Simulation author
  stack: ['Unity', 'C#', 'REST API', 'Blender']
  outcome: Visible consequences for an otherwise abstract PLC challenge
  audience: technical
project:
  title: City Simulation
  description: A Unity city where REST-controlled traffic lights made bad PLC code visible as car crashes.
  thumbnail:
    alt: Screenshot of a Unity city traffic simulation.
---

Most security challenges punish a wrong answer with a red "incorrect". This one punished it with car wrecks. For a PLC cybersecurity event in the summer of 2018, I built a small Unity city where the traffic lights were driven over a REST API by whatever control logic the contestants wrote. Good logic produced boring, flowing traffic. Bad logic produced intersections that people gathered around to watch.

I've never seen a quiz make a lesson land that fast. A junction locking up because your ladder logic forgot a state is feedback no scoreboard can deliver, and people debugged noticeably harder once their mistakes were entertaining to everyone else in the room.

All decisions ran on the server and were broadcast to the watching clients; the genuinely difficult part wasn't the simulation but keeping that broadcast alive on conference Wi-Fi without flooding it. I built the whole thing solo, including the car and building models in Blender, which I mention less as a flex than as the explanation for how everything looks.

There was also a HUD overlay that showed live tweets about the event. It felt clever in 2018 and has dated exactly the way you'd guess.
