so recently i was playing atilla tw online and brought a pike army. my opponent brought some byzantine crossbows and archers and shreded me. that made me wonder why were pikes so effective ? like during alexanders time he used them to great effect but couldent the persians just shoot arrows at them until they died ? its not like they could carry a big shield like hoplites to protect themselvs ?
There are limits to what a game will show you. As essential part of being a Renaissance or medieval pikeman was movement. The most famous of the soldiers using polearms, the Swiss mercenaries of the later 15th-earlier 16th c., would charge very fast. Archers, especially crossbowmen, didn't move too quickly- they mostly fired from one position. They could slow but would not always be able to stop that charge from the pikemen: that's why often an archer would be screened and shielded. Screened by other infantry, shielded by a pavise that he would set up in front of him.
By around mid 16th c. it had changed. The archers had been mostly replaced by soldiers with guns, and there would be aimed, moveable cannon on a battlefield as well. The musketeers or arquebusiers would be augmented with pikemen, and they would advance, loading and firing volleys, until near enough to the enemy line to close, the pikemen using their pikes, the other infantry swinging their guns like clubs.
Video games like Total War vastly oversimplify unit counters for the purpose of balance. Notably, as far as archery goes in TW, entire units never miss. No matter where the enemy unit is, hundreds of archers will instantly bombard the target with more consistency and accuracy than modern precision guided munitions. The "accuracy" stat is only a damage check to see how many hits do damage.
Try this in real life, and you'll find it's really hard to hit something when you can't shoot directly at it. Even if you do hit something, your arrow isn't necessarily going to have enough energy to get past the shields and armour they wore.
In fact, as a more modern point of reference, the French general Marbot during the Napoleonic Wars, upon encountering Baskir horse archers:
With much shouting, these barbarians rapidly surrounded our squadrons, against which they launched thousands of arrows, which did very little damage because the Baskirs, being entirely irregulars, do not know how to form up in ranks and they go about in a mob like a flock of sheep, with the result that the riders cannot shoot horizontally without wounding or killing their comrades who are in front of them, but shoot their arrows into the air to describe an arc which will allow them to descend on the enemy. But as this system does not permit any accurate aim, nine-tenths of the arrows miss their target, and those that do arrive have used up in their ascent the impulse given to them by the bow, and fall only under their own weight, which is very small, so that they do not as a rule inflict any serious injuries. In fact, the Baskirs, having no other arms, are undoubtedly the world's least dangerous troops.
While the Baskir irregulars in this clash were far from the elite archers in the medieval peak, they were shooting at tightly packed, unarmoured infantry formations - the dream fantasy matchup for gamers. But when only 1 in 10 arrows hit something, that's far from devastating.
Broadly speaking, in the era you are referring to, archery could disrupt an infantry formation, but they would seldom do enough to decisively take them down.
In contrast, it was much simpler in battle to have your soldiers lined up and crash into each other until the other side breaks. Real battle doesn't have the drone camera and instantaneous commands you give by right-clicking. This sort of battle requires the least amount of training, and benefits most from the simplest weapon to manufacture and use: the spear. Make the spear longer, and you have a standoff advantage. The heart of the battle was almost always the infantry vs infantry clash, with archers typically opening the battle as skirmishers and cavalry doing their thing on the flanks - the specialised troops filled the specialised roles while the core of the army fought in the front line.
The circumstances in which archers could overwhelm pikes were very specific. Those conditions were met in the English wars against the Scots, who used pikes in the schiltron formation, and the conditions were ideal in battles like Falkirk:
The result of this was unsurprising: the Scottish pike formations were shot to pieces by the English.
But change even just one of those factors and archers lose the decisive factor. When the Scots didn't use static pike formations or deployed forces to skirmish with or counter-attack English archers (as in Bannockburn), and the battle comes down to front lines crashing into each other.
In summary, pikes were the advancement of the most basic of battlefield weapons that made use of the most readily available resources for the most suitable style of warfare. Your phalanx is going to keep marching forward until it runs into something that can stop it. Bows aren't it, general.
*Mass archer units is notable here, as most archery in historical battles was more organic, with archers being embedded within units or troops being multifunction, as opposed to just having units of archers right-clicking as TW games do. This was certainly (figuratively) true for English armies, but few other armies played the strategy of spamming mass archers.