One part of the answer happens every frame. The game picks what to draw out of everything on the map, up to about fifteen thousand things ("Our worlds usually has max ~15000 objects", in Daniel Collin's words). Each one gets an invisible ball, and the test is whether the ball is inside your view.
DICE's engine had shipped five games doing it the clever way: "Hierarchical Sphere Trees", balls inside bigger balls, so a whole corner out of view is skipped at once. But a tree is scattered all over memory, and on those consoles one trip to memory "can be around 600 cycles". For Frostbite 2 and Battlefield 3, Collin's "first try was to just use parallel brute force": every ball in one flat row, checked start to end, on every core. It came out "3x times faster than the old culling", with "1/5 code size". And a wall blown out leaves the row with "the swap trick": swap with the last entry and decrease the count.
Collin's conclusion slide: "It's all about data. Simple data often means simple code."
The map, the vehicles, the figures, how many balls there are, the tree, the memory tape and the race's timing are our own simplified version, built in code from Collin's talk; the 3x is his measurement, not ours. Not affiliated with or endorsed by DICE or Electronic Arts.
Which Battlefield map did you play the most?
Sources: Daniel Collin, "Culling the Battlefield: Data Oriented Design in Practice", DICE, GDC 2011 (the published slides and their presenter notes).
Sounds and music: our own, made in code.
