My friend is playing call of duty the new WW2 one that just came out. There’s a map with a GIANT cannon in the middle of it. It’s such a massive structure and it sits on a railroad track. I’m just curious what these were used for?
So, the one that is in COD WWII, I'm almost certain represents the 'Schwerer Gustav', the largest calibre weapon ever used in combat. The Gustav is part of a type of artillery called railway guns, because they were always moved via railways rather than roads. In general railway guns are designed to tackle heavily fortified positions and towns, but also fire in safety out of range of the enemy's artillery. The problem is these artillery pieces required to break through fortified concrete are so large that they have to be transported via railways, hence the name.
The Schwerer Gustav had a total length of over 43m, and had a barrel length of 32.5m. It fired an artillery shell that was 80 cm wide, and was originally designed to punch through seven metres of reinforced concrete. This artillery piece was so powerful it could accurately hit a target 39km away! In WWII it saw action in the Crimea, particularly the Siege of Sevastopol, where is knocked out coastal guns and damaged the Gorky Fortresses.
So simply put: The bigger and stronger defences a target had, the more powerful the artillery needed to be to damage it. This meant some artillery pieces were so large and so powerful they could only be carried via railways.
Here are some pictures of the Gustav
If you want to read more:
Engelmann, Joachim (1993) German Railroad Guns. Armor in Action
Zaloga, Steven J; Dennis, Peter (2016) Railway guns of WWII