Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: Spotter
New feature: Spotter[message #329093]
|
Thu, 19 December 2013 23:24
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
Use mercs as spotters for your snipers
Snipers often operate in a team with a dedicated spotter, who helps them making out targets, setting up an optimal firing position, not get ambushed, and making for a tense bromance under fire.
There was no real reason to do so in JA2 so far - and I intend to change that.
Every merc now has access to a new skill - Spotter - in the Skill Menu under Various called with $. When activated, the merc will then become a spotter. A spotter basically increases accuracy for snipers firing on a location he observes, but does not get that bonus himself.
- Becoming a spotter takes a few turns. Only after SPOTTER_PREPARATIONTURNS - 1 turns he will be ready to as a spotter. Observing takes time, you know? This state - spotting, but not yet granting a bonus - is indicated by a red eye symbol on his portrait.
- Once enough turns have passed, he becomes a spotter, indicated by the normal eye on the merc portrait.
- In order to become a spotter, you need to equip special items in your hands. These items need to have the new -tag. The higher the value, the more effective.
- A friendly sniper gets a bonus to cth (both OCTH and NCTH) if his target is a tile or person that the spotter can see. The maximum bonus is SPOTTER_MAX_CTHBOOST. If multiple spotters are present, the biggest bonus counts.
- However, it only applies if sniper and spotter are not more than SPOTTER_RANGE tiles away from each other. It is also required that the target be at least 2 * SPOTTER_RANGE tiles away from the spotter. This is supposed to be for long-range sniping, after all.
- 'Sniper' is any merc using a sniper rifle in this context. Sniper trait is not required.
- Spotting effectivity depends on:
- Effectivity of spotting items in hands. Object status affects value. Attachments are also taken into account (yes, even scope modes on guns).
- Experience level
- Marksmanship
- Leadership
- Fatigue
- Wether spotter is wounded
- The new 'spotter' background property
- sociable or loner character, for both spotter and sniper
- The relationship between mercs is very important (basic opinion, buddies, sexism, racism etc.). Raider spotting for Raven gives a ~100% bonus... Buzz is useless spotting for Lynx :blackcat:
- time spent spotting can increase bonus significantly
- There is, however, a huge drawback to this: a spotter stops spotting as soon as he spends any APs. A spotter has to exactly analyse the situation, taking into account wind, temperature, the bullet's trajectory etc... performing an action would distract from that.
As a merc is effectively out of combat as long as he is a spotter, you have to carefully weigh wether the increased cth on your sniper is worth taking another combat merc out of combat. Effective spotters are those with high experience an marksmanship - which will be mercs you'd otherwise use in combat.
The default spotter items are binoculars. It is reasonable to first look through them before ordering the spotting - you will want to see as far away as possible, as spotting does not work in your immediate surrounding.
Shadow is ordered to become a spotter. Everyone inside the green circle around him (this includes Scope) will benefit from his spotting if firing on a location/person that Shadow sees outside (and including) the orange circle.
Scope's cth without Shadow spotting is 42%...
... her cth with him spotting is 51%
This feature does not break savegame compatibility. However, a GameDir >= r1896 is required, as new face icons were added.
This has been added to the trunk in r6694 and GameDir r1896.
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: New feature: Spotter[message #329120]
|
Fri, 20 December 2013 21:16
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
As of r6698, sociable and loner character now affects spotting effectivity. For those interested, here's the cth bonus calculation (from SoldierControl.cpp):
// bonus for snipers firing at this location (we get this if there are spotters)
UINT16 GridNoSpotterCTHBonus( SOLDIERTYPE* pSniper, INT32 sGridNo, UINT bTeam)
{
INT16 bestvalue = 0;
SOLDIERTYPE* pSoldier = NULL;
INT32 cnt = gTacticalStatus.Team[ bTeam ].bFirstID;
INT32 lastid = gTacticalStatus.Team[ bTeam ].bLastID;
for ( pSoldier = MercPtrs[ cnt ]; cnt < lastid; ++cnt, ++pSoldier)
{
if ( pSoldier != pSniper && pSoldier->sSectorX == gWorldSectorX && pSoldier->sSectorY == gWorldSectorY && pSoldier->bSectorZ == gbWorldSectorZ
&& pSoldier->IsSpotting()
&& PythSpacesAway(pSoldier->sGridNo, pSniper->sGridNo) <= gGameExternalOptions.usSpotterRange
&& PythSpacesAway(pSoldier->sGridNo, sGridNo) >= 2 * gGameExternalOptions.usSpotterRange )
{
BOOLEAN targetseen = FALSE;
UINT usID = WhoIsThere2( sGridNo, pSniper->bTargetLevel );
// is someone is at the sGridNo, check wether the spotter can see any part of him check wether head can be seen)
if ( usID != NOBODY && SoldierToSoldierLineOfSightTest( pSoldier, MercPtrs[usID], 0, NO_DISTANCE_LIMIT, AIM_SHOT_HEAD ) > 0 )
targetseen = TRUE;
// otherwise check wether we can see the ground floor
else if ( SoldierToVirtualSoldierLineOfSightTest( pSoldier, sGridNo, pSniper->pathing.bLevel, ANIM_PRONE, FALSE, NO_DISTANCE_LIMIT ) > 0 )
targetseen = TRUE;
if ( targetseen )
{
// spotter items are used to determine effectiveness. cap each hand item to a maximum of 100 pts (to keep players from using guns with tons of attachments that have been declared 'spotter items')
UINT16 itembonus = 0;
if ( pSoldier->inv[HANDPOS].exists() )
itembonus += min(100, GetObjectModifier( pSoldier, &(pSoldier->inv[ HANDPOS ]), gAnimControl[ pSoldier->usAnimState ].ubEndHeight, ITEMMODIFIER_SPOTTER ) );
if ( pSoldier->inv[SECONDHANDPOS].exists() )
itembonus += min(100, GetObjectModifier( pSoldier, &(pSoldier->inv[ SECONDHANDPOS ]), gAnimControl[ pSoldier->usAnimState ].ubEndHeight, ITEMMODIFIER_SPOTTER ) );
// base spotter effectivity depends on 40% items, 30% experience, 20% marksmanship an 10% leadership
// the nominal value is between 0 and 1000 (though the actual value can be raised higher, due to effective stat and level boni)
UINT32 value = 2 * itembonus + 30 * EffectiveExpLevel( pSoldier ) + 2 * EffectiveMarksmanship( pSoldier) + EffectiveLeadership( pSoldier);
// lowered effectivity if we're fatigued
ReducePointsForFatigue( pSoldier, &value );
// lowered effectivity if we're wounded
value = (value * pSoldier->stats.bLife / pSoldier->stats.bLifeMax);
// effectivity of spotter and sniper working together in percent
UINT16 effectivity = 100;
// sociable mercs get a bonus, loners get a malus
if ( OKToCheckOpinion(pSoldier->ubProfile) )
{
MERCPROFILESTRUCT* pProfile = &(gMercProfiles[ pSoldier->ubProfile ]);
switch( pProfile->bCharacterTrait )
{
case CHAR_TRAIT_SOCIABLE:
effectivity += 10;
break;
case CHAR_TRAIT_LONER:
effectivity -= 10;
break;
}
}
if ( OKToCheckOpinion(pSniper->ubProfile) )
{
MERCPROFILESTRUCT* pProfile_Sniper = &(gMercProfiles[ pSniper->ubProfile ]);
switch( pProfile_Sniper->bCharacterTrait )
{
case CHAR_TRAIT_SOCIABLE:
effectivity += 10;
break;
case CHAR_TRAIT_LONER:
effectivity -= 10;
break;
}
}
// relation between sniper and spotter is important - they need to trust each other (-50 to 50)
INT8 relation = min( 2*BUDDY_OPINION, max( 2*HATED_OPINION, SoldierRelation(pSoldier, pSniper) + SoldierRelation(pSniper, pSoldier) ) );
// relation counts twice. Also account for special background. Effectivity cannot be lower than 0%!
effectivity = max(0, effectivity + 2 * relation + pSoldier->GetBackgroundValue(BG_PERC_SPOTTER) );
// a good relation boosts value tremendously - a bad relation makes spotting useless
// the spotter background also alters effectiveness
// -> value between 0 and 2000
value = (value * effectivity ) / 100;
// longer spotting gives a linear bonus - up to 100% -> value between 0 and 4600
value = (value * min(pSoldier->usSkillCounter[SOLDIER_COUNTER_SPOTTER], 2 * gGameExternalOptions.usSpotterPreparationTurns)) / gGameExternalOptions.usSpotterPreparationTurns;
// reasonable values: 0 to gGameExternalOptions.usSpotterMaxCTHBoost
value = (value * gGameExternalOptions.usSpotterMaxCTHBoost) / 4000;
if ( value > bestvalue )
bestvalue = value;
}
}
}
// limit value
bestvalue = min( gGameExternalOptions.usSpotterMaxCTHBoost, max(0, bestvalue ) );
return bestvalue;
}
Report message to a moderator
|
|
|
|
Re: New feature: Spotter[message #329122]
|
Fri, 20 December 2013 23:52
|
|
Taro_M |
|
Messages:292
Registered:November 2008 |
|
|
Could add an option so Mercs with Marksman/Sniper trait get a bonus for working with spotter. Also Mercs with scouting trait give even bigger bonus.
[Updated on: Fri, 20 December 2013 23:52] by Moderator Report message to a moderator
|
Master Sergeant
|
|
|
|
|
Re: New feature: Spotter[message #329126]
|
Sat, 21 December 2013 01:14
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
We add Grunty's opinon on Buns (-1) + Buns opinion on Grunty (-5), multiply by 2 and then alter effectivity by it (100% - 12% = 88%). Thus cth received by spotting is lower than it would be for totally bland mercs. Sexism/racism don't factor in, because Grunty is non-prejudiced and too average for Buns to care.
While this calculation is correct, I am very surprised that both have a negative opinion of each other. But this data seems pretty vanilla to me, no changes since the file is under svn... dafuq?
This really irks me. Either merc opinions were always somewhat borked, or they've been messed with a long time ago.
Edit: Wait a minute. Ignore the last part. Damn, this game is ingenious :professor:
What I said above is true at the beginning of the game. Grunty learns to like Buns in an ongoing campaign. Which increases his opinion up to 25. Then, the modifier becomes 25 + -5 = 20, which then becomes a 2*20% = 40% bonus on cth.
So if the base cth gain were 10%, she'll get 8% in the beginning, but 14% later on.
[Updated on: Sat, 21 December 2013 01:22] by Moderator Report message to a moderator
|
|
|
|
Re: New feature: Spotter[message #329127]
|
Sat, 21 December 2013 02:24
|
|
Elvis_A |
|
Messages:282
Registered:December 2012 Location: exUSSR |
|
|
FlugenteWe add Grunty's opinon on Buns (-1) + Buns opinion on Grunty (-5), multiply by 2 and then alter effectivity by it (100% - 12% = 88%). Thus cth received by spotting is lower than it would be for totally bland mercs. Sexism/racism don't factor in, because Grunty is non-prejudiced and too average for Buns to care.
While this calculation is correct, I am very surprised that both have a negative opinion of each other. But this data seems pretty vanilla to me, no changes since the file is under svn... dafuq?
This really irks me. Either merc opinions were always somewhat borked, or they've been messed with a long time ago.
Edit: Wait a minute. Ignore the last part. Damn, this game is ingenious :professor:
What I said above is true at the beginning of the game. Grunty learns to like Buns in an ongoing campaign. Which increases his opinion up to 25. Then, the modifier becomes 25 + -5 = 20, which then becomes a 2*20% = 40% bonus on cth.
So if the base cth gain were 10%, she'll get 8% in the beginning, but 14% later on.
thanks for explanation, i did not get last part though =(
40% bonus after learned to like or 24?
Report message to a moderator
|
Master Sergeant
|
|
|
Re: New feature: Spotter[message #329128]
|
Sat, 21 December 2013 02:26
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
It's a 40% bonus on the extra cth received by spotting compared to 2 generic mercs that have no opinion whatsoever on each other.
[Updated on: Sat, 21 December 2013 02:27] by Moderator Report message to a moderator
|
|
|
|
|
|
Re: New feature: Spotter[message #329223]
|
Mon, 23 December 2013 20:13
|
|
LootFragg |
|
Messages:349
Registered:August 2009 Location: Berlin, Germany |
|
|
I agree with E1vS with regards to Wisdom influencing spotting skill. My ArmA 2 experience says I can't use random players as spotters.
"I see one, right there. To our front. Like where I'm looking, look! Yeh, if you like look straight and then left, then you see it. Now he's standing up. Look, he's running err left. Distance to red house at 347? You mean the white house? The red one? Okay. Err... Hold on. I think 5. Err... 6169. Kilometers. Or no wait. Meters. Oh the other value? Eh, it's err... oh, I see the guy again, he's still running left. Distance? Err... 5? Now he's out in the open! Shoot, shoot!"
EXP > MRK > LDR > WIS is okay, but it should be relevant as it includes accurate communication and proper calculation.
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: New feature: Spotter[message #329661]
|
Thu, 09 January 2014 17:30
|
|
M16AMachinegun |
|
Messages:304
Registered:September 2013 |
|
|
Requesting Extended Ears to increase range of those that benefit to a factor of 2x like how Deputy/Squadleader bonuses double in range with use of Extended Ears
Excellent idea! I usually have people sitting in the back with binoculars if they have weapons that are out of range, this'll totally help!
Edit 1: Oh! What about giving a slight bonus to anyone who is concentrating on aiming/looking in any one location for a while? Not as strong as the spotter (Reason: the merc has to keep control of his stance/weapon) but imo a merc should have some sort of bonus for keeping his attention aimed in a specific direction (doesnt HAVE to be aiming but obviously doing that is a good idea)
Or perhaps that's already accounted for how CTH works already.
Anyway, question: Will spotting help for shooting things within the gun's range but outside of visual range, such as using a 6x scope within its range (say if the base iron sight range is extended to, say, 13 like how it is in AFS) but outside of the visual range?
[Updated on: Thu, 09 January 2014 17:40] by Moderator Report message to a moderator
|
Master Sergeant
|
|
|
|
|
|
Re: New feature: Spotter[message #329688]
|
Sat, 11 January 2014 00:58
|
|
M16AMachinegun |
|
Messages:304
Registered:September 2013 |
|
|
Just started a new game, can't make Ira spot, it's greyed out.
Is it just because base Ira has derp stats?
using the 9 JAN 2014 release with the latest AFS over it
[Updated on: Sat, 11 January 2014 01:02] by Moderator Report message to a moderator
|
Master Sergeant
|
|
|
|
|
|
Re: New feature: Spotter[message #329692]
|
Sat, 11 January 2014 01:49
|
|
M16AMachinegun |
|
Messages:304
Registered:September 2013 |
|
|
Wow, that was surprisingly simple, actually
Hell, i might even be able to post a patch for wil
Edit 1: Erm...which xml document are scopes kept in?
Edit 2: Partial disregard, I think i'm good with just letting my mercs use binoculars to spot
[Updated on: Sat, 11 January 2014 01:54] by Moderator Report message to a moderator
|
Master Sergeant
|
|
|
|
Re: New feature: Spotter[message #329695]
|
Sat, 11 January 2014 02:40
|
|
M16AMachinegun |
|
Messages:304
Registered:September 2013 |
|
|
Trying to edit stuff using the xml editor after adding the spotting tags to the binoculars creates the following error the moment it tries to load items.xml
Invalid Character in the given encoding. Line 19948, position 99
Line in question:
Another wonder of the depths of ACME fabrication. Maybe even more space you'll need ż/szItemDesc>
uh...?
Hang on, gonna try editing in the tags again now that i have notepad++
Where should I put the spotter tag in?
Edit 1: recopied files since i made a mistake and the JA2 XML Editor was giving me like 50 error messages before fatally crashing. Recopied in all places where there was a usSpotting tag
XML editor is working fine. I have to remake some items and whatnot before i can test
Edit 2: No idea what i screwed up, spotting's working now. cheers!
[Updated on: Sat, 11 January 2014 05:15] by Moderator Report message to a moderator
|
Master Sergeant
|
|
|
Goto Forum:
Current Time: Sun Dec 01 09:22:01 GMT+2 2024
Total time taken to generate the page: 0.03738 seconds
|