Ok, time to lay some more facts down, about historic combat.
No, they NEVER mindlessly marched at each other in lines, firing.
A THING TO REMEMBER IN ALL WARFARE, since beguinning of warfare: Killing your enemy is good, but it is NOT the aim of battle, the aim of battle is to destroy the army, you do NOT have to kill them to do this, just break them up, and enemy who runs away is good for 2 reasons: 1/ You have not lost men in killing him. Killing ppl involves losing your own men too. 2/ As he runs, the enemy causes more disarray and fear in his allies, since they see him running, and know he was beaten. Ultimate aim of all battle is to win with minimum of losses to yourself, so driving enemy from the field is best solution. While he runs you can charge him down with cavalry without loosing many men, and seeing your comrades being lanced and bumped to death is very demoralising. So then the next unit runs without even fighting, and a cascade effect causes armies to dematerialise.
I will try to explain some of the thinking, the sociological and physical limitations/effects, and the aims of warfare at this time.
At this time the firearm had to make a sacrifice: You could have accuracy (rifles DID excist) or you could have high rate of fire (smoothbore musquets). Most armies chose both. The massed ranks you see were almost exclusively musketry. These are not crude arquebuses tho, they are massed produced, fairly reliable performance-wise, and accurate to around 100 metres, hit or miss to 200 metres, after 200 metres your pretty safe from individual shots.
Armies where not lead by men on foot, but by men on horseback. Armies, to be effective, comprised of 4 basic types of troops: Line infantry, Light infantry, horse, and artillery *NOT ww1 or later style arty, which fired several miles onto grid positions, but still a powerful tool*. These are very rock paper scissors units when they are trained sufficiently, but none of them was effective when used alone: Artillery can pound Line infantry, Line infantry can easily stop horsemen dead, horsemen can destroy artillery and light infantry, light infantry can do significant damage to line infantry and artillery.
Tactics, and uses of units: lets remember, each unit type must be helped by other types, or he is fucked.
Since men first rode animals to battle, cavalry has been the king of the charge on open field: Today, cavalry means tanks, and they still rule the open field (up to a point, the tactical nuke was developed to finally end this balance of power).
Now, armies of the timeframe we are discussing here were led, in general (I pun, hehe), by nobility. Nobility tends to mean: Money. So rich men, they ride horses to battle. So the cavalry tended to be the favorites of many comanders. Everyone wants to win the day with an epic and glorious charge of gleaming mounted men on well bred steeds. It looks good, it sounds good, hell, it IS good. Cavalry CANNOT charge fortified positions. But you ask "There are no fortified positions on a battlefield, how did they stop cavrape?". This is how:
Most men, they cannot afford horses, and the king, presidente, el jefe, the bigwig, the chief, Comander, Field Marshal, Maharaja, THE BOSS MAN, he isnt going to buy everyone a horse, so instead, he gives them: The musket. Now lets put ourselves in the shoes and britches of one of these poor sods. You didnt want to be a soldier, you wanted to be a hairstylist, but your mother died of the pox, your father was hanged for stealing a loaf of bread and 2 eggs, so you joined up at 16 because they gave you a decent meal and a pair of trousers to call your own.
HOW are you going to survive with your musket against the rich guys, who want to ride you down with their Champion Destriers? Well, 4 things are going to help you: 1/ Your bayonett 2/ The men to your left and right 3/ Your training and drillpractise 4/ Your officers and NCO's. A well trained group of line infantry man were immune to cavalry, if that cavalry was unsuported by any other units because of these 4 things. 1 and 2 combined to make your line a spearwall, and no cavalry will charge a spearwall without loosing those expensive horses, and who wants that? 3: You would drill till you dropped some times, because it saved your life, and practised many moves. To stop cavalry, you need a fortified postions, since cav can ride around and flank a spearwall....what can you do you? THE SQUARE! The fighting square is one of many manouveres that line infantry had to practise. It comprises of the line folding itself from a center point, then twice more, untill the 2 flanks meet at the back. The officers, the units flag, the guy with the drum and that bloke who plays the flute go in the middle, the NCO's spread themselves around the walls, and the outermost men fix bayonets and crouch. This means horses cannot charge you from any direction, while the 2nd and 3rd ranks, inside the ring of bayonets, can reload and fire at the nasty horsemen, without fear of being made into kebab.
Now, the square is EPIC WIN against horses. BUT: Its suicide if that unit of enemy horses has infantry lines and/or artillery. While your in a fighting square, your all packed deep in ranks, and it is easy to get multi-kills by shooting at you. You dont want this. A few well placed cannon shots, or, worse still, HORSE ARTILLERY! This can be easily towed into range for a cannister (read: SUPER SHOTGUN) blast. Even a smallish cannon firing cannisters into a fighting square will quickly make baba ganoush out of the infantry. Likewise, a line of infantry firing at a square can concentrate so much more firepower that it is not untenable to hold. AND, if you break the square because your being effectively machine gunned by enemy, guess what happens? The nasty horses that you made the square for in the beguinning, they rape you.
So, you need to support that infantry line. If you have some horses of your own, that can prevent the whole action from ocurring, since 1/ Enemy cav will not charge your line if they know they will get backstabbed by your lancers, noone wants to be ganked by bayonets infront and cav behind, thats not good business.
2/ No horse artillery will dare to get close to the line to pepper it, since mangy cart horses towing a gun cannot outrun Champ Coursers, so thats prevented
3/ Enemy line infantry will not want to flank your line, cause then they will get charged, have to form a square, then get machine gunned themselves
Soooooo....we seem to have reached an impass....since both you and the enemy brought infantry, cavalry and artillery to the field, what can be done. Well, obviously, you want to win the day, the glory, and the best KDR possible and all that, you need to outthink your opponent. Muskets cannot be fired and reloaded effectively while moving, so marching at a well trained line is suicide, unless you have a massively numerically superior force, but even then it might not work: Being blasted again and again with gunfire will make most people run away eventually. So..what to do. Hopefully, you did the right thing 6 months ago, so you can win today: TRAINED HARD. Your men must be able to form the square, wheel effectively without breaking ranks, spread and close the lines as needed, and many other manouveres. They must be able to reload quickly, with or without bayonets fitted, and must be proficient at aiming the weapon, and also fighting with the bayonet, attached to the gun as a kind of heavy spear, or detached as a kind of long dagger. Some units had longer bayonets just to keep their options open. A FEW units had dedicated melee infantry attached, who thre grenades when needed. They must be able to do all this while ppl are trying to kill them, usually with fire and/or the sword. Sometimes with the axe, too.
Lets make a scenario: Numerically matched forces, on an open field with no terrain features, much like chess. This was never the case I imagine, but if you can win in this scenario, you can win when theres other stuff to use to your advantage aswell.
So, you've placed your artillery where it commands the battlefield, but not within range of the enemies artillery. Unfortunatly, if he cannot hit your artillery, then you cannot hit his either. This isnt strickly true but since we are using equal forces for this scenario, lets use equal caliber and ranged guns. So: the enemy comander is no slouch, he has drawn his line, he has his cavalry watching his flanks, his guns watching the middle, pretty much the same as you have...what to do. If you KNOW for a fact that your infantry has MUCH better morale, and have trained them to the point that they can fire 3 times a minute, you COULD advance towards enemy lines, ignore the cannons blowing holes in you, let enemy have first volley while you get your line straight, and then trade shots with him....but thats risky, and bloody, and then even if you win you have to train more men...dont really wanna do that unless you got no choice.
You could choose the column, a tactic favoured by Napoleon to break an enemy line (Napoleon was NOT a great commander, I'm very sorry to say, he was good, but not great, and had a very over inflated sense of his own self worth). This consisted of marching his men at the weakest (or the percieved weakest) point in an enemy line, ina comlumn as averse to a line, banging drums and singing, in an attempt to make that point of the line break and run. While this is effective against poorly trained, unsuported infantry, it didnt work so well against trained lines with arty support, and tended to leave an ugly line of dead elite infantry, with a high tide line where the column finally broke and ran away. So...we are back at square one...
Now, the smart commander, he knew that cannon balls bounce, so if your men are standing in formations and a cannon ball goes thru, it goes....well, through, killing some men, bouncing, killing some more, bouncing, untill it stops. So when your men were not shooting, or marching, and cannons could range them, you told them to lie down, in formation. This way 1/ they would take less losses, with musket fire from range being mostly innefective and cannons only scoring kills on direct ground hits, all airtime being innefective cause everyone was at ground level and 2/ they would not be able to see enemy formations so would not get any funny ideas about pissing off.
So...if you advance your formations, they will be shot at and then involved in a costly trade of shots....if you order them to fix bayonetts, you are effectively slowing their rate of fire because its not so easy to reload a musket when you cut your hand in 2 places each time, so charging is a last minute thing...you need to break the stalemate.
CALL THE LIGHT INFANTRY!
The light infantry were skirmishers. Trained to use cover, to fire from prone, to work in pairs with one loaded at all times, all sorts of un sportmanlike behaviour, dependant on their point of origin. In some armies they were equipped with the slower firing but more accurate rifles, but many were not, so lets say for this scenario, neither side has rifles. So the light infantry has a job, and that job is to be very annoying to everyone else. As soon as either side deploys light inf. the enemy must counter it, ideally by charging them with cav, but if light inf see cav, they run for their line infantry, who volley the cav, its not great. So, when countering light inf, you deploy your own light inf. And these 2 forces fight a "mini battle", because if they push the enemy back they can get within range of the main line, and once there, they will do their best to stay covered and focus fire on key players, as in officers, NCO's, the geezer holding the flag, men at the flanks of line formations, as much as they can to piss the enemy off. They can do this with some immunity to return fire since ideally, you dont want to fire volleys from the line inf at the light inf: IF the enemy starts firing volleys or loose fire at the light infantry, the tables have turned.
You can now march your line infantry into range, because your enemy has started firing at men who are hiding and lieing down. Any advantage you can make, such as having enemy fire before they can hit your main force, must be taken, and then in the exchange of volleys, if you can match or best the enemy rate of fire, and if your light infantry have managed to take down some leadership figures, the enemy line will break before your men do. Once they break, bingo! Your men opposite the broken formation fix bayonetts and charge into the gap, the two untits either side of the enemy gap can wheel and enfilade the unbroken enemy. The unit who charged home can then form up again inside the enemy line, firing directly down the lines, doing massive damage. At this point enemy cavalry and command unit could save the day for their forces by charging into the gap, but hopefully your cav can threaten enemy artillery, forcing enemy cav to counter them. With the gap in enemy line not being plugged, you are free to widen it with sustained musketry and bayonett charges.
Now that scenario is pretty much won, because without infantry the enemy cannot hold the field. So imagine now with terrain, unmatched forces, different levels of training and commitment.
A bloodbath, sometimes yes. Mindlessly marching into enemy guns? No.