Home » PLAYER'S HQ 1.13 » JA2 Complete Mods & Sequels » UC/DL 1.13 & AFS » Reconsidering the Scope Sight Range Bonus
Reconsidering the Scope Sight Range Bonus[message #290792] Sun, 18 September 2011 00:45 Go to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
There has been some discussion as to the game becoming too easy once scopes are available - you can see the enemy, but they do not seem to be able to see you. Part of this is due to the scopes appearing all over the place with respect to coolness values. However, on a fundamental level changing coolness will only delay the undesired effect, so I am now reconsidering how this bonus is used.

I'll be upfront on this one, I don't remember where or why these values are in the mod (and I'm too lazy to check the stock v1.13 XML's).

As of today, 2011/09/17 in the released versions of AFS/DL-1.13/UC-1.13 the defaults are as follows:

Ja2_Options.INI Base_Sight_Range = 13
(it is multiplied by 2 in-game)

General / Nighttime / Daytime / Cave / Bright Light

Sun Goggles: 0 / -8 / 8 / -16 / 16
- - I think this rounds off to a +2 tiles bonus under ideal(Bright Light)

1.5x : 0 / 5 / 20 / 5 / 20
- - +2 tiles during the day

3.5x : 0 / 10 / 50 / 0 / 50
- - up to +5 tiles, and somewhat inconsistent compared to 4x

4x : 0 / 10 / 50 / 5 / 55
- - Again, if rounding as is done as expected (ie. not truncated), +6 tiles sight bonus under ideal (Bright Light)

6x : 0 / 15 / 70 / 0 / 75
- - Up to +8 tiles sight bonus

10x : 0 / 20 / 90 / 0 / 95
- - Up to +10 tiles sight bonus

Binoculars: 0 / 0 / 150 / 0 / 0


Now I am considering dropping the sight bonus for 4x and below to that found on the Sun Goggles, +2 tiles or less. On the other hand I am also considering increasing the sight bonus on the binoculars and 10x to conform with the range in-game that 10x Scope Magnification effect operates at under NCTH.

Additionally, I am a bit unclear as to whether the Bright Light range bonus stacks with the Daytime range bonus, or if it is something entirely different.

Also unclear is the effectiveness of scoped weapons in the hands of the AI. That 6 tile difference in visual sight range from just the 4x scope is a major balancing issue if the AI squanders it.

[Updated on: Sun, 18 September 2011 00:47] by Moderator

Report message to a moderator

Lieutenant

Re: Reconsidering the Scope Sight Range Bonus[message #290798] Sun, 18 September 2011 08:30 Go to previous messageGo to next message
knightofni is currently offline knightofni

 
Messages:96
Registered:August 2011
A couple of comments :

1. Sight range bonuses are a percentage of base range vision. So for a 3.5x Mag (50), you actually get 50% more sight range. In practice i count 12 tiles when it should be 13, but well, close enough. That's why our teams destroy AI's so easily once we have scopes.
To me the scopes sight bonuses are way too high. They should be divided by 2 or maybe 3.

2. I really agree with your suggestion of making scopes consistant with each other. However, i can't really agree with making binoculars more powerful, as it's probably one of the best item in the game already.

3. One problem with re-balancing sight range is that as scopes mag factors are a multiple of NORMAL_SHOOTING_DISTANCE (default 70), so high powered scopes will always fire under the "too close" modifier. I can see 2 "simple" solution to that problem
- Reduce NORMAL_SHOOTING_DISTANCE (solve the scope problem), and reduce DEGREES_MAXIMUM_APERTURE to keep the same accuracy
- Define SCOPE_RANGE_MULTIPLIER = 0.5 (but i'm afraid that wouldnt be enough). Maybe the 1.13 team could allow the minimum value to be lower (probably a very simple change)


--------
EDIT : I guess sight range bonuses work this way :

round down (Base sight range x Bonus) x daylight modifier

So for the 3.5x scope

13x1.5 = 19.5
Round down = 19
Day light = 19 x 2 = 38
12 tiles more than the normal 26, what i count in came. Did NOT double check with other scopes.

[Updated on: Sun, 18 September 2011 08:33] by Moderator

Report message to a moderator

Corporal 1st Class
Re: Reconsidering the Scope Sight Range Bonus[message #290808] Sun, 18 September 2011 17:13 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Checked in-game, yes it is a percentage modifier. Not sure where I got the number of tiles thing from.

Correcting my earlier faulty assumptions on those tags demands a rework of the sight range modifiers.

EDIT: for comparison, I decided to list the modifiers from stock v1.13 (Data-1.13)

Toggle Spoiler



Somewhere I diverged particularly badly with the 4x scopes.


EDIT: New Scheme

1.5-2.0x
0
10
0
10

3.5-4.0x
10
20
0
20

6.0x
15
50
0
50

9.0x
20
80
0
80

10.0x
20
90
0
90


1PN51 NV (3.5x)
60
10
50
10

ARX-160/OICW FCS (4x)
40
20
30
20

Thales NV/ARS NV (4x)
60
20
50
20

Thermal (FLIR) Weapon Sight (6x)
100
50
100
50

[Updated on: Sun, 18 September 2011 22:09] by Moderator

Report message to a moderator

Lieutenant

Re: Reconsidering the Scope Sight Range Bonus[message #290826] Mon, 19 September 2011 18:23 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
You get to see further with a scope because a scope magnifies what you can see. Technically, if you look through a 2x scope, you're seeing things at 200m as if they where only 100m away. Effectively, you can see twice as far with a 2x scope. In JA2, 2x scopes give only a 10% vision bonus which is only 1/10th what you'd get in real life. We do this because using "real life" values would make the game pretty well unplayable since we have limited map sizes.

Changing NORMAL_SHOOTING_DISTANCE would impact a huge portion of NCTH. That value is used in just about every NCTH calculation at some point. And simply altering DEGREES_MAXIMUM_APERTURE isn't going to have the effect you're after. And SCOPE_RANGE_MULTIPLIER willy only change the minimum effective range of a scope, though reducing this value would mean closer ranges so you would avoid having scopes that could never be used without penalty should you actually reduce the vision range bonuses.

I should point out that it's an invalid statement to say "you can see the enemy, but they do not seem to be able to see you". In fact, the enemy DOES use scopes and DOES get the same vision range bonus that you get. The problem with the AI right now is that it doesn't make as much effective use as a player does. A player might use a scope to find a target, then move into a better firing position based on where the player just saw a target. While moving, the player might not be able to see the target any longer, but he remembers where the target was when he looked through the scope. The AI, however, can't "remember" anything. The AI might look through a scope and see a target but doesn't have a hit chance high enough to make a shot so it "decides" to move closer. As soon as it lowers the weapon, it can no longer see the target and therefore doesn't know where the target is. So when the AI moves, it doesn't consider the target location if previously "knew". Basically it's a "memory" thing. Players remember target locations while the AI doesn't. I'm not an AI coder, so I don't know how much work would be involved in correcting this issue. So don't ask me to try and fix it. Smile It's one thing to know what the issue is. It's quite another to have any idea how to resolve it. Wink But anyway, the AI really does use scopes, and really does get the same vision range bonuses a player gets.

Report message to a moderator

First Sergeant
Re: Reconsidering the Scope Sight Range Bonus[message #290827] Mon, 19 September 2011 19:25 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Thanks Chris. Yeah, despite being able to portray the sight range extension of magnification with some semblance of realism, game balance and game limits makes this a bad idea. Does anyone remember if the original sniper scope in retail JA2 gave a sight range bonus?

However it may be a good idea to have two different criteria for how sight ranges are done in the mods:

1) "Battle Scopes" - not much of a bonus, as indicated above for 1.5x-4x

2) "Sniper Scopes" - range bonus is calculated to correspond with the NCTH Mag Factor "Sweet Spot" for aiming.

Given NCTH Defaults of:
NORMAL_SHOOTING_DISTANCE = 70 (7 tiles)
SCOPE_RANGE_MULTIPLIER = 0.7

A 10x Mag Factor means the "sweet spot" is at 70 tiles, and the minimum effective range is 49 tiles right?


I'm again thinking of giving the 10x Scope a range bonus that takes vision under ideal circumstances out to at least 80 tiles.


EDIT: Additionally, I am thinking a piece of facegear only used by the AI with a general range bonus may improve their performance against the player. Nothing too drastic, perhaps the Sun Goggles with twice their existing bonus.

[Updated on: Mon, 19 September 2011 19:28] by Moderator

Report message to a moderator

Lieutenant

Re: Reconsidering the Scope Sight Range Bonus[message #290828] Mon, 19 September 2011 20:09 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Yes, the original scope gave a sight range bonus but I couldn't tell you how much it was. Too much of the code has been altered since the retail version of JA2. I can say that, originally, the Item variable in the code didn't include a vision range bonus tag, but in the original, retail version of the game, all the items were hardcoded so all their modifiers were hardcoded if the functions that dealt specifically with them. I've always assumed that the 90 that we have for the Day and BrightLight Vision Range Bonuses we taken from the retail version when the items were first externalized because I don't remember noticing a difference between sighting ranges after I moved to 1.13.

Please remember that the current "default" for SCOPE_RANGE_MULTIPLIER is just a modifier I basically pulled out of thin air mostly because it set 10x scopes so that the minimum effective range matched the standard sight range for the scope (i.e. 49 tiles). In other words, a "normal" merc using a 10x scope with a 0.7 multipler has 0 tiles of unpenalized usage. But at least this merc never gets a double penalty (too close AND invisible which is what you get above a 0.7 multiplier). 0.6 would give about 7 tiles of unpenalized usage and 0.5 (which I've been working with in my recent tests) gives about 14 tiles.
Otherwise, yes. the "sweet spot" is 70 tiles and the minimum is 49, based on the numbers you're using. But that "sweet spot" is not actual vision range. You'll get hit with the "invisible target" penalty because the games LOS calculations will say that this same 10x scope can't actually see a target beyond 49 tiles. All that 70 tile "sweet spot" means is the "distance aperture" at 70 tiles with a 10x scope is identical to the "distance aperture" at 7 tiles without a scope. This has nothing to do with visibility, LOS or muzzle stability (those are all factored in subsequent steps).

And yes, I suppose you could create an item specifically for the AI to improve it's vision range. The only real catch would be making sure that players didn't get ahold of it as a drop. And I'm not sure how you would go about doing that. Leaving it out of the standard drop xml files would not help if the player was playing the game with "Drop All" active. The best way I could think to do what you're suggesting is to code an AI specific LOS modifier.

EDIT: Actually, that might not be a bad idea. I'm not exactly sure where it would be done, but somewhere in the LOS system, if we updated the code so that any AI related calculations took weapon based vision range modifiers into account regardless of whether the weapon was in a ready position or not, that might actually resolve the problem. Then all it would take is for an enemy soldier to have a weapon with a scope attached. The LOS system would then give that enemy soldier the visionrangebonus for the attached scope and apply it to all the AI decisions. In essence, the scope's bonus would ALWAYS be applied for the AI.

[Updated on: Mon, 19 September 2011 20:12] by Moderator

Report message to a moderator

First Sergeant
Re: Reconsidering the Scope Sight Range Bonus[message #290831] Mon, 19 September 2011 20:40 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
ChrisL
But that "sweet spot" is not actual vision range. You'll get hit with the "invisible target" penalty because the games LOS calculations will say that this same 10x scope can't actually see a target beyond 49 tiles. All that 70 tile "sweet spot" means is the "distance aperture" at 70 tiles with a 10x scope is identical to the "distance aperture" at 7 tiles without a scope.


Working backwards from knightofni earlier math:

Wanted Effective Sight Range = 80
80 = X * 2 -> X = 40

40/13(normal sight range) = 3.076923076923077

~ a Daylight sight range bonus of slightly more than 200% should give a sight range of 80 tiles, which would have it corresponding with the NCTH Sweet Spot of the 10x scope. Is there a limit on how far the sight bonus can be taken? Does a FOV penalty of 100% mean that only the tiles in a line between your merc and the aimpoint are visible? (No really, I forgot if this is the effect of 100% FOV restriction.)

May be more sensible to have sniper scopes of lesser magnification in-mod. Warsaw Pact arms already have the 4x PSO-1, perhaps drop the 6x default scope mount scope down to 4x and the 10x down to 6x. The "western" 4x Battle scopes and the 4x Sniper scope would differ in visual range bonus, aiming penalties and FOV.


EDIT: I was planning on using the following to prevent player use of the AI crutch goggles:
- same in-game names as Sun Goggles so player wouldn't know specifically this item is worth stealing.
- the undroppable tag - shouldn't this override Drop-All?
- Not Buyable tag
- Not in Editor tag

[Updated on: Mon, 19 September 2011 20:43] by Moderator

Report message to a moderator

Lieutenant

Re: Reconsidering the Scope Sight Range Bonus[message #290832] Mon, 19 September 2011 21:13 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Trying to have scopes grant "real world" sight ranges is where you run into problems. A standard map is something like 170 tiles, corner to corner. And only something like 100 tiles edge to edge. So giving a scope an effective LOS range of 80 tiles means you can pretty much see the entire map. That is going to give snipers (both player and AI) a HUGE advantage. Even if you increased the FOV penalty from it's current 90 to 99 (100 I think would mean no LOS ever). That's the main reason 10x scopes only give a 90% LOS range bonus. Just because they can, do you really want snipers being able to pick off targets on the other side of the map, pretty much without penalty?

As for your calculations, I'm pretty sure that LOS range is BASE_SIGHT_RANGE * 2, and then apply modifiers. The end result is probably the same, but I've noticed that sometimes the code will get some unexpected results because of rounding.
Also, keep in mind that LOS is really a yes/no check based on the tile you're looking at. So it could be night time in the game, but if the tile you're looking at is at the center of some light source that effectively makes that tile count as "bright light" then that tiles LOS range will be generated as if it were bright light regardless of the light level of any invervening tiles. Again, this might not actually be an issue but it's something you should be aware of.
And, finally, keep in mind that all those visionrangebonus modifiers stack. So a merc wearing sun goggles in bright light looking through a 10x scope will actually get +110% LOS range result (90 for the scope + 20 for the goggles).

And I honestly don't know if the "undroppable tag" will keep the item from dropping when Drop-All is active. You'd have to test that.

Report message to a moderator

First Sergeant
Re: Reconsidering the Scope Sight Range Bonus[message #290852] Mon, 19 September 2011 23:35 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
I keep bumping into things that seem to indicate minor code features, I don't want to because I want to see what we can get by with right now but...

Perhaps a feature to turn off the out-of-sight penalty, to be used sparingly on true sniper scopes - again this leads me back to thinking it may be better to cap the magnification factors presently in use from 10x to something like 6-8x. Or add additional scopes in the 6-8x range, and leave the 10x alone and let players decided if it is impracticable under NCTH.

Change the function of the undroppable tag to also remove the flagged item if it is attached to something dropped by the AI.
- in addition to ensuring it takes precedence over the Drop All setting at game start.

I've got some minor map work lined up for UC-1.13 v3.60, I'll take the opportunity to see if I can figure out what the current interaction between the undroppable tag is with the Drop All game mode and the in-map item's drop flag.

[Updated on: Tue, 20 September 2011 00:56] by Moderator

Report message to a moderator

Lieutenant

Re: Reconsidering the Scope Sight Range Bonus[message #290862] Tue, 20 September 2011 02:46 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Well, I still use the 10x on proper sniper rifles in my test games and I don't have a problem with the limitations. Admittedly, I did reduce the scope multiplier to 0.5 so it gives me a bit extra range, but even at 0.7 I would still prefer the sniper scope. The real trick with sniper scopes (and sniper rifles in general) is to not give them to "average" mercs. Only my Sniper/Marksmen trained mercs use them.

Report message to a moderator

First Sergeant
Re: Reconsidering the Scope Sight Range Bonus[message #290999] Thu, 22 September 2011 17:55 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
I just found a few nights ago that the NVG were missing some of the balancing penalties I keep going on about. Things seem to have gotten quite abstract with NVG's where the bonus seems to be x10 the generation number. What is the current effect of night/low-light right now? Is it the straight reduction in tiles that I keep thinking it is, or is it a percentage based thing too?

Report message to a moderator

Lieutenant

Re: Reconsidering the Scope Sight Range Bonus[message #291006] Thu, 22 September 2011 21:24 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
all the visionrangebonus tags in items.xml are percentages. It may appear that you're having a straight reduction, but that's simply a result of the math. The functions in the code that deal with those bonuses (whether positive of negative) treat the values as percentages.

Light level itself is also treated as a percentage. The values are all hard coded in the gbLightSighting array, with 100% (bright light) being the highest and 9% (pitch black). Most of this is all handled in the DistanceVisible() function. That function generates base sDistVisible by taking BASE_SIGHT_RANGE * 2, assuming we're facing the direction we're looking.
Next, the effects of tunnel vision are applied to sDistVisible. Tunnel vision reduces our forward vision arc by the listed percent.
Next, elevation differences are factored into sDistVisible. 1/6th of the current sDistVisible is added if at a different elevation. Not sure if this was intentional or what, but this vision range bonus applies whether you're looking up or down. Think it should really only apply if you're looking down but that's not how the code is currently written.
Next, light level is calculated and factored into sDistVisible. Light level reduces sDistVisible to the hard coded percent. So in "Bright Light" you get 100% of sDistVisible. In "Pitch Black" you get only 9%. There are 16 different light levels coded, grouped into 4 categories: Night, Day, Cave and Bright.
Next, visionrangebonus tags are added up and applied as a modifier towards sDistVisible. These modifiers are all added together and then applied as a percentage. So in bright light, if you're using a 7x Battle scope and Sun Goggles, you'll get a total +70% applied. At night, if you're wearing NVGI and using a 4x ACOG you'll get a total +20% applied.
Next, the effects of suppression fire (aka, cowering) are applied, again as a percentage.
Next, traits like Night Ops are applied, again as a percentage.
Finally, effects of gas/smoke (and gasmaskes) are applied, again as a percentage.

One thing to realize, though, is that sDistVisible is an INT16 variable. So at every step of the process, any fractional amounts are lost. In other words, if sDistVisible is 15 before we apply the elevation factor, it'll be 17 when we apply the light level factor. This constant dropping of fractions may be why it often appears as though a VISIONRANGEBONUS=10 results in 1 tile being added even though we're really adding +10%.

Report message to a moderator

First Sergeant
Re: Reconsidering the Scope Sight Range Bonus[message #291027] Fri, 23 September 2011 00:41 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Thanks Chris, I was after the hard coded values for low light vision reductions (which explains why I don't remember seeing them in past). It is those 16 light level vision modifiers I'm after.

So to make sure I know what needs to be done in the XML's:
- unaided for what the game defines as "pitch black" the merc's vision is cut down to 9% of what it normally is
- There are 4 groups of 4 different light levels, and which four you are looking at defines which of the four item vision modifiers to use

Right?

Goal is to balance the NVG's to never produce vision range beyond that possible under best case with sun googles in daylight.
- Thermal Imaging goggles may allow vision beyond the best case daylight range (as they are not light amplification).
- Telescopic NV devices will be the range modifier for daylight (discussed earlier) added to whatever numbers are produced for the devices Generation of NV gear. Again, a 4x NV scope should never allow for longer range in-game than the 4x telescopic scope in daylight.


EDIT: the AI's cheater sun goggles do not drop when added to in-map enemy inventory and flagged to drop. Should mean that when randomly issued this item shouldn't drop as well. Problem is it can still be stolen.

[Updated on: Sat, 24 September 2011 22:06] by Moderator

Report message to a moderator

Lieutenant

Re: Reconsidering the Scope Sight Range Bonus[message #291149] Mon, 26 September 2011 18:27 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Yeah. Basically you've got 16 different values:
80, 86, 93, 100,
94, 88, 82, 76,
70, 64, 58, 51,
43, 30, 17, 9

The game selected the appropriate value by the light level of the specific tile. So if the light level is 0, 80% of vision range is applied. If light level is 3, then 100% is applies. If light level is 15, then only 9% is applied. Remember, in the code light level is a 0-15 value.

As far as the 4 visionrangebonus tags go, they apply to each group. I'm not positive but I think group 1 is BrightLightVisionRangeBonus, group 2 is DayVisionRangeBonus, group 3 is NightVisionRangeBonus and group 4 is CaveVisionRangeBonus.

Love the idea of NV Scopes. I've always felt that was something the game needed. But keep in mind that all visionrangebonus tags get combined together. So when you're considering adding new NV gear (or thermal imaging) remember that face item bonuses (i.e., goggles) are combined with scope. Sun Goggles give a +20% BrightLightVisionRangeBonus. The ACOG also gives +20%. The result is, when visionrangebonus is applies, you'll get a +40% result in a 36 tile vision range (assuming full bright light, or 100%). Not the 37 you'd get if both visionrangebonus tags were applied seperately.
Looking at it another way, the worst "night" vision modifier results in a 51% vision range or 13 tiles (assuming BASE_SIGHT_RANGE = 13). NVG IV gives +40% NightVisionRangeBonus and ACOG gives +10%. So combined you get a +50% or 19 tile range. Not the 20 tiles you'd get if both visionrangebonus tags were applied seperately.
Effectively, because of the order in which the modifiers are applied, you'd need to get a combined +100% NightVisionRangeBonus to simply offset the worst "night vision" modifier. And you'd need a combined +280% NightVisionRangeBonus from NVGs + NV Scopes to get the same vision range the above sun goggle example got.
However, I'm exampling the "best" and "worst" light level modifiers for bright and night levels. But if we look at the "best" night level modifier, that's just a 70% vision range. Or 16 tiles. You only need a combined NightVisionRangeBonus of +63% to negate that light level modifier. And you only need a combined NightVisionRangeBonus to get +125% to match the best day range from the above example. With the current items, the best NightVisionRangeBonus combination you can get is NVG IV (+40) + 10x Sniper Scope (+45), resulting in a +85% vision range. So not enough to completely negate the worst night modifier but more then enough to offset the best night modifier.

As far as your thermal imaging goggles, notice in items.xml that we have a ThermalOptics tag. Don't get excited. That tag IS referenced in the code but it is not used as part of the visibility distance calculation (i.e., the calculations that determine whether the draw an enemy on the map or keep the enemy hidden from the player). Instead, anything you flag as ThermalOptics is treated as having the same "vision" capabilies as the Crepitus get. They don't actually "see" their target but can still get a valid LOS when it comes to attacks. The result would be, if you gave Thermal Imaging Goggles the ThermalOptics tag, they wouldn't necessarily get any special vision range as far as visibility went. Example, if you took the existing NVG IV and added the ThermalOptics tag, they would still only "see" targets (i.e., place them on the map for players to see) out to 19 tiles. But when you actually fired a weapon, LOS range would be closer to the normal 26.

EDIT: As far as the AI, I still think the best option is to update the code so that the AI always gets any scope bonuses for a weapon in hand, regardless of whether the soldier has the weapon ready or not. It's really the only way to allow the AI to simulate "memory". And it keeps you from needing a special item which you don't want players to have.

EDIT: The AI modification I'm suggesting would actually be extremly simple as well. There is already a global flag: gbForceWeaponReady It's used by the CTH functions because CTH calculations have to be made on the assumption that the weapon being used is actually in a ready position whether it really is or not. Otherwise, things like the "f" hotkey wouldn't work correctly. Anyway, if we go into the GetTotalVisionRangeBonus() function (which is the function calls all the other visionrangebonus function and the only place those other functions get referenced from) and add a condition right at the start to set gbForceWeaponReady=true when the 'Soldier' in question is an AI, and then return gbForceWeaponReady=false at the end of the function, that will allow the AI to always make use to scopes for visibility calculations even when the AI doesn't have the weapon in a ready position. If that's something you would like to try out, I can compile you a test build with that change made.

[Updated on: Mon, 26 September 2011 18:40] by Moderator

Report message to a moderator

First Sergeant
Re: Reconsidering the Scope Sight Range Bonus[message #291156] Mon, 26 September 2011 19:13 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Thanks Chris, those 16 values were what I was looking for.

ChrisL

Looking at it another way, the worst "night" vision modifier results in a 51% vision range or 13 tiles (assuming BASE_SIGHT_RANGE = 13). NVG IV gives +40% NightVisionRangeBonus and ACOG gives +10%. So combined you get a +50% or 19 tile range. Not the 20 tiles you'd get if both visionrangebonus tags were applied seperately.
Effectively, because of the order in which the modifiers are applied, you'd need to get a combined +100% NightVisionRangeBonus to simply offset the worst "night vision" modifier. And you'd need a combined +280% NightVisionRangeBonus from NVGs + NV Scopes to get the same vision range the above sun goggle example got.
However, I'm exampling the "best" and "worst" light level modifiers for bright and night levels. But if we look at the "best" night level modifier, that's just a 70% vision range. Or 16 tiles. You only need a combined NightVisionRangeBonus of +63% to negate that light level modifier. And you only need a combined NightVisionRangeBonus to get +125% to match the best day range from the above example. With the current items, the best NightVisionRangeBonus combination you can get is NVG IV (+40) + 10x Sniper Scope (+45), resulting in a +85% vision range. So not enough to completely negate the worst night modifier but more then enough to offset the best night modifier.


So basically, I have nothing to fear about the 10%, 20%, 30%, 40% NVG modifiers making night vision better than day vision. Anything below 63% is still reasonable (minimum night penalty negation).

On the other hand, if I want the new NV 10x scope to work sort of like the 10x scope discussed above last week (ignoring the NVG stacking for the moment) I'm going to have to do some math. I've got some OCTH and NCTH penalties on the NVG to "encourage" the use of NV Scopes by themselves. I was actually hoping that the tunnel vision penalty would stack so that I could setup some numbers where NVG + NV Scope = no vision for the player; but this does not seem to be the case. EDIT: otherwise I'll just subtract 60 from whatever number I come up with in anticipation of best case NVG + 10x NVS.

Oh, I'm quite aware of the thermal imaging tag, I think it was the first feature I'm directly responsible for (idle posting on my part lead to Madd Mugsy applying the Crepitus smell "vision" to the player via this feature). My experience is that the capability to see through walls was too good, so in the TI camera, I actually gave it a vision range penalty - you have to be within 5 or 6 tiles of the enemy to be able to see them through the wall, or see them period. What I'm calling Thermal Imaging Goggles, don't use the thermal optics feature, and are simply better NVG goggles that work equally well or better in caves. Of course with the numbers and insight into how it works, these will be refined to actually work as intended.


ChrisL

EDIT: As far as the AI, I still think the best option is to update the code so that the AI always gets any scope bonuses for a weapon in hand, regardless of whether the soldier has the weapon ready or not. It's really the only way to allow the AI to simulate "memory". And it keeps you from needing a special item which you don't want players to have.

EDIT: The AI modification I'm suggesting would actually be extremly simple as well. There is already a global flag: gbForceWeaponReady It's used by the CTH functions because CTH calculations have to be made on the assumption that the weapon being used is actually in a ready position whether it really is or not. Otherwise, things like the "f" hotkey wouldn't work correctly. Anyway, if we go into the GetTotalVisionRangeBonus() function (which is the function calls all the other visionrangebonus function and the only place those other functions get referenced from) and add a condition right at the start to set gbForceWeaponReady=true when the 'Soldier' in question is an AI, and then return gbForceWeaponReady=false at the end of the function, that will allow the AI to always make use to scopes for visibility calculations even when the AI doesn't have the weapon in a ready position. If that's something you would like to try out, I can compile you a test build with that change made.


Yes please, this is something I'd like to test out. May stop the enemy from always running up to my mercs and punching them.

[Updated on: Mon, 26 September 2011 19:19] by Moderator

Report message to a moderator

Lieutenant

Re: Reconsidering the Scope Sight Range Bonus[message #291164] Mon, 26 September 2011 21:22 Go to previous messageGo to next message
Dansken is currently offline Dansken

 
Messages:89
Registered:March 2007
Location: Norway
ChrisL
As far as the AI, I still think the best option is to update the code so that the AI always gets any scope bonuses for a weapon in hand, regardless of whether the soldier has the weapon ready or not. It's really the only way to allow the AI to simulate "memory". And it keeps you from needing a special item which you don't want players to have.

EDIT: The AI modification I'm suggesting would actually be extremly simple as well.


Could this be externalised to an ini setting? (on/off, default: off) And included in the regular release?

That would allow everyone to test the AI under varying circumstances, and hopefully provide valuable feedback.

I know I would love to see what that change would do for the AI. Smile

Report message to a moderator

Corporal 1st Class
Re: Reconsidering the Scope Sight Range Bonus[message #291173] Tue, 27 September 2011 03:07 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
ChrisL

However, I'm exampling the "best" and "worst" light level modifiers for bright and night levels. But if we look at the "best" night level modifier, that's just a 70% vision range. Or 16 tiles. You only need a combined NightVisionRangeBonus of +63% to negate that light level modifier. And you only need a combined NightVisionRangeBonus to get +125% to match the best day range from the above example. With the current items, the best NightVisionRangeBonus combination you can get is NVG IV (+40) + 10x Sniper Scope (+45), resulting in a +85% vision range. So not enough to completely negate the worst night modifier but more then enough to offset the best night modifier.


Ah, something doesn't seem quite right in the math there. I cannot figure out how you got 63% to negate the first level of night modification (70% standard vision range).

Presuming that unmodified best case vision range is 26 tiles, 70% = 18 tiles not 16 tiles, I'm not sure where the 2 tile difference is from.

Just to clarify is your 63% to negate simply the brightest of the night light level modifier? Or that needed to produce the vision range of the merc + sun goggles?

[Updated on: Tue, 27 September 2011 03:13] by Moderator

Report message to a moderator

Lieutenant

Re: Reconsidering the Scope Sight Range Bonus[message #291296] Thu, 29 September 2011 18:03 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
@Dansken: Yes, I should be able to include an INI setting so you can turn the "always ready for visibility" check on and off.

@wil473: Woops. You're right. I goofed the math there. The "best" night vision of 70% would result in a 26 * .70 = 18 tile vision range. So you only need about a 45% increase from NVG to completely offset that. In other words, NVG IV with it's +40% nightvisionrangebonus would get you 25 tile range or 1 tile below base. So any NV scope you include is going to get you better then base range when combined with that NVG IV. That said, you still don't have much to worry about avoiding the combined Bright light + Sun Goggle + Sniper scope result.

Report message to a moderator

First Sergeant
Re: Reconsidering the Scope Sight Range Bonus[message #291303] Thu, 29 September 2011 19:32 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
I've come up with one potential side effect to my "AI memory" fix. Tunnel vision only comes into effect if the weapon is actually ready. So if an AI soldier is carrying a weapon with an attached scope, but the weapon is not currently in a ready state, the soldier will get it's normal 360 vision range PLUS it's entire forward arc will get the scopes bonus. This may not be a bad thing as it would kind of simulate "panning" a weapon around which is something players already do. But it's still a side effect I thought I should mention.

Report message to a moderator

First Sergeant
Re: Reconsidering the Scope Sight Range Bonus[message #291304] Thu, 29 September 2011 19:41 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Oh good, I already did the math to come up with approximate values for magnifying NV sights based on math that gave me the ~45% to negate the first level of nighttime vision penalty.

This is what I've come up with for my mod (see above for the daylight modifiers):

1.5-2x = 28 tiles daylight range = ~53% NV bonus
3.5-4x = 30 tile daylight range = ~60% NV bonus
6x = 38 tiles daylight range = ~110% NV bonus
10x = 48 tiles daylight range = ~160% NV bonus

Report message to a moderator

Lieutenant

Re: Reconsidering the Scope Sight Range Bonus[message #291319] Fri, 30 September 2011 02:27 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
Have you changed the visionrangebonus values? And are your daylight ranges strictly for a scope (i.e., excluding sun goggles)? And are you assuming the best Bright Light level, or 100% of base vision range? If not, then I don't understand the math.

And for your NV Bonus, are you assuming "best" Night Light level?

Based on the default items.xml, I see the following (without / with sun goggles) which is why I'm confused:
2x Scope = +10% BLVRB or 28 / 33 tile bright light range
4x Scope = +20% BLVRB or 31 / 36 tile bright light range
7x Scope = +50% BLVRB or 39 / 44 tile bright light range
10x Scope = +90% BLVRB or 49 / 54 tile bright light range

NV bonuses to match the above, and assuming best night light level of 70% (or 18 tile night vision range), would be:
2x level = ~56% / ~84%
4x level = ~73% / 100%
7x level = ~117% / ~145%
10x level = ~173% / 200%

Remember, the code rounds off all fractions.

Report message to a moderator

First Sergeant
Re: Reconsidering the Scope Sight Range Bonus[message #291327] Fri, 30 September 2011 09:22 Go to previous messageGo to next message
knightofni is currently offline knightofni

 
Messages:96
Registered:August 2011
ChrisL
I've come up with one potential side effect to my "AI memory" fix. Tunnel vision only comes into effect if the weapon is actually ready. So if an AI soldier is carrying a weapon with an attached scope, but the weapon is not currently in a ready state, the soldier will get it's normal 360 vision range PLUS it's entire forward arc will get the scopes bonus. This may not be a bad thing as it would kind of simulate "panning" a weapon around which is something players already do. But it's still a side effect I thought I should mention.


That's a positive side effect. Otherwise it would get a bit too easy to sneak on the AI.

Report message to a moderator

Corporal 1st Class
Re: Reconsidering the Scope Sight Range Bonus[message #291334] Fri, 30 September 2011 16:19 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Scope only to keep things simple, and "best" Night Light level (70%).

The Day bonuses used for my numbers were:
1.5-2x scopes = 10%
3.5-4x scopes = 20%
6x scopes = 50%
10x scopes = 90%

Oddly, it looks like my last revision reverted my scope daylight vision range bonuses to those used by v1.13. I am considering increasing the vision bonuses slightly just to give some space between the sun goggles (10% right now) and the first magnifying scope. Perhaps simply taking the NCTH magnification factor (listed mag factor in the scope's name) and multiplying it by 10 to produce the daylight vision range bonus.

EDIT: that or I may just use the numbers discussed in your last post Chris...

My numbers seem to be slightly off, Chris if you have a moment what is the formula or steps you are using? I'm trying to setup something in Excel to calculate tiles seen (under Daylight and Night right now), using the Truncate function to drop numbers where it looks like it is occurring.


[Updated on: Fri, 30 September 2011 17:03] by Moderator

Report message to a moderator

Lieutenant

Re: Reconsidering the Scope Sight Range Bonus[message #291346] Fri, 30 September 2011 21:33 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
You have to remember that the code does these vision calculations in multiple steps. At each step of the process, all fractions are lost. As a result, and just as a simple example:

Step 1: Take BASE_SIGHT_RANGE * 2 to get base range. 13 * 2 = 26
Step 2: Modify base range for light level. 26 * .7 = 18.2 which returns a result of 18
Step 3: Modify current range for visionrangebonus. 18 + (18 * .1) = 19.8 which returns a result of 19

Pay careful attention to the fractions here. If you try to use the equation: (26 * 0.7) * 110%, you end up with a result of 20.02 which does not match the result in the code. That's because the code doesn't treat this as one long equation. Instead it's treated as multiple small equations, each with fractional results truncated. If you're going to set this up as an excel spreadsheet, you'd need to make sure that you used the "floor()" function on each step of the calculation just to make sure that your equation didn't using an fractional results.

Report message to a moderator

First Sergeant
Re: Reconsidering the Scope Sight Range Bonus[message #291360] Sat, 01 October 2011 00:52 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Thanks Chris, that is exactly what I needed to to setup a table to emulate how the game calculates the number of tiles your mercs can see. My mistake was that I tried to solve for the wanted range (ie. what the equivalent scope does during the "day"). Instead of solving, I'll just be plugging in modification values till I zero in on the wanted range (with so few numbers this will be faster than trying to do the math properly).

All calculated values for scopes presume no other vision enhancements (so in theory these should be somewhat conservative).

Daylight = 94% (ie. the best of the Day group you supplied earlier)
Night = 70%

I'm going to duplicate the determined NV modifier into the Cave modifier, except for the FLIR scope and weapon sight. These items will have Cave calculated specifically so that vision range under all light conditions will be more or less the same.

Cave = 43%

Report message to a moderator

Lieutenant

Re: Reconsidering the Scope Sight Range Bonus[message #291579] Wed, 05 October 2011 18:30 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
I have not committed or compiled any builds relating to my proposed change that would allow the AI to always act as though it had a weapon ready for vision distance checks. Before I committed the change, I opened a thread on the discussion forum: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=291578 Sandro, who is familiar with the AI code, has been taking a look at the problem that I reported in that thread and he's working to try and resolve the AI so that my "hack" won't be required. I think correcting the AI is a better solution then what I came up with. I just don't know the AI code so I couldn't do it. As a result, I want to let Sandro work on the AI code and we can take a look at his changes when he gets them released. Hopefully they will solve the AI vision problems but we can always revisit my solution in the future.

Report message to a moderator

First Sergeant
Re: Reconsidering the Scope Sight Range Bonus[message #291581] Wed, 05 October 2011 19:55 Go to previous messageGo to next message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
No problem, my origianl "cheater" sun-goggles for the AI are ready to go in the event neither AI changes or your AI & Scope vision changes end up in the next patch. No rush, my eyes are already bleeding from trying to synchronize all the stuff that is immediately actionable between the three mods. Notepad++ is able to compare different versions of items.xml, but I'm finding that over time "nothing" class items have ended up being filled with different junk.

Streaching what is on-topic, I'm going to seek advice on/discuss use of the tag here. Basically, the inverse of what was previous discussed here: situations where weapon range is shorter than sight range & scope's "sweet spot"

Under OCTH, and dispite my scope penalties, it still made sense under some condidtions to have a 10x scope on a Desert Eagle, however under NCTH this does not seem to be the case anymore. As I am thinking of applying to 6x and 10x sniper scopes, I thought I should get some idea of how it should work.

Also I am reconsidering the use of on the new ballistic calculator attachment. My reading of the is that it only is effective for targets beyond the weapon's range, so its use on a sniper rifle only attachment doesn't seem to be all that useful.

On the otherhand, giving it to scopes that may be mounted on pistols, SMG's, and AR's (usually via adapters except for the Desert Eagles) may be wreck the balance making the shorter range of these weapons even less relevant under NCTH. The question is, under NCTH how big is the effect of vs. weapon's inherent range?

[Updated on: Wed, 05 October 2011 20:08] by Moderator

Report message to a moderator

Lieutenant

Re: Reconsidering the Scope Sight Range Bonus[message #291582] Wed, 05 October 2011 22:23 Go to previous messageGo to next message
ctiberious is currently offline ctiberious

 
Messages:605
Registered:March 2007
PercentDropCompensation is only referenced in the CalcRangeCompensationOffset() function which is only ever called if actual range to target is greater then the "max range" of the weapon. "Max range" is equal to the weapon's listed effective range (usRange) times the RANGE_COEFFICIENT value in cthcontants.ini. Based on default settings, this means any PercentDropCompensation granted to a Desert Eagle isn't going to come into effect unless the target is 270m (27 tiles) away.

The actual PercentDropCompensation tag is treated as a percentage modifier applied against the shooters skill at compensating for extreme range. Shooters skills is based on MRK, WIS, DEX and Lvl with weight on each of these attributes listed in the cthconstants.ini file. These combine together to get a 0-100 range. PercentDropCompensation simply increases or decreases the result of our mercs attributes, though the result still can not deviate from the 0-100 range. In other words, if a merc's attributes combine together to get a 75 drop comensation ability, and a weapon gets a PercentDropCompensation=10, then the shooter is going to effectively have a 82 drop comp ability. If the shooter's attributes give him a 95 base result, that same PercentDropCompensation=10 will get the merc only a 100 or only about a 5% bonus.

Report message to a moderator

First Sergeant
Re: Reconsidering the Scope Sight Range Bonus[message #291588] Wed, 05 October 2011 23:49 Go to previous message
Wil473

 
Messages:2815
Registered:September 2004
Location: Canada
Thanks. Basically partially (or totally) makes up for one specific shooting skill that the merc may be deficinent in. Also my concerns about using this tag on a "ballistic computer" is more or less correct as this tag only comes into use when out of range.

Best option for the Desert Eagles is to chalk up the 10x Scope under NCTH as one of those "impractical" things that I won't stop players from trying. Probably throw in a 2x "Pistol" scope at the same coolness level as the 10x Scope to compensate.

Report message to a moderator

Lieutenant

Previous Topic: Vision Range & Accuracy are disconnected
Next Topic: UC hybrid 1.13
Goto Forum:
  


Current Time: Fri Mar 29 10:24:50 GMT+2 2024

Total time taken to generate the page: 0.02962 seconds