Since some time, the melee weapons don't really seem to hit targets. I mean much, much less often (e.g. 1 melee hit versus 10 ranged hits) for the majority of targets (even lvl.3 rabbits can't be hit at lvl.15).
That doesn't feel right. Ranged weapons already have advantage of range (i.e. avoiding negative enemies effects like confusion or poison and often avoiding taking damage at all). I feel like melee weapons should be better than ranged ones of the same quality, and their use should be avoided not because they're useless, but in order to avoid enemies placing negative statuses on the character.
At this point, loosing ranged weapon (or focus due to #51 ) means loosing it all, because player can no longer fight, except with a good luck, the most "sane" option here is to flee (even using scroll of return if the exit is not available directly).
I think melee weapons need a significant better chance to hit in order to make them more balanced.
Furthermore the game has curently an option for items with a surfix that isn't used ATM. It would be cool if melee weapons had a chance to be generated with a surfix.
Example: You could have a spear of hunting that raises the chance for meat to be droped or a sword of vampirism that has a chance to heal you some hp if you hurt a monster with it. Or a weapon with a small chance to one-hit a monster (no idea how the surfix should be yet).
I checked out the code for melee and magic attacks. It seems like I made something wrong here. The strength of magic attacks is player.power + weapon.power + player.lvl. For melee attacks it is player.strength + weapon strength only. This explains why magic attacks are much more likely to hit. I am not sure why I added the player level to the calculation. Maybe legacy code I've forgott to remove...
You say that the chance for a hit with magic weapons is just fine while melee weapons miss to often?
So we maybe should add the level bonus to melee as well.
Anyway melee weapons should get a little bonus on the chance for a hit(something like +10%) in order to balance them better.
What do you think?
Hmm, I'm not 100% sure. Let's see.
At lvl.17 the character has almost zero to-hit chance with melee. This is too low. And almost 100% to-hit chance with magic. This is too high.
To-hit chance for monsters melee/ranged is both relatively low, but it's fine the way it is. Otherwise it'll become too hard if not impossible. The tension is ok at the moment.
So, I think that nerfing magic a bit and significantly boosting melee would be fine. For player only.
I'm not sure about the exact numbers, but if the melee weapon will have some additional bonuses, like surfixes you've described (the word is unavailable in dictionary, so I only guess it's meaning :D), it's fine for it to have the same to-hit chance as magic.
Nerfing magic too much will be catastrophic for enemies that apply statuses to the player in melee, like snakes, red nagas, water spirits, fire bats and especially crows :). Without being able to shoot them down before they actually land a successful blow, it'd become practically impossible to fight them without significant nerfing of their special abilities, which are fun the way they are.
So, I'd say a 80-90% to-hit chance with magic and 90-100% to-hit chance with melee seem nice. However, more accurate estimates are possible in live testing of the balance.
The overall idea is that "melee is stronger, but more dangerous". Or, in other words "it's more preferable to melee shooting enemies, versus shooting at melee enemies", generalizing it as "some enemies are better to be taken down in hand-to-hand, and some should be avoided".
This way there will be several situations to handle: 1) player easily kills weak enemies with either melee or ranged; 2) player easily kills strong ranged enemies with melee; 3) player easily kills strong melee enemies (tanks) with ranged; 4) player has a hell when a mix of ranged/melee enemies is around forcing to take advantage of surrounding to protect against ranged attacks and still provide some distance between himself and the melee enemies; 5) player needs to balance attack/defense against spawner enemies like Wisp/Necromancer; 6) player experiences fear and horror when meeting ranged spawners with melee spawns (e.g. Demonic chest :D) which practically excludes both ways to deal with them and forces him into using some tricks like bombs, spellbooks of fire, etc.
Okay I did a little change to the hit calculation. Both melee and ranged weapons should hork equal right now (with a bit lower chance to hit then magic weapons had before).
Would you mind to test it and give me some feedback?
If it works ok we can start to do some fine tuning. ;-)
BTW I mean suffix of course. https://en.wikipedia.org/wiki/Suffix
Testing. Feels much better!
Feels a bit too easy now :) I'll need to fine-tune #67 a bit :)
I've got an idea! How would it be if distance would be a factor for hit calculation? If distance gets higher the chance to miss grows a little too? This would be an elegant way to balance ranged and melee combat because for melee the distance always is 1.
Nice! Let's try it.
The melee weapons still feel a tiny bit underpowered (in feel, not in numbers), but I don't think any more fine-tuning is needed.
Looking good. :)
I'll reopen the issue, as the current state is a bit related.
So, while much, much better than the previous state, still melee weapons miss too much at high levels.
This creates a nice strategy at lower (approx. 1-10) levels, as some enemies require magic to hit and can't be hit with melee (like orcs), and others have a good magic resistance and vulnerable to melee (as kobold shamans).
However, at higher levels (10-15 and higher) everything smoothes out and in average, the magic attack has about 90% to-hit chance (no accurate measurements were made, just a feeling) and melee attacks sometimes can drop as low as 5-10% to-hit chance (against some (not all) demonic chests, and a few other enemies (didn't make notes, just happens - scarabs and mummies, skeletons are among those)).
It'd be nice to keep enemies vulnerable to specific (magic/melee or balanced) attacks at higher levels too. But it looks like the current monster level-up algorithm smoothes out their initial resistances/stats and provides for a bit higher resistance to melee on average.