system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5 : in medieval battles how did people know who is on their side and who needs to be killed. If it was as chaotic as in i.e. GoT depicts there is no way to tell who is who.
gpt
Everyone is mentioning uniforms, but that's incorrect. Having any form of uniform wasn't very common for a lot of histoey. Standing armies night have a mandated uniform and armor, and later on livery became common (even then, not everyone had one), but for most of history you bought your own armor and wore your own clothes. There was no uniform. Of course by medival times, on which game of thrones is based, livery was common. And it does show up in game of thrones with, for example, the very distinctive Lannister army gear. However, the fact that armies have only had uniforms or livery for a relatively short time but managed not to kill their own men even before that suggests that isn't the explanation. 

Instead, the problem is that game of thrones is really bad at depicting battles. Very little warfare in history involved skirmishes where everyone got into a giant mess and people paired off and fought their duels, with everyone else fighting around them. It looks awesome on tv, but it almost never happened. For starters, most warfare was seiges and maneuvers. You sit outside a town or castle until the people inside starve, or you lead a giant army and yell "you better watch out or we're gonna attack" and breathe a sigh of relief when the other guys slink away. 

When a battle did happen, it looked very different from battles on GoT. You didn't pair up and fight other people. Instead, your army forms a few lines, their army forms a few lines, and the two groups stand across from other and try to kill the other side while doing their best to not die. Some units might move around, cavalry might charge, arrows would be shot, but it almost never happened that the formation broke up and the battle broke down into a bunch of duels (if the formation did break, it's because someone was running *away* from the fighting). You fought the entire battle surrounded by your own men, which made it really easy to know who to kill. You kill the guys opposite you - the ones poking a spear in your face - and you don't kill the guy behind you. 

Now, skirmishes did happen of course. A unit might get isolated from their army, a small part of the formation might break down, a travelling group might get ambushed, a ship might be boarded, etc. But they were between small groups, not entire armies. You would know everyone on your side because you've been travelling and fighting with them.