Everything in Civ3 is a balancing act, and concentrating on one direction inevitably means that others will suffer. That's why it's important to decide what you intend to aim for, certainly over the near-term, and then pursue that aim accordingly until it's achieved.
Need more land/ productivity? Build Settler-/Worker-pumps. Need to conquer because there's nothing left to Settle and/or your neighbour's Culture is stronger than yours? Build Barracks/military and acquire strategic Resources (or vice versa). Want/need to learn more techs? Build Libs+Unis and/or rearrange your finances and/or switch to a gov that gives more commerce (but more unhappiness). Happiness problems? Hook up Luxes and build Markets and Courthouses (also improves productivity, and tax income/ research, depnding on slider-settings). Can't get Luxes because your opponents have grabbed them? Build Barracks and Military (or maybe Culture, depending on your Civ's strengths), and round we go again...
Reagarding deciding what/ how many mil-units to build is just one aspect of that. If you are going to use the 'free-unit' allowance as a base, then how much you can build depends both on
what gov you're using and what your medium- to long-term aims are.
Under Monarchy, you get no WW, 2 free units per town (Pop1-6) or 4 units per city (Pop7-12), and can use up to 3 (shield-cheap!) units as MilPol -- but lower commerce (=> lower happiness for any given Lux%) may mean you need to keep more of your free units at home to maintain order in your larger cities -- or send them out to grab more Luxes! That said, the 'excess-unit charge' under Monarchy is only 1GPT, and you should be able to make much more than that per core city, if you can keep them from rioting.
Conversely, under Republic, excess-units cost 2 GPT, and you can't use MilPol-garrisons to keep your citizens content -- you need Luxes, happy-buildings, and/or Lux% to do that (but 10% Lux under Republic provides twice as much happiness as it would under Monarchy). You also only get 1 free unit per town and 3 per city under Republic, so there is no benefit (compared to e.g. Monarchy) in keeping units stationed in your core -- at least in your capital and first ring. You can therefore transfer almost the entire 'free-unit' allowance from all those core cities, out to the borders of your empire, which is where (1) the AI will (usually, in the early game, be forced to) attack first and/or (2) your further military conquests will be launched (depending on what short-term aim/ long-term VC you're aiming for).
Let's say you've managed to complete a 1st ring of 6-7 cities around your capital, and got them all to Pop 7+ (which really should have happened long before the end of the Middle Age), and you're (now) under a Republic gov -- that alone will give you 21-24 free units. If you've also managed to build a 2nd ring of, say 10-12 cities, half of which are at Pop7+, you'll get another 20-24 free units, giving you 41-48 units to play with before you have to start paying for them -- and once
all your 2nd-ring cities have Pop7+, that's a whopping 51-60 free units (that's got to be worth building a few 'Duct's, yes?).
Even if you were to garrison 1 decent defender and 1 (Fast-)Attacker in
each 2nd-ring city (i.e. 20-24 units), that still leaves 20-36 available free-unit slots to do with what you will. In the early game, some of that stack will necessarily be Settlers+Workers -- later on, the vast majority should be mil-units (I refer the Honourable Gentleman to my earlier response re. using zero-maintenance Slaves from previous city-/ unit-captures -- or purchases -- to improve his territory). What mil-units you build will depend on your objectives:
- If you decide that you've already expanded as far as you need to, and/ or if playing for a 'peaceful' VC such as Culture, Space or (especially) Diplo, your stack can be a roughly even mix of Defenders+Bombardiers to reinforce borders/ endangered cities, and (Fast-)Attackers (including obsolete Armies) to 'firefight' AI incursions
- If you're still expanding/ farming, or if going for Dom/ Conquest VC anyway, most of your stack should be (Fast-)Attackers and Bombardiers (ideally all covered by a defensive Army) to go out and capture more cities/ territory (you can send a lone Defender in later to guard the city, if you think it's necessary)
In the latter case, every additional city you conquer (or build as a farm) will also add to your free-unit support.
Going back to the question of science-farming, the 1 vs. 3 free-unit support under Republic may actually be another argument for building Pop12 rather than Pop6 farms -- because 12 citizens can then support 3 free units instead of only 2. (For all other govs, more small farms would be better -- because they are easier to keep happy, and/or give equal/ higher free-unit support).
Leaving core cities unguarded becomes
somewhat more risky once your closest rivals have got MilTrad (Cavs), MotorTransp (Tanks), and/or AdvFlight (Helicopters, Paratroopers) and can penetrate your 'Maginot line' of garrisoned border cities within a single IBT. BUT... the AICivs will preferentially target unguarded cities over guarded ones, and may well therefore ignore garrisoned border cities (even if only farms) in favour of marching on to your ungarrisoned inner-ring cities. This can be fatal (for them) if you have:
- A thoroughly roaded/ railed core
- A Fortified border:
- If border cities are placed at CxxC, each of those cities should be either Walled or at Pop7+ (+50% defence-bonus)
- If at CxxxC, build a Fortress on the middle tile, i.e. CxFxC
- A sufficient stack of Bombardiers and (Fast-)Attackers within your borders
- At least one decent Defender and perhaps one Bombardier unit stationed in all border cities (and Fortresses, if built)
In this situation, the AI-units will run a 'ZoC gauntlet' as they march past your border-cities, taking bombardment/ZoC damage on the way in. Your Bombardiers and Fast-Attackers can then move in to injure/ kill the already-weakened AI-stack on your territory (which will not activate any MPPs against you, even if you have to DoW the offender). And when injured AI-units try to retreat, they will have to run (or limp!) through the same ZoC gauntlet on the way out. This can be an effective way of levelling the playing field in the first stages of a war, when you will most likely be outnumbered (especially at higher difficulties), and possibly also outgunned (if you lack a tech or Strat-Res needed to build units equal to or better than the AI's).
As far as building 'Ducts or Markets in Pop12 farms goes, well yes, management can be a pain -- but that's again a (gameplay) choice/compromise...
You already mentioned forest-chopping -- assuming that none of those tiles have been chopped once already,this can give you up to 200 shields per BFC, enough for both a 'Duct
and a Market (also assuming that you can arrange for all those shields to go to the city where you want them -- which is admittedly unlikely, and probably not desirable anyway). Even if you can only chop 1 tile into the production-box of a newly-founded city, that 'starter for 10 (shields)' would mean that you could immediately rush the rest for 'only' 4g per shield instead of 8g per shield (or whip fewer citizens to death, if you're that way inclined). But forest-chops are not the only way to build things in farms, in the late game.
If you have RepParts, then while a would-be farm is still growing to Pop6 (or later Pop12), it can use Civil-Engineers instead of Scientists, to add 2SPT (albeit losing 3 BPT) per CivEng to the 1SPT from the city-tile, to build an improvement. In a desert-/ tundra-farm which is unlikely to reach Pop7+, you could simply leave it at Pop1 (i.e. use the city-tile to feed 1 Specialist), first making a CivEng to build Walls (20s for non-Mil Civs, 0GPT) for the +50% defence-boost (to the 1 farm-provided free unit you can station there!), then converting him to a Scientist; or if there's a fish, you might build a Harbour (40s to non-Mil/Sea Civs, 1GPT) to allow 2 Scientists in a Pop3 city.
On the subject of Specialists, sorry, but this is wrong:
Let's say we have a size 5 city then with irrigated grasslands available and no food bonus, we get:
Food produced: 2+5*3=17FPT
Food eaten: 2*5=10FPT
Net food: 17-10=7FPT
7 Food per turn excess can support 3 scientists with 1 food per turn excess
... because for every citizen you take off the land to make into a Specialist, you'll lose 3FPT -- so Pop5 with no food-bonus will need 3 of its citizens (3*3 + 2 = 11 FPT, excess is only +1FPT) to support only 2 Specialists, not vice versa. After rails,
then it will work, with net 0FPT: 2 citizens on railed irrigated Grass will provide 5*4 + 2 = 10 FPT, supporting 3 Specialists.
If you want to get a dry town to Pop7+, you won't need Walls for a defence bonus, but you will need a 'Duct (100s, 1GPT), so it would probably make sense to start one very soon after founding -- and as the town gets bigger, the number of Civ Engs that could be assigned will also increase. I wanted to work the numbers out for myself, and this is what I came up with, on irrigated Grass for a non-Agri Civ (Excess FPT assumes all Pop is farming, subtract 3FPT per Specialist, in this case a CivEng(s), Net SPT also includes the 1 SPT from the city-tile, Shields collected is for that Pop level -- assuming no disorder!):
Pop|Excess|Citizen|Net|Turns|Net|Shields|Cumul.
level|FPT|->Spec.|FPT|to grow|SPT|collected|shields
1|+3|0|+3|7|1|7|7
2|+4|1|+1|20|3|60|67
3|+5|1|+2|10|3|30|97
4|+6|1|+3|7|3|21|118
5|+7|2|+1|20|5|100|218
6|+8|2|+2|10|5|50|268
...therefore if you started building as soon as the town was founded, both the 'Duct
and the Market could be finished (and costing GPT) ~4T before the town grew from Pop5 to Pop6. At that point it would make sense to convert your 2 CivEngs into 1 Taxman (to pay the Market-maintenance) and 1 Scientist, and then convert all additional excess citizens from Pop6 onwards into more Scientists/BPT.