Skip to content

Posts from 36,37. Ranged creatures Auto-translated

No ratings yet — be the first to rate!
User Avatar
#1
Auto-translated
In this topic, two full issues of the newsletter have been merged together:

36. Shooting Creatures

Today's topic is intended to "shed light" on remaining unclear points regarding ranged units. I want to identify them immediately: shooting range, accuracy and misses, damage dealt, upgrading to snipers, and firing from walls. Here are some contradictory opinions I have heard:

plaguer:
Introduce a shooting range parameter for ranged units. Crossbowmen should shoot significantly further than archers, not to mention titans, whose size already suggests a great throwing distance.

Tolik:

Regarding the shooting of archers. At long distances, you could implement not only damage reduction but also some small chance to miss. After all, they are human too?

Archers should shoot much further than crossbowmen, but at the same time, crossbowmen should deal more damage. Archers should have a fairly large damage range, for example 2-10, while crossbowmen have a narrower one, for example 6-8.

In Heroes IV, main characters received a new parameter - action radius. If units and heroes are made according to a single template (which is what I want), then for ordinary monsters it mostly "stands idle." This is exactly what should be automatically utilized by all shooters! Let it limit the hit zone and set the personal range limit for each type of shooter.

When talking about shooting, something like accuracy becomes relevant. The further the target, the harder it is to hit, and the higher our "sniper's" "qualification" should be. We will consider qualification a bit lower, but we need to deal with misses.

Agree that it cannot happen that an entire stack of warriors misses simultaneously! At least one or two will hit. That is, if a shot is made at the target, it will receive some damage in any case. But how much? From physics class, we remember that the following factors can have a negative effect: reduction of the target's angular size (leads to aiming errors) and decrease in killing power (due to air resistance). The conclusion suggests itself: for every additional unit of distance, part of the damage is lost. At the limit of reach, let's say ~10% "flies through."

The law by which shot effectiveness is determined will be quite "tricky": either a parabola or a hyperbola. I think this is exactly the case where it's worth sacrificing realism for playability and simplicity. No player is going to sit and calculate target damage using some fancy formula. Let it be a linear dependence!

So, an example. An archer (I won't specify which) has range=8.
1 cell: 50% (melee penalty)
2 cells: 100% damage (calculated as base)
3 cells: 85% of base damage
4 cells: 70% of base damage
5 cells: 55% of base damage
6 cells: 40% of base damage
7 cells: 25% of base damage
8 cells: 10% of base damage

Here, for every cell starting from the second, there is a 15% decrease in effectiveness. The formula turns out to be extremely simple:
(100% - 10%)/(8 - 2) = 15%

The numerator of the fraction always features 90% (very convenient - divides well by all numbers up to 7), and the denominator is (range - 2).

Conclusion: ranged units should be assigned ranges from a set of numbers: 3, 4, 5, (6), 7, 8, (10), 11, 12, (14), 17, (((18))), 20, (22)... In reality, the value should be within 4 to 20. Numbers in parentheses do not divide evenly. Final damage formula:
DM = DM(base) * (1 - 0.9 * (L - 2)/(range - 2)),
where L is the distance to the target (2 < L <= range).

Now, how dealt damage (base damage) is calculated. I am increasingly leaning towards the idea that it should depend on two values at once: the ranged attack parameter of the attacking unit and the "sensitivity" parameter to such attacks of the defender. That is, for melee combat there is its own attack/defense pair, and for shootouts - its own. The shot defense parameter is both the ability to dodge arrows and the specifics of the unit's armor - all in one.

We will not overlook the magical aspect of the problem. From the Air Magic School - same here, "air shield". Some arrows will simply be blown away! And Illusion Magic will also be useful - the spell "blur". It will become much harder to aim at such an object! Perhaps we should not neglect the Earth School either. Let "stone skin", besides its bonus in melee, also give a small chance to reflect arrows. From Mind, let's remember "accuracy" - it reduces the penalty (significantly increases range - see below)!

In real life, after some time, ordinary shooters can become snipers. It is all about accumulated experience. (Since now it will be credited to both heroes and monsters). Let shooting creatures initially have a set of abilities similar to a hero's, which can also be developed. And it's not necessary to give everyone the SNIPER skill. Someone might pump DEFENSE[b/. Magical creatures might even have their own ability (for example, MIND - they cast "accuracy" on themselves). Or any other school of magic with corresponding spells.

Well then, as experience accumulates, abilities will grow and manifest more and more productively. I want to examine the SNIPER skill in particular detail. What effect do you think should be built into it? +5% damage? That's not very interesting. But what if +1 to action radius? Then, firstly, units will start shooting further and further; secondly, the range penalty will "pull up," improving the shooter's stats.

Example. An archer shoots 8 cells (only 10% reaches the enemy). Now he has leveled up 3 times: 1 - 0.9*(8-2)/(8-2+3) = 0.4 = 40%. If he is lucky enough to reach the maximum (10th level), the result will be stunning: 1 - 0.9*(8-2)/(8-2+10) = 66.25%. And that's at the limit of range! Of course, there may be obstacles on the field in the form of walls or natural barriers, but let's not spoil the party! Let them impose an additional penalty.

So it turns out that comparing ranged units with each other will become a not-so-simple and unambiguous task. If we have a choice: take throwers with 10 range, or crossbowmen with 7. Initially, throwers will show the best result, but in literally 3 levels they will equalize, and then crossbowmen will start to rule! (It is assumed that throwers have no range bonuses, while crossbowmen have our familiar SNIPER skill).

Linx:
Shooters from towers hit like snipers. Why can't a safe zone be made? Well, for example, archers shoot almost all cells, but two cells at the end of the field remain where troops are placed to avoid hits from archers. Although if you place hero troops on the wall (meaning archers). And then they > would hit all troops. That is, a hero's army is more trained than > castle guards. And in general, in ancient times... Almost all defending > troops were on the wall and attacked from there. For example, it could be made > so that your archers could hit these archers, because in > previous heroes they made it so towers are only for catapults. :-///

I once suggested giving all tower shooters just a +2 range bonus, which would entail turn priority and slightly more damage (compared to "kin" on the ground). In addition, towers will provide reliable protection, so you can't really undermine them, although if one wishes, everything is possible!

And the dead zone - it is determined by the personal limit of "long-range"! In the issue about "battlefield size," I wrote that the player chooses how close they want to get to the opponent. You can start a battle while still at a significant distance where the enemy cannot reach you with anything at all. And while the sides draw closer, it's not bad to engage in forming combat orders (the TACTICS skill - take a back seat)!

Added after 12 minutes
37. Shooting Creatures & Parameters

In the summer, while working on the first prototype models, I decided to first check the previous topic "Shooting Creatures." I will not mention all the intricacies of programming in JS. I'll only say that it is an indescribable feeling. So, the scheme is simple: a 10x10 battlefield, hexagonal grid, on one end - archers (quantity 10), on the other - zombies (same composition). And the command "Close in" sounds!..

But the song is not about that at all. While programming units, I encountered some technical difficulties that greatly influenced the attitude toward many ideas. The main one - the melee penalty!

Conducting a skirmish time and again, tracking all the twists and turns of the battle, comparing the strength of hits and responses - I came to a striking conclusion: this is an artificial concept and does not justify itself at all. It would be more correct like this: any unit is a multifaceted personality, therefore parameters should account for all variations.

For melee combat:
- Attack level
- Defense level
- Maximum damage
- Minimum damage
- ...

For ranged attacks:
- Ranged attack level
- Ranged defense level
- Maximum damage (ranged)
- Minimum damage (ranged)
- Number of shots
- Range

For magical attacks:
- Magical attack level (magic power)
- Magical defense level (immunities by school)
- Maximum magical damage
- Minimum magical damage
- Range
- ...

Depending on the situation, the relevant persona will be used. For example, archers shoot excellently (2-3 DM), but if you approach them - that's it (1-2 DM)! Of course, everything can be blamed on a penalty, but it's not that. Simply in melee combat they have very modest abilities. The same goes for cavalry, for example. Up close they fight like devils, but give such a warrior a bow... He is more likely to shoot himself (0-0 DM)! Similarly for magical creatures.

Now about the battle itself. I implemented simultaneous hits (first damages are calculated, and only then are they subtracted). This is true only for melee. Ranged and magical attacks go unanswered (which fully corresponds to reality)!

When calculating damage, the main factor (besides base damage) is the difference between a pair of characteristics: the Attack Level of the attacking creature and the Defense Level of the defending one. I propose using this difference as an adjustment (let's say 3% per unit of difference). Let's see what that gives.

When parameters are equal, base damage is dealt
DM = 10*(2...3) = 20...30

Archer: RANGEATTACK 10, RANGEDM 2-3, QUANTITY 10.
Zombie: RANGEDEFENSE 5.

Now, the dealt ranged damage is calculated by the formula
DM = 10*(2...3)*1.03^(10-5) = 23...35

If archers somehow increase their RANGEATTACK to 20, then
DM = 10*(2...3)*1.03^(20-5) = 31...47

Zombies can also be better protected (RANGEDEFENSE 30):
DM = 10*(2...3)*1.03^(20-30) = 15...22

That's how it goes. By the way, for simplicity, I did not account for range in this scheme (since killing power decreases proportionally to the distance to the target). But something else can be derived from this! Remember, not long ago I suggested that walls could be destroyed by troops (they have their own HP and take damage). Then a task arose - "protect" them from cunning archers! Now it is solved: you just need to give them high RANGEDEFENSE (255). Let's see what the same archers do, but now in a quantity of 1000 people:
DM = 1000*(2...3)*1.03^(10-255) = 1...2

And this is correct! You can't pierce a stone wall with ordinary arrows! Of course, there will be "unusual" arrows (titans, cyclopes) with terrifying RANGEATTACK ~100, but that's another story (whoever wants, load the calculator and calculate the damage yourself)!

By the way, Stone Gargoyles, from which arrows bounce off, will be akin to walls!

Further. How to "increase" this very RANGEATTACK? You can - with the spell "Accuracy" (+ some units temporarily), or - with the skill "Archery". Each of its levels increases the main characteristic by +1 and range by +1 (which also contributes to increasing damage). Total: +10 MAX (skill), +?? (spell), +?? (artifacts). There is room to grow even for simple mortals!

On the other side of the scale, we place RANGEDEFENSE. First and foremost, the "innate" value is important. Then - artifacts. And, for balance, magic as well. "Stone skin" makes the body stronger overall: +?? DEFENSE and RANGEDEFENSE simultaneously. "Air shield" and various "Shimmering Illusions" similarly reduce the final DM (in % per spell level).

So that you understand what this was all about, I will provide a link to 2 working models (for IE 4+ browser).
There, number zero is the classic version with penalty and movements, and under number one - my improved sketch; a unit can both run and shoot, plus range is taken into account:
http://www.alex-world.nm.ru/models.htm
Рассылка "Heroes: Новые Идеи" <== Все еще жива :)