Also, an important question: when you're big and late, when you have to upgrade your Muskets to Infantry, for instance (I wait until I can have INF), do you upgrade manually and prioritize Leo's, or do you simply produce new units to replace the old??
Reading your comments here, I get the impression, that your style is more the "warmongering style" as opposed to the "peaceful builder style", correct?
In that case I would say: you need neither Muskets nor Infantry...
If you are attempting to win a game in warmonger style, you want to attack, not defend! So my advise is: up to Monarch level, you don't need any defensive units. The AI is so incompetent, that it won't get a chance to attack you, if you play your trumps right. Just build Horsemen (or Knights), and conquer the world. On Emperor/Demigod, you need perhaps a handful of defenders to protect the valuable attackers against the occasional counter-attack, or to protect an important choke-point or a vulnerable flank.
(I'm currently playing a Demigod game, where I built 4-5 Pikemen and the rest of my army consists of ~30 Knights, no artillery-type units. Artillery was not necessary here, as I managed to attack, before my opponents had Feudalism (or I managed to disconnect their iron, before they were able to build a significant number of Pikemen), which means, my Knights are up against Spearmen and there is no need of artillery. True, I lose a Knight here and there, but replacing the lost Knight (70s) once in a while still takes less resources than if I had to build upfront let's say a force of 10 Trebuchets (300s). Plus consider the two factors, that these extra Trebs would cost me 20gpt in maintenance, and would
slow down my advance. In a Republic, speed is the most important factor. You need to break down the AI's resistance, before a) the AI can build many defenders, and b) your war weariness reaches an annoying level. BTW: if you want to compare your approach with the result of that of other people, you can play the same game: it's
COTM 164 (Inca, Demigod, but very good start position for the human player, so it plays more like Emperor than Demigod). You just download the 4000 BC .sav file, play it according to the GOTM rules until end of September and submit it. The download site, upload site and the rules of the GOTM competition are available on the
GOTM homepage.)
On Deity and Sid, of course you need more defenders. But it depends on the terrain and the strategic situation. E.g. on an archipelago map, with no safe crossing before Navigation, I may need no defenders even on Sid, because the AI simply can't get to me...
But leaving the question of whether or not you need defenders aside, that still leaves the question of whether to upgrade or replace your attackers. And my advise is to always upgrade. Going back to the above-mentioned Demigod game: more than 20 of those 30 Knights were upgraded from Horsemen. Once I reached Chivalry, I set research to 0%, and then upgraded all Horsemen, while my core cities were busy building important improvements like Marketplaces, Aqueducts, Barracks or Courthouses. Basically, while my shields went into civilian build-up, my gold went into the military, so I was able to continue warmongering, while at home a peaceful build-up phase was going on... (And I had already earlier upgraded all my military police 3/3 Warriors to Swordsmen - and later Medieval Infantry - and used them to capture the first few cities of a direct neighbor, while my Horsemen force was still in preparation. This is what allows early wars, while at the same time not neglecting your civilian build-up too much. To give you a rough estimate of what I mean by "early": in this particular game I switched from Despo to Republic around 1400 BC, and now it is 200 BC, and I have already eliminated 2 of the 3 AIs that share the same continent with me. Attack on the last AI has already started, and I also fomented a few wars on the other continent, so the AIs will already deplete their stock of units against each other, before I will begin my invasion of the other continent...
Upgrading is definitely the way to go, if you want a big army quickly. In some situations (e.g. shield-scarce start locations) it may even be best to do the "disconnect-connect" tactic to build up a large army quickly, because it is the best way to use both,
your shields and your commerce, for producing units: you have a warrior and 6 workers on your iron hill. Every turn, the warrior pillages the iron, then you set all cities to produce Horsemen, and then the 6 workers connect the iron again. Interturn, whenever a city completes a Horseman, you zoom into it and upgrade it to Knight immediately.
With regards to Leonardo's: I don't prioritize it. If some nearby AI builds it for me, I'm happy, but if not, it's no big deal. And most often, when I play for a military victory, the game is over, before any AI manages to research Invention and build that 600s wonder... So waiting for Leonardo's would only slow down my victory date...