MassTraffic-Test
MassTraffic-Test copied to clipboard
Mass Traffic plugin extracted from CitySample for UE 5.5. Trying to understand it
TrafficTest - (modified) Mass Traffic Plugin for UE 5.6

Important
(modified) Traffic Plugin extracted from CitySample. We use this plugin in a project, so I'll try to share as much of 'our' code as possible as some sort of 'giving back to the community'. I hope someone finds it helpful.
Re 5.6 update: ~~I just did the bare minimum and "fixed" the compiler errors and warnings and some runtime asserts (FMassEntityQuery changed quite a bit).~~ ~~I don't claim this to be perfect but "it works". Will revist the upgrade after Epic released the 5.6 City Sample so I can see the errors of my ways.~~ Updated my code with the real 5.6 City Sample.
Thanks to: https://www.youtube.com/watch?v=RRWr_Hnn5Bg https://www.youtube.com/watch?v=otdm3KhM6vs
Added:
- generate ParkingSpot and TrafficLight data from special actors (editor-only) in the current map (discontinued)
- removed RuleProcessor and therefore Houdini import for parking spaces and traffic lights
- upgraded to UE 5.5 codebase
- separate trait to specify size of entity in config
- support for Chaos Vehicle to interact with MassTraffic
Notes:
Minimum car configuration:
- LODCollector
- Traffic Vehicle Visualization
- Traffic Vehicle Volume (new added by me for obstacle processing)
- Traffic Vehicle Simulation
- Assorted Fragments
- Mass Traffic Random Fraction Fragment
- Mass Traffic Vehicle Lights Fragment
- Mass Traffic Debug Fragment
Traits
MassLODCollectorTrait
MassTrafficVehicleVisualizationTrait
MassTrafficVehicleSimulationTrait
MassTrafficVehicleDimensionsTrait
MassTrafficVehicleVolumeTrait
MassAssortedFragmentsTrait
Fragments
FTransformFragment
FMassVelocityFragment
FMassForceFragment

Minimum intersection configuration
(no further investigation by me because I need a more "European" approach to traffic lights)
- LODCollector
- Traffic Intersection Simulation
- Traffic Light Visualization
- Assorted Fragments
- Transform Fragment
- Mass Traffic Intersection Fragment
Important
- MassTrafficSubsystem::ClearAllTrafficLanes() must be called when MassSpwaner::OnDespawningFinished event is fired

Chaos Vehicle <-> MassTraffic
MassAgent config for Chaos Vehicles to be recognized as obstacles in MassTrafficProcessor still working on the other way round
