In fact I am an enormous fan of ranged attacks in any tactical wargame, sometimes to an extent missing finer points of melee. Reasons are already delivered in other posts, no need to restate them.
I am the same way. The benefits of range often greatly out weigh their short comings. In the vast majority of tactical games I go heavy ranged. For example in Advance Wars I use to play Griff a lot for his range boost to Artillery units.
In the various tactical wargames I often find myself building 2 or more range units for every one melee unit. The common argument is you need a good mix of units to be effective and I know this. But it rarely seems to be an even mix. Melee units are limited to only tiles next to them along with retaliation risk so you can only cram a limited number in the space. Where as range units can shoot multiple tiles away and thus you can fit more in range.
An example of this is on a hex board you have 6 tiles around any one tile meaning you can in theory surround a unit for 6 melee attacks. But then the next outer group of tiles is 12 so you can effectively surround the unit with 12 range units all getting off an attack without retaliation. I know the odds of actually surrounding a unit like this are rare but the more common formation is the half circle which gets the same basic benefit and only re-enforces the need for more range than melee units. So the very board positioning is contributing to it.
And if it would be me there are 3 obvious solutions to counter the tendency for ranged units, which is absolutely not merited for any game centered on medieval warfare (with or w/o magic elements):
1) The HOMM/Total War answer - melee attacks against ranged units go against a totally different set of values, putting ranged units at a big disadvantage against melee. This has the additional advantage to be totally historical - ranged units only ruled battlefields after the invention of the flint locked musket.
2) The resistance increase solution. Certain units would be nearly immune to ranged attacks. Already implemented in Warlock and again totally historical, where only longbowmen and crossbowmen were reported (!) to be able to pierce armour, but even these were hapless against units using shields.
3) An answer I did not see implemented in tactical games yet (except modern settings) - counterfire.
The melee units attacking range units with a bonus to the attack or facing different stats is one I've seen a few times. It just tends to make range units more vulnerable but not really change the mechanic.
Resistance is a somewhat viable alternative, but like you said a lot of medieval units had shields and were thus virtually immune to range. While I do think that does help balance things out, it does so by making the range units virtually worthless against those unit types and doesn't do anything interesting with the mechanic.
Counterfire seems to be the most straight forward answer. I'm kind of surprised more games haven't tried it. Some may say it doesn't make sense in a fantasy setting but I think it makes about as much sense as a group of swordsman getting to retaliate at full strength when attacked from 6 different directions.
Thinking about the issue though a "under fire bonus" could be an interesting addition to range combat. Basically when a unit receives their first range attack they take cover and get a bonus from all future range attacks until they move. This way focused fire would be somewhat negated by the fact that the unit is already prepared for an incoming attack. It's like if a group of archers surprised a group of sword and shield fighters but now they have their shields up in preparation, or those without shields jump into cover.
An accuracy reduced over range mechanic might be interesting. Say most units have 3 range but when they attack 1 tile away it's 100% chance to hit, 2 tiles is 75% chance, and 3 tiles is 50% chance to hit. Thus the further distance hinders their effectiveness forcing them to risk them selves more to get off more damage which would play into the fact that in melee they are very weak.
Also in addition to accuracy a scatter effect could be done where they might hit nearby tiles which means if their own units are nearby they could risk hitting them. This was of course a common worry in medieval combat where range weapons we not that accurate. The idea was throw as many shoots at the enemy and hope something hits. I've seen scatter mechanics in a lot of table top war games but not really in any tactical computer wargames.
As it is right now in Warlock the balance for me seems to be quite right. Any army solely consisting of ranged is in great danger to be overrun by sturdy melee units (or skeletons). The notable exception being the Elven bowmasters, which ARE slightly overpowered but at the same time necessary for the Elves to go anywhere given their combined disadvantages elsewhere.
Yea I think warlock does a decent job of balancing out their range units, though I feel it is mostly do to high resistances and missile damage being very weak vs most units. Their lower HP and resistances also tends to make them more vulnerable. So their way of balancing it was reducing the effectiveness of range unit and not really changing the core mechanic.
For games later than 18th century settings we do not have to discuss the "ranged" question as there was nothing than ranged combat after.
Well it's more about the game mechanics than historical accuracy. After all lots of games use real life range units in a melee combat style mechanic. For example Civ 5 in which most of the units still act as melee even in late game.
Another game that has range units acting as melee is Advance Wars series. Only artillery and rocket trucks were able to fire multiple spaces away for the "range" effect. When it comes to more modern games it seems the mechanics remain it's just shorter range weapons are treated in the same way medieval melee weapon combat is and the really long range weapons like artillery, cannons, and etc. are treated the way bows and arrows are.
I think archers are OP. In civ 5 spearman usually defeats archer in one blow. In Warlock archers have too much HP, especially elven archers. Reducing archers HP by 20% can solve this issue.
The spearman are a tech level above the archers, besides they need to get in the first attack and usually on open terrain to pull that off.
Also this discussion is meant for range mechanics in general. As such balance change suggestions to the units in warlock is a bit off topic.
Besides existing range combat mechanics I'd like to further clarify the original intent of the discussion as to also include range combat ideas. Sort of like the ones I mentioned earlier with accuracy and scatter. Who knows, maybe it has already been implemented in some tactical game you don't know about. So feel free to add your ideas to the discussion and perhaps it will spark someone's memory of a game that actually did employ such a mechanic.