in all the short films we were shown in school, cannons were shown shooting into large densely packed groups of infantry. while this seems like it would be useful at carving out large sections of said densely packed ground, i doubt that no military tactician would come up with the idea of scattering the troops to prevent this. i also feel like cannonballs would be far too expensive to be used for anything but siege
Cannon firing into infantry is a pretty accurate depiction of combat of that era.
Cannonballs themselves were relatively cheap and were easy to manufacture. The main issue was the size and weight of the cannon themselves. Field artillery was less heavy than siege artillery and was limited on how big/heavy the shot they could fire. The cannonball could only hit in a direct line. A standard infantry line as used by the US and the British in that war was only 2 soldiers deep, unless they were in column march - and they never knowingly approached artillery in column if that cannon was unlimbered or in a position to be unlimbered and could fire on them. So, a cannon shot would usually only take out a single soldier and maybe one behind them. With a good bounce and good terrain, it would then tear into any troops behind knocking them down in the same sort of fashion. The dream of an artillery man was to see an infantry unit in a linear formation marching in such a way that the cannon was lined up right down the line. An artillery battery could kill hundreds in a volley, or two, of solid shot.
Where cannon was normally deadly to infantry was when they switched to canister, which basically converted the cannon into a massive shotgun and that shot could kill dozens in a single shot. But, that was a short range weapon as the blast would disperse over long distances mostly missing anything further away. Canister was maximized to hit linear formations marching towards the cannon.
Infantry had to be massed. The weapons they used were massively inaccurate at any ranges over about 50 meters away. They also had a low rate of fire. So, thinly spread out, they could get off one shot of their musket, which would likely miss, then be defenseless until they finished reloading. But, get the infantry massed within range to fire their muskets at an artillery battery and the odds are that the artillery battery will lose a lot of men and likely the gun itself. So, artillery had to also be supported with infantry to that from happening. (Although the biggest risk to artillery was usually cavalry as it could rapidly approach. A lot of thought had to be put into making sure artillery, cavalry, and infantry were mutually supporting each other). Scattered infantry was also deadmeat against cavalry. The main objective of a lot of these battles was to break the enemy formation, then exploit those broken formations with cavalry.
Tactics then were dominated by getting mass into position to do damage and 10% losses were common and expected.