CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.71k stars 4.2k forks source link

Aiming speed is dominated by weapon volume, making improved rifle skill irrelevant #29293

Closed cellxiecao closed 5 years ago

cellxiecao commented 5 years ago

This is not exactly a bug but works like one. Former translator here. I haven't played CDDA for a long time before downloading a 0.D version, only to find that aiming system has changed again. As gun mods are not working as I thought, I checked the code and located the problem——the aim_cap_from_volume is over-powerful. Basicly there are two problems: 1、Aiming speed is capped after all modifers are summed. Thus aim_cap_from_volume become a dominating factor. 2、The value of aim_cap_from_volume can be very low and tricky, especially for a rifle. This mean most rifles are just too bulky to aim. And gun mods just make things worse by adding extra volume.

For example, A 2.25L loaded AKM have a aim_cap_from_volume of 14 , adding a 0.5L rifle scope will casue it to be 8. This cap is just too low and since it's only related with volume you can't bypass it with a offset ironsight or something. At this point none of rifle skill, dex and aim speed of mods will have any impact on basic aim speed, and that's all because the weapon is just too bulky.

It make sense that larger weapons are harder to aim, but it do not when there is a strict cap that makes you aim very slowly in any situation.

I will list those codes in character.cpp below.

double Character::aim_cap_from_volume( const item &gun ) const
{
    skill_id gun_skill = gun.gun_skill();
    double aim_cap = std::min( 49.0, 49.0 - static_cast<float>( gun.volume() / 75_ml ) );
    // TODO: also scale with skill level.
    if( gun_skill == "smg" ) {
        aim_cap = std::max( 12.0, aim_cap );
    } else if( gun_skill == "shotgun" ) {
        aim_cap = std::max( 12.0, aim_cap );
    } else if( gun_skill == "pistol" ) {
        aim_cap = std::max( 15.0, aim_cap * 1.25 );
    } else if( gun_skill == "rifle" ) {
        aim_cap = std::max( 7.0, aim_cap - 5.0 );
    } else { // Launchers, etc.
        aim_cap = std::max( 10.0, aim_cap );
    }
    return aim_cap;
}
double Character::aim_per_move( const item &gun, double recoil ) const
{
    if( !gun.is_gun() ) {
        return 0.0;
    }

    std::pair<int, int> best_sight = get_fastest_sight( gun, recoil );
    int sight_speed_modifier = best_sight.first;
    int limit = best_sight.second;
    if( sight_speed_modifier == INT_MIN ) {
        // No suitable sights (already at maximum aim).
        return 0;
    }

    // Overall strategy for determining aim speed is to sum the factors that contribute to it,
    // then scale that speed by current recoil level.
    // Player capabilities make aiming faster, and aim speed slows down as it approaches 0.
    // Base speed is non-zero to prevent extreme rate changes as aim speed approaches 0.
    double aim_speed = 10.0;

    skill_id gun_skill = gun.gun_skill();
    // Ranges [0 - 10]
    aim_speed += aim_speed_skill_modifier( gun_skill );

    // Range [0 - 12]
    /** @EFFECT_DEX increases aiming speed */
    aim_speed += aim_speed_dex_modifier();

    // Range [0 - 10]
    aim_speed += sight_speed_modifier;

    // Each 5 points (combined) of hand encumbrance decreases aim speed by one unit.
    aim_speed -= aim_speed_encumbrance_modifier();

    aim_speed = std::min( aim_speed, aim_cap_from_volume( gun ) );

    // Just a raw scaling factor.
    aim_speed *= 6.5;

    // Scale rate logistically as recoil goes from MAX_RECOIL to 0.
    aim_speed *= 1.0 - logarithmic_range( 0, MAX_RECOIL, recoil );

    // Minimum improvement is 5MoA.  This mostly puts a cap on how long aiming for sniping takes.
    aim_speed = std::max( aim_speed, 5.0 );

    // Never improve by more than the currently used sights permit.
    return std::min( aim_speed, recoil - limit );
}
double Character::aim_cap_from_volume( const item &gun ) const
{
    skill_id gun_skill = gun.gun_skill();
    double aim_cap = std::min( 49.0, 49.0 - static_cast<float>( gun.volume() / 75_ml ) );
    // TODO: also scale with skill level.
    if( gun_skill == "smg" ) {
        aim_cap = std::max( 12.0, aim_cap );
    } else if( gun_skill == "shotgun" ) {
        aim_cap = std::max( 12.0, aim_cap );
    } else if( gun_skill == "pistol" ) {
        aim_cap = std::max( 15.0, aim_cap * 1.25 );
    } else if( gun_skill == "rifle" ) {
        aim_cap = std::max( 7.0, aim_cap - 5.0 );
    } else { // Launchers, etc.
        aim_cap = std::max( 10.0, aim_cap );
    }
    return aim_cap;
}
Inglonias commented 5 years ago

I feel like "ruined" is a bit of a strong word. Nevertheless, I'm getting what you're saying. The cap on aiming speed is hit too easily, to the point where getting more skills doesn't actually improve the situation, especially for rifles.

kevingranade commented 5 years ago

Aim speed is a lot more handwavy than the rest since I can't find any good sources I can even extrapolate from for how fast it should be.

So, how fast do you expect it to be, and what makes you think that's the case?

cellxiecao commented 5 years ago

I feel like "ruined" is a bit of a strong word. Nevertheless, I'm getting what you're saying. The cap on aiming speed is hit too easily, to the point where getting more skills doesn't actually improve the situation, especially for rifles.

Sorry about that. I'm not very good at writing in English. But it's good to know that the topic can be understood.

cellxiecao commented 5 years ago

Aim speed is a lot more handwavy than the rest since I can't find any good sources I can even extrapolate from for how fast it should be.

So, how fast do you expect it to be, and what makes you think that's the case?

Well, I think it's not about how fast, but some skill and gun mods are useless because there is a cap calculated from volume. The rest of the aim system works fine to me.

In my opnion, this code below is already a functional soft cap making all precise aim time cosuming. aim_speed *= 1.0 - logarithmic_range( 0, MAX_RECOIL, recoil ); Let's just cancel the cap from volume and see what happens:

  1. Because it can be very difficult to have a base aim speed more than 200 for an averange @. It will likely always takes more than 7 seconds to precise aim, and for hand guns it is 5 seconds.
  2. However, at low gun skill levels firing a gun take considerable time, and in some extreme cases it take more time than aiming. So I think aim speed is fast enough and maybe too fast in these extreme cases.

So my conclusion is that the aim_cap_from_volume is not nessecery, or at least the effect of volume should not be a cap. The rest of the aim system is working fine.

So how should the volume work?It is more difficult for you to point a large gun towards targets, but it doesn' hinder you very much when you begin to aim via an ironsight or a scope. How about every 0.25L more than 0.5L reduce a portion of base aim speed, and the reduction gradually beome smaller when the aim become more steady?

The relation between volume and aim speed reduction can be nolinear, eg:

size (L) reduction (%)
0.5 0
0.75 2
1 4
1.25 6
1.5 9
1.75 12
2 15
2.25 19
2.5 23
2.75 27
3 32
... ....
4+ 50
SaltatorMortis commented 5 years ago

maybe you could use a blance stat, and for a good balanced weapon the weight isnt as important than with a bad balanced. ie a weapon like a antique Musket is more unwieldy than a modern m4 even when the weight a braced pistol is higher it still has better handling values than a normal pistol

cellxiecao commented 5 years ago

maybe you could use a blance stat, and for a good balanced weapon the weight isnt as important than with a bad balanced. ie a weapon like a antique Musket is more unwieldy than a modern m4 even when the weight a braced pistol is higher it still has better handling values than a normal pistol

Well, as far as I know weight dosn't get involved in current aiming system. Anyway, I have already compiled my own version and it' working well. In my self-improvised version a 3L rifle take roughly 10 more moves to precise aim than a 0.5L handgun. But the steadiness increase much slower for larger guns when the aim just begin.

data below (gun skill level 0, dex 8, not encumbered) gun size __0.50L 3.00L base speed __ 104 71 to regular aim115 125 to precise aim175 184

Sadly Im not a programmer, and Im not familiar with Github. Maybe I should post my codes or just start a pull request?

kevingranade commented 5 years ago

The problem with making changes to the code that, "just fixes it" is that there are tests that check for balance, and as hand-wavy as it is, aim speed is included in these tests. To improve the situation, we need to know what our goal for aim speed is so we can verify that we've reached it, otherwise we're just shuffling numbers around and it never ends.

In order to change this, you're going to need to explain how you expect it to work, raw code changes don't cut it.

mlangsdorf commented 5 years ago

Can we add a test for aim speed and verify that adding laser spots or holographic sights to high volume guns actually improves their aim speed? Because if it doesn't, then even if the other tests are working, we still have a problem.

cellxiecao commented 5 years ago

The problem with making changes to the code that, "just fixes it" is that there are tests that check for balance, and as hand-wavy as it is, aim speed is included in these tests. To improve the situation, we need to know what our goal for aim speed is so we can verify that we've reached it, otherwise we're just shuffling numbers around and it never ends.

In order to change this, you're going to need to explain how you expect it to work, raw code changes don't cut it.

That's a big topic, give me some time and I will list some of my opnions below.

  1. Game experience and reward mechanism

Let me start with general problems and use myself as an example. As a CDDA player since 0.6 version, I really love this game. But there are several occasions I just deleted the game after playing for hours. This happened again when I found aim speed of rifles is de facto a fixed number. I am a player focus on guns, just like other players I spend hours on looting in dangerous place to collect gears for my character, so that my character is stronger and may survive more dangerous advanture. It is just frustrating to find out it's pointless to search for more guns and gun mods. The feeling is like there are small pebbles in you shoes, always make you uncomfortable when you move. Since I am a former translator and translate project adminstrator,I am somehow familiar with codes of CDDA, but this only make things worse because I know it wasn't and shouldn't be like that. The result is I lost my motivation to continue the game and deleted it.

So the point is that the time players spent in game and the risks they taken should have some in game pay back, for some players that's why the game is fun. Advanced gears and skill improvement should well worth the time and risk. On this issue the problem is aim speed just don't improve with gun skill levels and gun mods because the improvement has been blocked by a cap from volume. So why should someone search for gun mods and improve his gun skill level? There are more complains on similiar matters than you can guess. That's because many of them are just not in English.

I do noticed the codes of aim speed cap from volume is in incomplate state. So first solution is to complete that code, make skills into consideration and do some balance. Even if it is handwavy it still will satisfy players---not all players are picky like me.

The second solution is to improve the entire model as you suggested. I think the basic goal is to make it more "accurate". I do have some thing in mind and I will write them down. But it can be a challenge for me to explain that in English.

kevingranade commented 5 years ago

To be clear, I agree that, "skills/stats/sights seem intended to improve aim speed, but if the weapon is too large they do not do so" is a problem.

My only concern is that replacing one set of "works for me" numbers with a different set of "works for me" numbers doesn't get us any closer to having gun balance solved.

cellxiecao commented 5 years ago

To be clear, I agree that, "skills/stats/sights seem intended to improve aim speed, but if the weapon is too large they do not do so" is a problem. My only concern is that replacing one set of "works for me" numbers with a different set of "works for me" numbers doesn't get us any closer to having gun balance solved.

Yep, agree with that. That's why I keeped my code personal. As chance-to-hit is also affected, Im straggling to detail my plan. The biggist problem is distance, as in CDDA, guns only have a range about 25-60 meters. It's just difficult to balance between "real world simulation" and "RPG game".

  1. Fast reaction and sniping

If our goal is to make the aim process more "reallistic" , it will become more "dynamic". The reason is that someone can draw his hand gun and land a hit within one second while the same thing seems impossible to be done with a very large gun. But when you carefully aim a target hundreds of meters away, using a handgun or a rifle should not have a significant difference in time cost as long as the degree of steadiness can be achieve is the same. Thus one way to achieve our goal is to make a difference between fast reaction and sniping.

I don't know how aim speed is tested currently. Since the time cost to reach a certain threshold is solely determind by base aim speed. I guess it's testing if guns of certain type are falling in to certain slot. But I notice another problem. Minumun aim per move is 5, but at 300 recoil even 200 base aim speed will hit the minumun so the time cost from regular aim to presice aim is nearly alway a fixed 3.6s (60 moves).

There are two plans.

First plan. The aim process looks like an integration with a result always being Max_recoil - effective_sight_dispersion. But the time length is uncertain because the calculation is done in steps and is mathematically complex. One way to work around this is to directly calculate time length by Max_recoil/base_aim_speed . This means the moves need to perform a 0 effective_sight_dispersion precise aim is determined at the begining. Recoil of 300, 150 ( just ignore sight_dispersion ) can be important threshold as they indicate regular aim and careful aim. Then different part can be weighted base on whatever factors to make regular aim easy and precise aim difficult. A curve will also do the work as long as the area below it is equel to Max_recoil. A most simple example: base_aim_speed=100, time_length=30, regular_aim_time_cost=10, careful_aim_time_cost=10; aim_per_move will be 270, 15, 15 during different periods. After all, if time length is determind, the rest of the work is to determine when regular aim is and when careful aim is. I think in best situation (eg: high skill) regular aim can be only 1/8 of the total time length. And in worst situation (eg : high penalty ) it can be 4/5. But when more than one sight is used (default one included) things will become complex as sights with high aim_speed will potentially greatly reduce the time needed to precise aim. At this point calculating how long each mod is used is nessessary. This calculation is possible, but the strategy to divide the time cost must be already in place. Any way, the autual base aim speed always lies somewhere in between.
Given the nature of chance to hit systems, careful_aim to precise_aim part should be weighted carefully. This plan will need a large change in aim system.

The first plan isn't perfet so here goes the second one. This is an "improvement" based on current aim system. Most of the modifier are linear and don't need to be change. Some principle should be followed such as large gun are harder to fast react, and sniping is extra time cosuming. To add dynamic element into the system, I removed cap from volume and put another scaling factor into work, at least for now in my opnion it should be caused by volume. Since it is a scaling factor it doen't complately overlap with other linear modifers. Unlike existing scaling based on range this one works the other way around. It only decrease aim_speed in large amount when the recoil is high. However, the increase of time to precise aim is small. Bad news is base_aim_speed will no longer be a reliable indicator. The other change is I removed the fixed minumum of 5, instead I added a plain +3 modifer to aim_per_move to act as minumum after all other caulation is done. This will make precise aim much more time cosuming than careful aim, and can be potentially painful when effective_sight_dispersion is very low.

The third part will be discussion about sight_dispersion.

mlangsdorf commented 5 years ago

I'm going to throw some numbers into the discussion. First, the actual values for the existing scopes and sights (ignoring the bow versions and leadworks items), sorted by aim speed:

Gun Mod Aim Speed Dispersion Volume Real World Analogue
Rifle Scope 0 0 500mL 9x30 Rifle Scope
Telescopic Sight 1 15 250mL 4x25 Rifle Scope
Telescopic Pistol Sight 1 20 250mL 7x25 Pistol Scope
ACOG Scope 2 8 500mL Trijicon ACOG 3x Scope
Pistol Scope 2 8 250mL 2x20 Pistol Scope
Holo Sight 6 13 250mL EoTech Holographic Sight
Red Dot Sight 6 23 250mL Reflector Sight
Iron Sights 6 30 250mL Basic iron sights
Rail Laser Sight 8 30 250mL TRL-1 laser spot
Laser Sight 9 30 250mL TRL-1 laser spot

Aim per move starts at 10, increases by up to 10 for weapon skill, up to 12 for dex, and up to 10 for the sight. It is then capped at 49 - volume / 75 mL (-5 more for rifles, *1.25 for pistols).

So for Joe Genero with DX 8 and weapon skill 5, for various weapons and sighting aids:

Weapon Mod Base Volume Total Volume Raw Aim Speed Cap Final Value
Glock 17 None 500 500 20 49 20
Glock 17 Laser Sight 500 750 29 49 29
Glock 17 Red Dot Sight 500 750 26 49 26
Glock 17 Holo Sight 500 750 26 49 26
Glock 17 Pistol Scope 500 750 22 49 22
Glock 17 Telescopic Pistol Sight 500 750 21 49 21
M4A1 None 1750 1750 14.5 20.7 14.5
M4A1 Laser Sight 1750 2000 23.5 17.3 17.3
M4A1 Red Dot Sight 1750 2000 20.5 17.3 17.3
M4A1 Holo Sight 1750 2000 20.5 17.3 17.3
M4A1 ACOG 1750 2250 16.5 14 14
M4A1 Telescopic Sight 1750 2000 15.5 17.3 15.5
M4A1 Rifle Sight 1750 2250 14.5 14 14
M14 EBR-RI None 2250 2250 14.5 14 14
M14 EBR-RI Laser Sight 2250 2500 23.5 10.7 10.7
M14 EBR-RI Red Dot Sight 2250 2500 20.5 10.7 10.7
M14 EBR-RI Holo Sight 2250 2500 20.5 10.7 10.7
M14 EBR-RI ACOG 2250 2750 16.5 7.3 7.3
M14 EBR-RI Telescopic Sight 2250 2500 15.5 10.7 10.7
M14 EBR-RI Rifle Sight 2250 2750 14.5 7.3 7.3
Barrett M107A1 None 3500 3500 23.5 7 7
Barrett M107A1 Laser Sight 3500 3750 23.5 7 7
Barrett M107A1 Red Dot Sight 3500 3750 20.5 7 7
Barrett M107A1 Holo Sight 3500 3750 20.5 7 7
Barrett M107A1 ACOG 3500 4000 16.5 7 7
Barrett M107A1 Telescopic Sight 3500 3750 15.5 7 7
Barrett M107A1 Rifle Sight 3500 4000 14.5 7 7

Aim Speed as function of weapon skill for laser sights and rifle sights:

Weapon Skill Mod Base Volume Total Volume Raw Aim Speed Cap Final Value
Glock 17 0 Laser Sight 500 750 19 49 19
Glock 17 2 Laser Sight 500 750 23 49 23
Glock 17 5 Laser Sight 500 750 29 49 29
Glock 17 10 Laser Sight 500 750 39 49 39
Glock 17 0 Telescopic Pistol Sight 500 750 11 49 11
Glock 17 2 Telescopic Pistol Sight 500 750 15 49 15
Glock 17 5 Telescopic Pistol Sight 500 750 21 49 21
Glock 17 10 Telescopic Pistol Sight 500 750 31 49 31
M4A1 0 Laser Sight 1750 2000 19 17.3 17.3
M4A1 2 Laser Sight 1750 2000 20.8 17.3 17.3
M4A1 5 Laser Sight 1750 2000 23.5 17.3 17.3
M4A1 10 Laser Sight 1750 2000 28 17.3 17.3
M4A1 0 Rifle Sight 1750 2250 10 14 10
M4A1 2 Rifle Sight 1750 2250 11.8 14 11.8
M4A1 5 Rifle Sight 1750 2250 14.5 14 14
M4A1 10 Rifle Sight 1750 2250 19 14 14
M14 EBR-RI 0 Laser Sight 2250 2500 19 10.7 10.7
M14 EBR-RI 2 Laser Sight 2250 2500 20.8 10.7 10.7
M14 EBR-RI 5 Laser Sight 2250 2500 23.5 10.7 10.7
M14 EBR-RI 10 Laser Sight 2250 2500 28 10.7 10.7
M14 EBR-RI 0 Rifle Sight 2250 2750 10 7.3 7.3
M14 EBR-RI 2 Rifle Sight 2250 2750 11.8 7.3 7.3
M14 EBR-RI 5 Rifle Sight 2250 2750 14.5 7.3 7.3
M14 EBR-RI 10 Rifle Sight 2250 2750 19 7.3 7.3
Barrett M107A1 0 Laser Sight 3500 3750 10 7 7
Barrett M107A1 2 Laser Sight 3500 3750 11.8 7 7
Barrett M107A1 5 Laser Sight 3500 3750 23.5 7 7
Barrett M107A1 10 Laser Sight 3500 3750 29 7 7
Barrett M107A1 0 Rifle Sight 3500 4000 10 7 7
Barrett M107A1 2 Rifle Sight 3500 4000 11.8 7 7
Barrett M107A1 5 Rifle Sight 3500 4000 14.5 7 7
Barrett M107A1 10 Rifle Sight 3500 4000 19 7 7

Aiming speed is strongly influenced by skill and DX, and very weakly by any optics. As skill and weapon size goes up, the value of aim speed optics goes down - a laser spot doubles aim speed for an unskilled pistol user but only increases the aim speed of a moderately skilled rifle shooter by 10%.

Recommendations

I am a recreational shooter at best, but I sometimes hang around with extremely skilled shooters. Skill and natural ability help you aim fast, but so do sighting aids. The current system where sighting aids always make a difference for pistols and rarely help for rifles is probably backwards. The weird quirks that mean a 1750 mL rifle with a holo scope is slower to aim than a 1750 mL shotgun (firing slugs) with a holo scope is definitely not right.

  1. The arbitrary caps on rifles - aim_cap = std::max( 7.0, gun.volume() / 75_ml - 5.0 ) should be removed. Similarly, pistols probably don't need bonus maximum aid speed aim_cap = std::max( 15.0, gun.volume() / 75_ml * 1.25 ).
  2. Rifles and shotguns should have the same minimum aim cap of 10, SMGs slightly faster at 12, pistols at 15, and launchers at 7.
  3. Some sight aids should have their values adjusted. Laser and rail spots are the same things, just in different locations, while iron sights should not aim as quickly as reflector or holographic sighting aids. The sight dispersion on the telescopic sights should be reduced to 5, putting them between the ACOG and the rifle scope.
  4. Adding a sighting aid should always improve aiming speed, but sighting aids should matter less as skill and dexterity go up. Sighting aids should matter more for long arms and less for pistols, but I need to ponder how that should work.
cellxiecao commented 5 years ago

I am a recreational shooter at best, but I sometimes hang around with extremely skilled shooters. Skill and natural ability help you aim fast, but so do sighting aids. The current system where sighting aids always make a difference for pistols and rarely help for rifles is probably backwards. The weird quirks that mean a 1750 mL rifle with a holo scope is slower to aim than a 1750 mL shotgun (firing slugs) with a holo scope is definitely not right.

1. The arbitrary caps on rifles - `aim_cap = std::max( 7.0, gun.volume() / 75_ml  - 5.0 )` should be removed.  Similarly, pistols probably don't need bonus maximum aid speed `aim_cap = std::max( 15.0, gun.volume() / 75_ml  * 1.25 )`.

2. Rifles and shotguns should have the same minimum aim cap of 10, SMGs slightly faster at 12, pistols at 15, and launchers at 7.

3. Some sight aids should have their values adjusted.  Laser and rail spots are the same things, just in different locations, while iron sights should not aim as quickly as reflector or holographic sighting aids.
   The sight dispersion on the telescopic sights should be reduced to 5, putting them between the ACOG and the rifle scope.

4. Adding a sighting aid should always improve aiming speed, but sighting aids should matter less as skill and dexterity go up.  Sighting aids should matter more for long arms and less for pistols, but I need to ponder how that should work.

I just can't bear to say this: Most automatic rifles have increased volume when magazines are attached to them. Since they are only functional with magazines, It's better to use volume of guns with magazines as base volume. Things can be much worse in this situation.

And thanks for your help.

cellxiecao commented 5 years ago

I am giving up. I must be mad to try to figure out a way to relate aim speed directly to chance to hit. After a lot of testing on aim system improvement , one of them seemed to be working. But the problem is I can't find any reliable source to refer to, all I have is common sense, personal experience and what my friends in army told me. In personal experience, I just pull the trigger when I'm quite sure aiming longer won't help,. That's less than 12 seconds and my friends told me that they only need 1-2 seconds to aim. So I set the standard for regular aim to around 2 seconds, and set the standard for pricise aim to around 10 seconds. One way to analyze the aim process in is to break it into several stage and analyze each one respectively. Let's assume an arbitrary @ with an arbitrary gun which only have an ironsight and he is going to precise aim on a target. Below is what is going to happen:

  1. 'f' button pressed: He is facing the target, gun in hands. But 3000 recoil means 50 degree of angle. It's hard to tell what he is aiming, so he is only in shooting stance.

  2. Aim start: The first thing he is going to do is to point his gun barral torwards his target so that he can see the target through ironsight. This process is just like to point the sharp end of a spear towards someone--- it's fast and intuitive. but how fast and accurate the result can be depends on his skill, dex, the size and type of the gun he is using. Generally speaking, this task is easier to be done by a skilled shooter with a small gun and may fall in to the concept of Center Axis Relock system.

  3. Aim become steady: After pointing the gun barral toward the target, he begin to adjust his aim throught iron sight. Recoil begin to decrease much slower. There is alway a turning point at which aim is less intuitive and takes more efforts. Currently in CDDA this turning point is at 1500 recoil and is fixed. That means 25 degree of angle.

  4. Regular aim: He has locked the target through ironsight, but not nessessary precisely. This isn't very hard and time cosuming in reality.

  5. precise aim: Now he begin to aim as precisely as he can untill he is sure that's the best he can do. Then he pull the trigger and wait for the judgement of RNGod.

So the main problem is in stage 2 and stage 3. Some guns can be quite accurate by aim intutively without using ironsight, In other games it's generally called hip-shooting accuracy. Currently this is something not defined in CDDA. Since currently we have base_aim_speed = min ( aim_cap_from_whatever , ( base_speed + modifiers ) * scale_factors);' aim_speed = max ( min_speed , base_aim_speed * scale_based_on_recoil(current_recoil); Thus, moves needed to regular aim , careful aim and precise aim can only be adjusted by adjusting base _aim_speed and min_speed. And a min_speed large enough caused the time need to reduce recoil from 300 to 0 fixed at 3.6 seconds as long as base_aim_speed is below 200.

To work around problems above, I think adding a threshold indicating the turning point of aiming process is a good idea. So I modified current scale_based_on_recoil(...) function, put thresholds into use and added a modifier. The result is below: scale_based_on_recoil After that aim speed is calculated like this: threshold = get_threshold( gun, skill, dex, whatever, ... ); modifier = Max_recoil / threshold; \\threshold is where scale_based_on_recoil is 0.5 aim_speed = base_aim_speed * scale_based_on_recoil(current_recoil, 2 * threshold, modifier) speed_min = 1; aim_speed += speed_min;

A small speed_min means precise aim is always time costing. And then the scale_based_on_recoil(...) function writen in Matlab codes:

function[result] = scale_based_on_recoil(min, max, recoil, modifier) % Generally the same as logarithmic_range(...) function in cata_utility.cpp if recoil >= max result = 1; return end % The result is close to a straight line when cutoff is below 1.
Base_cutoff = 1; cutoff = Base_cutoff + modifier; ` L_max = 1/(1+exp(-cutoff)); L_min = 1/(1+exp(cutoff)); L_range = L_max-L_min; range = max-min; unit_recoil = (recoil-min)/range; scaled_recoil = cutoff(1-2unit_recoil); raw_logi = 1/(1+exp(-scaled_recoil)); raw_result = (raw_logi-L_min)/L_range; result = 1 - raw_result; return` Finally, how many moves need to reached certain recoil limit under different base aim speed and threshold is also tested and plotted. You may need to click the figures to see clearly. moves_needed_to_reach_certain_recoil_limit relation_between_base_aim _speed_moves_1500 relation_between_base_aim _speed_moves_900 relation_between_base_aim _speed_moves_600 From these results I think this one is working fine when base aim speed falls within [50,200], as at least 8 seconds are need to reach 0 recoil, but regular aim can be faster depends on where the turning point or threshold is. Base aim speed below 50 or higher than 200 seems also accaptable. But just try not to make is too low. It should be noted that a threshold too small can cause unstable result. But it can be larger than 1500, in situations like aiming with a HUGE gun this can be useful. Due to discussions above, I think in most time the thres hold should fall within [1500.600] , and only a 0.5L handgun should be allowed to have a threshold of 600. Further discussion will involve default sight_dispersion and aim_speed of default sight. I don't know why sight_dispersion is that small. Your gun barral isn't straight so ironsight is the more reliable thing? Any way, it leaves very little room for gun mods to play a role. And aim_speed of default sight can be set to 5, while fastest mod (under barral laser sight) can be set to 10. Thus the aim speed modifier range from 0 to 10. It's just easier to handle and leave more room for mods like red dot sight to operate. Since effective sight dispersion is the actual limit of recoil. Making careful balance is absolute nessesry, currently I thinks it's stangely small. Maybe someone can tell me why? @kevingranade So this is the best I can come up with. Whether it's reasonalbe or just non-sense is up to you. I have spent too much time on this matter so this is the last post. It's just a shame Im not the one who do the coding.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue has been automatically closed due to lack of activity. This does not mean that we do not value the issue. Feel free to request that it be re-opened if you are going to actively work on it

kholat commented 3 years ago

This is still an issue. Except even more since now every rifle has 46 aim speed (the minimum).