The AI "swarm" can best be handled by good tactics.
Try to get a wall in any border city that is a likely target A.S.A.P.
Try to get an archer/Catapult inside those cities as well.
When the AI Army is coming, try to prioritize effectively. I've found it's generally better to have your city and your garrisoned archer target the same unit to get a quick kill, rather then spreading the damage around allowing the AI to slowly gain XP for a free heal.
Before you attack any units, check the combat log for each. You may find that one warrior/swordsman is expected to take more damage then the rest. Generally speaking, this guy should be your first target. The goal is to cut the AIs numbers down as much as possible, as fast as possible. I generally avoid using my ranged attacks on siege unless the expected dmg dealt is on par with the melee. Usually, however, the siege units take less dmg from ranged attacks then the melee. It's typically better to try and have a melee unit or 2 to pick off the siege. Horsemen are ideal because of their mobility.
After you've assessed which enemy units are most likely to die, you attack. If you happen to have a 2nd or even 3rd archer at the city by then, even better. You're pretty much assured to get the kill then.
When you upgrade your units, it's generally better to have some go down the rough terrain path and some down the open terrain path, rather then having individual units get both. A specialized unit deals much more damage to it's target then a generalized unit. Make sure, as the game goes on, that your army has a good mix of rough and open terrain units and that those units are always used where they are strongest.
Lastly, if you feel that one enemy unit is the difference between losing your city this turn, or saving it this turn and wiping the enemy army, send out a worker or weak unit to sacrifice. The AI will often waste their attack point on that unit rather then the city. You may lose a unit/worker, but you will save the city.
For missing out on wonders, don't focus on wonders. Pick a 1-3 in each era, at most, that you want and focus on them. If you head straight for them on the tech tree and make sure to start building them A.S.A.P. you will usually get them. It's okay to let the AI get most of the wonders. Just make sure if you have wonders you want, you build a strategy around them. There's no reason to waste hammers on, say, Great Wall, if you're on an island. Colossus is typically only worth focusing on if you have a city with a large number of ocean resources.
Also, if you want to absolutely maximize your chances of getting a wonder, either put your city on production focus or manually move citizens around to increase your production while the wonder if being built. I'll typically cut the build time down by 25-33% this way.
When it comes to the AIs GDP, yes they get gold bonuses that we can't match. We can, however, use that to our advantages. Sell off spare luxuries and strategic resources. Sell open borders even. There's no reason to hold on to them if you aren't gaining any benefit. It's better to get 200+ gold then to have the resource sit there idly. The AI seems idiotic when it comes to diplomacy. It can't assess true value. In it's mind, a luxury always has a fixed value dependent solely on it's relationship with you. It doesn't matter if the AI is at +100 happiness or -20, and it doesn't matter if the AI is planning on attacking you in 2 turns. It has a fixed value and it will stick to it.
Try to get a wall in any border city that is a likely target A.S.A.P.
Try to get an archer/Catapult inside those cities as well.
When the AI Army is coming, try to prioritize effectively. I've found it's generally better to have your city and your garrisoned archer target the same unit to get a quick kill, rather then spreading the damage around allowing the AI to slowly gain XP for a free heal.
Before you attack any units, check the combat log for each. You may find that one warrior/swordsman is expected to take more damage then the rest. Generally speaking, this guy should be your first target. The goal is to cut the AIs numbers down as much as possible, as fast as possible. I generally avoid using my ranged attacks on siege unless the expected dmg dealt is on par with the melee. Usually, however, the siege units take less dmg from ranged attacks then the melee. It's typically better to try and have a melee unit or 2 to pick off the siege. Horsemen are ideal because of their mobility.
After you've assessed which enemy units are most likely to die, you attack. If you happen to have a 2nd or even 3rd archer at the city by then, even better. You're pretty much assured to get the kill then.
When you upgrade your units, it's generally better to have some go down the rough terrain path and some down the open terrain path, rather then having individual units get both. A specialized unit deals much more damage to it's target then a generalized unit. Make sure, as the game goes on, that your army has a good mix of rough and open terrain units and that those units are always used where they are strongest.
Lastly, if you feel that one enemy unit is the difference between losing your city this turn, or saving it this turn and wiping the enemy army, send out a worker or weak unit to sacrifice. The AI will often waste their attack point on that unit rather then the city. You may lose a unit/worker, but you will save the city.
For missing out on wonders, don't focus on wonders. Pick a 1-3 in each era, at most, that you want and focus on them. If you head straight for them on the tech tree and make sure to start building them A.S.A.P. you will usually get them. It's okay to let the AI get most of the wonders. Just make sure if you have wonders you want, you build a strategy around them. There's no reason to waste hammers on, say, Great Wall, if you're on an island. Colossus is typically only worth focusing on if you have a city with a large number of ocean resources.
Also, if you want to absolutely maximize your chances of getting a wonder, either put your city on production focus or manually move citizens around to increase your production while the wonder if being built. I'll typically cut the build time down by 25-33% this way.
When it comes to the AIs GDP, yes they get gold bonuses that we can't match. We can, however, use that to our advantages. Sell off spare luxuries and strategic resources. Sell open borders even. There's no reason to hold on to them if you aren't gaining any benefit. It's better to get 200+ gold then to have the resource sit there idly. The AI seems idiotic when it comes to diplomacy. It can't assess true value. In it's mind, a luxury always has a fixed value dependent solely on it's relationship with you. It doesn't matter if the AI is at +100 happiness or -20, and it doesn't matter if the AI is planning on attacking you in 2 turns. It has a fixed value and it will stick to it.