Thanks for the quick responses, I have tons of submods lol, but I found my problem, my general was a noob general

he had like 1 star and horrible traits, my army although they had taken Barcelona was still inexperienced and even though they were higher tier the force sent against me (I just found out) may have been weaker units but they were battle hardened, as for their general it was the king of Aragon with 9 stars and 55 bodyguard, my bodyguard also got stuck instead of charging full speed down the street into the knights they made a b-line for the gate opened it got stuck then at the last second charged into the knights. So now that I look back everything went the way it should have spears suck against swords (javelinmen) so in the long run I just made a few horrible maneuvers.
You see I sent half my army (all of my sargeant spearmen) at the gate and put them in a semi circle as many of you do as well to box in the invaders. But when they charged in and starting just destroying my forces I decided to pull my men back in a covered retreat to the town center. The fatal mistake was sending my right flank out first, once they left the flanks caved in and the rest of my gate force was destroyed leaving only those 2 sargeant spearmen that escaped, and the armoured sargeants and light men at arms. So they just charged into my 600 man defense, I think my force should have killed alot more of them but now that I look at it it was my poor strategy that lost me the battle, thank you again I didn't think clearly on the situation since I never have lost a battle as badly as I did then lol damn AI having to be so smart
