Pasting here my considerations on range combat rules. Maybe someone else can find this interesting. I'm also open to suggestions.
Of course with the awful coding skills I have even implementing a rough shell of all this will take me forever. But at least IT SEEMS there's nothing technical that looks impossible.
In the end my game will never become real, but MAYBE someone will be inspired and will go down the same path :)
Now that I have a rough line function that deals properly with FOV and walls I think I have the technical basis to start integrating some form of ranged combat into the actual game combat. But I figured out that before I can do that it's better if I have a good idea of the ruleset I'm going to use and all the features it needs to have.
Of course I'm not inventing anything here, so I went looking how ranged combat works in various rulesets, taking out the individual features I like, and then integrate them into my own system. The goal even here is that the number of "moving parts" determines the actual depth and complexity of the game. So more moving parts, more potential complexity. On the other side the system needs to be "realistic" so that these moving parts behave consistently. This means that if they do behave consistently then the game mechanics may be complex, but also intuitive.
So here's the various points I'd ideally cover:
While a sword usually has the Strength stat adding to the damage, a bow only have its own fixed Strength. This means the character stat only determines if a bow is usable or not, but if in excess the Strength is not added to that of the bow, which is fixed (realistically).
Knock and draw delay. Since there's going to be a rough facing mechanic, I can determine if a character is being actively "threatened" in melee. If so you just can't knock and draw the arrow or bolt. If instead the arrow was already prepared, then of course it can also be shot at point blank. Knock and draw delays are fixed (maybe with a small "Agility" bonus) and happen automatically as long a ranged weapon is equipped. Swapping from melee to range of course takes some time.
I'm integrating an aiming mechanic by default. Preparing an arrow is not enough to shoot properly. The idea is that I'll use the character's Dexterity attribute. The Dexterity determines the speed at which the skill "fills out". If for example a character has 80% in the bow skill, he still can't simply draw and shoot. It takes time to take aim, and this time slowly fills up the skill. So for example in a round a character might fill 50% of his skill. Meaning that our guy with the skill at 80% gets an actual 40%, if he waits one more round he might get to 65% and only after waiting a third round he might shoot at his full 80%. This because since I have a classless system I also want to avoid a scenario where characters eventually max all their skills and so end up identical. If stats matter then it means a mage might focus on the bow skill and become very good with it, but the Dexterity still determines the time it takes to "fill out" the skill value, and so affecting directly the rate of fire. Meaning that in the end there's a potential for a great archer, but not one that was built precisely with that goal.
Range is divided in tiers (and tiers depend on the weapon stats). Every tier adds a fixed penalty to the roll. This obviously means that firing at long range makes the target much harder to hit. The penalty is fixed, meaning that a character with a lower skill might be completely crippled. If the penalty matches the character's skill then the shot is simply impossible (unless he rolls a lucky critical).
Another penalty depends on the movement of the target. Whereas range penalty is fixed, the movement penalty is proportional to the character skill. So the target might move in a way that gives a 25% penalty. This penalty is applied to the skill. If the character has an 80% skill then he shoots at 60%, if he has 40% he shoots at 30%. So it applies proportionally and in a different way to the range penalty.
Dealing with actual aim, the possibility to target a precise location. I'll probably handle this so it's based on a "rigged range". In general the location is determined by rolling dice. Taking a precise aim means adding a penalty to the hit roll, and then a bonus to the location roll. The more distance the more the location roll can be actually guided. But this should provide the effect that if you aim for the eyes from far away then you're still more likely to hit the head or upper body rather than the legs.
During the flight of the arrow, for each actual target encountered there's a fixed, arrow-based % to hit the target (friend or foe). So if you actually aim to hit something behind something else, the arrow still has to fail a roll to hit the first target in the way. For the actual aimed target the to-hit roll depends on the weapon skill, for accidental targets instead the roll is fixed. And for every target the arrow passes a penalty is added to every consequent roll. Meaning it's more likely the arrow will miss if it passes through multiple targets without hitting, simulating the fact it's likely to hit some piece of armor and get deflected (also simulating the fact it's more convenient to aim at someone in the front, rather than aim someone in the back with the hope the arrow hits someone along its flight. If you aim someone in the back you just make more likely the arrow hits no one at all).
Damage is obviously done with the fixed weapon strength as described above, plus the arrowhead type. So there might be arrows that make worse wounds, cause bleeding, or pierce armor, or stun. Stuff like that, but only affecting the damage roll.
All this to explain an idea of design I have: detail and complexity open the way to meaningful combat with interesting mechanics. And it can all work in a simple and intuitive way as long the rules are transparent and behave consistently.
Of course coding all this is an entirely different matter.