Changes:
- exploit Fix: we can only disguise successfully if we haven't been seen recently
- disabled automatic clothes stripping when uncovered
- disguise automatically if spy haven't been seen by enemy recently and wears correct clothes
- uncover spy in combat automatically only if the soldier who sees him also have seen any enemy this turn
That seems intriguing - you mind uploading this particular patch? Sounds like an interesting option.
The patch is here, but I doubt it will be useful as it's made for modified stable 7609 source, and it also includes some other minor changes and fixes.
The changes are very simple:
I disabled call to soldier->Strip() in all places except Handle items.cpp where it's intentional, then added new check function:
BOOLEAN EnemySeenSoldierRecently( SOLDIERTYPE *pSoldier, UINT8 ubMax )
{
UINT32 uiLoop;
SOLDIERTYPE *pOpponent;
//loop through all the enemies and determine the cover
for (uiLoop = 0; uiLoop<guiNumMercSlots; ++uiLoop)
{
pOpponent = MercSlots[ uiLoop ];
// if this merc is inactive, at base, on assignment, dead, unconscious
if (!pOpponent || pOpponent->stats.bLife < OKLIFE)
{
continue; // next merc
}
// if this man is neutral / on the same side, he's not an opponent
if( CONSIDERED_NEUTRAL( pSoldier, pOpponent ) || (pSoldier->bSide == pOpponent->bSide))
{
continue; // next merc
}
// sevenfm: ignore empty vehicles
if( pOpponent->ubWhatKindOfMercAmI == MERC_TYPE__VEHICLE && GetNumberInVehicle( pOpponent->bVehicleID ) == 0 )
{
continue;
}
// if opponent is collapsed/breath collapsed
if( pOpponent->bCollapsed || pOpponent->bBreathCollapsed )
{
continue;
}
// check that this opponent sees us
if( pOpponent->aiData.bOppList[ pSoldier->ubID ] >= SEEN_CURRENTLY &&
pOpponent->aiData.bOppList[ pSoldier->ubID ] <= ubMax )
{
return( TRUE );
}
}
return FALSE;
}
This function checks enemy's knowledge about this particular soldier and does not involve any line of sight checks, so it should work fast, also unlike existing cover check, it takes into account all enemy soldiers and not only those our spy can see currently.
Then replace cover sheck in Items.cpp/ApplyClothes() with this new function:
// we can only disguise successfully if we are not seen
//INT8 bCover = MAX_COVER;
//CalculateCoverForSoldier( pSoldier, pSoldier->sGridNo, pSoldier->pathing.bLevel, bCover );
if ( !EnemySeenSoldierRecently(pSoldier) )
Added new function to Soldier Control.cpp which is used for automatic disguising:
Note: similar code in ApplyClothes could be probably replaces with a call to this function.
// auto disguise if have correct clothes
void Disguise( void );
void SOLDIERTYPE::Disguise( void )
{
// this will only work with the new trait system
if (!gGameOptions.fNewTraitSystem)
{
return;
}
// check if we already disguised
if( this->usSoldierFlagMask & (SOLDIER_COVERT_CIV | SOLDIER_COVERT_SOLDIER | SOLDIER_COVERT_NPC_SPECIAL) )
{
return;
}
// check that soldier is active and in sector
if ( !this->bActive || !this->bInSector )
{
return;
}
// check that we have correct clothes
if ( this->usSoldierFlagMask & SOLDIER_NEW_VEST && this->usSoldierFlagMask & SOLDIER_NEW_PANTS )
{
// first, remove the covert flags, and then reapply the correct ones, in case we switch between civilian and military clothes
this->usSoldierFlagMask &= ~(SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER);
// we can only disguise successfully if we are not seen
if ( !EnemySeenSoldierRecently(this) )
{
// we now have to determine wether we are currently wearing civilian or military clothes
for ( UINT8 i = UNIFORM_ENEMY_ADMIN; i <= UNIFORM_ENEMY_ELITE; ++i )
{
// both parts have to fit. We cant mix different uniforms and get soldier disguise
if ( COMPARE_PALETTEREP_ID(this->VestPal, gUniformColors[ i ].vest) && COMPARE_PALETTEREP_ID(this->PantsPal, gUniformColors[ i ].pants) )
{
this->usSoldierFlagMask |= SOLDIER_COVERT_SOLDIER;
if ( pSoldier->bTeam == OUR_TEAM )
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_DISGUISED_AS_SOLDIER], pSoldier->GetName() );
break;
}
}
// if not dressed as a soldier, we must be dressed as a civilian
if ( !(this->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER) )
{
this->usSoldierFlagMask |= SOLDIER_COVERT_CIV;
if ( pSoldier->bTeam == OUR_TEAM )
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_DISGUISED_AS_CIVILIAN], pSoldier->GetName() );
}
}
// reevaluate sight - otherwise we could hide by changing clothes in plain sight!
OtherTeamsLookForMan(this);
}
}
Also added automatic disguising in SoldierPropertyUpkeep():
// disguise automatically
this->Disguise();
So now, every time a soldier is uncovered, he should run away and wait for several turns, then he will disguise again automatically.
If there are no alive hostile conscious soldiers in the sector, then disguising will happen immediately.
Old way of disguising with manually removing/applying clothes still works (with new enemy knowledge check).
Notes: by changing second parameter in EnemySeenSoldierRecently function it's possible to change number of turns needed to be able to disguise again, for example, allow disguising on the next turn:
Also, made small tweak to Knowledge.cpp/MostImportantNoiseHeard(): ignore noise from covert soldier if some friends already see this soldier (depending on the sector information):
// Flugente: chance to ignore the noise if the creator is covert
if ( pTemp->usSoldierFlagMask & (SOLDIER_COVERT_CIV|SOLDIER_COVERT_SOLDIER) )
{
// green AI state: always ignore
// yellow AI state: 50% chance to ignore
if ( pSoldier->aiData.bAlertStatus == STATUS_GREEN ) || (pSoldier->aiData.bAlertStatus == STATUS_YELLOW && Random(2) < 1 ) )
{
continue; // next merc
}
// sevenfm: ignore noise if some friends already see opponent
if( CountTeamSeeSoldier(pSoldier->bTeam, pTemp) > sectordata )
{
continue; // next merc
}
}
Added new "suspiciousness" counter for covert operations, how it works?
- every time a spy spents some APs, counter is incremented depending on the number of enemies that can see spy currently, their level and skills and distance to spy
- running or moving in crawling or swatting mode adds bonus to counter
- being in restricted area (Curfew value) adds bonus to couner
- alerted enemy causes counter to grow much faster
- the counter is shown as merc name's color, if disguise is ok, it's yellow, when the counter starts growing, the color reflects this, after achieving max suspicion level, color becomes red and enemy uncovers spy
- if no enemy sees spy currently, counter is reduced 25% every turn
- at the end of turn in turnbased mode, unspent APs are added to the counter
- in realtime mode, sitting still will slowly increase counter, moving increases counter according to APs spent
- also new indicator will show red if spy has bad gear and will be uncovered
So what this change means for player?
1. Less 'binary' playing - if your disguise is good, it doesn't mean you can go everywhere and walk endlessly in front of enemy.
2. You have to avoid big groups of enemy, avoid running or swatting/crawling, if enemy becomes alerted, playing covert becomes much harder.
3. You need to find some places to hide (to lower suspicion counter), so you need to plan your actions.
4. Performing spy actions in sectors with limited access (SAM sites etc) will be much harder, especially on high difficulty levels with many high level soldiers.
5. You have visual representation of covert status (merc name color), so this feature is now more player friendly.
Hu. That seems very promising indeed. Good work!
Not sure on whether green is already taken, but why not use the full range from green to red for the name?
Come to think about it, with this one could remove the hard distinction between spy level 1 and 2 somewhat, and have the suspicion simply rise slower for an expert spy.
I'm currently fitting your above code into the trunk, and have come upon a serious bug in GuySawEnemy(...):
// consider guys in this team, which isn't on our side
for ( ubIDLoop = gTacticalStatus.Team[ ubTeamLoop ].bFirstID; ubIDLoop <= gTacticalStatus.Team[ ubTeamLoop ].bLastID; ubIDLoop++ )
{
pOpponent = MercSlots[ ubIDLoop ];
MercSlots is an array of SOLDIERTYPE* where we add any soldier, one after another. We're even mixing teams in there it seems.
MercPtrs is an array of SOLDIERTYPE* where soldiers are in specific sections of the array (first 32 is mercs, then 6 slots for vehicles, then 64 slots for the enemy and so on).
As a result, using gTacticalStatus.Team[ ubTeamLoop ].bFirstID and gTacticalStatus.Team[ ubTeamLoop ].bLastID only properly works on MercPtrs, not on MercSlots (we loop over that via guiNumMercSlots). This causes this function to not work as intended.
Edit: I'm not really a fan of the 'uncover spy automatically when in combat and we've seen any hostile', so I'm skipping that part.
[Updated on: Fri, 13 May 2016 00:01]
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
Hu. That seems very promising indeed. Good work!
Not sure on whether green is already taken, but why not use the full range from green to red for the name?
Come to think about it, with this one could remove the hard distinction between spy level 1 and 2 somewhat, and have the suspicion simply rise slower for an expert spy.
I'm currently fitting your above code into the trunk, and have come upon a serious bug in GuySawEnemy(...):
// consider guys in this team, which isn't on our side
for ( ubIDLoop = gTacticalStatus.Team[ ubTeamLoop ].bFirstID; ubIDLoop <= gTacticalStatus.Team[ ubTeamLoop ].bLastID; ubIDLoop++ )
{
pOpponent = MercSlots[ ubIDLoop ];
MercSlots is an array of SOLDIERTYPE* where we add any soldier, one after another. We're even mixing teams in there it seems.
MercPtrs is an array of SOLDIERTYPE* where soldiers are in specific sections of the array (first 32 is mercs, then 6 slots for vehicles, then 64 slots for the enemy and so on).
As a result, using gTacticalStatus.Team[ ubTeamLoop ].bFirstID and gTacticalStatus.Team[ ubTeamLoop ].bLastID only properly works on MercPtrs, not on MercSlots (we loop over that via guiNumMercSlots). This causes this function to not work as intended.
Edit: I'm not really a fan of the 'uncover spy automatically when in combat and we've seen any hostile', so I'm skipping that part.
Thank you for the bug and info, I reworked the function, it should work ok now. Somehow these arrays were mixed up in my mind.
BOOLEAN GuySawEnemy( SOLDIERTYPE * pSoldier, UINT8 ubMax )
{
UINT8 uiLoop;
SOLDIERTYPE *pOpponent;
for (uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++)
{
pOpponent = MercSlots[ uiLoop ];
// if this merc is inactive, at base, on assignment, or dead
if (!pOpponent || !pOpponent->bActive || !pOpponent->bInSector)
{
continue;
}
// if this merc is neutral/on same side, he's not an opponent
if ( CONSIDERED_NEUTRAL( pSoldier, pOpponent ) || (pSoldier->bSide == pOpponent->bSide) )
{
continue;
}
// if this guy SAW an enemy recently...
if( pSoldier->aiData.bOppList[ pOpponent->ubID ] >= SEEN_CURRENTLY &&
pSoldier->aiData.bOppList[ pOpponent->ubID ] <= ubMax )
{
return( TRUE );
}
}
return( FALSE );
}
Flugente
Not sure on whether green is already taken, but why not use the full range from green to red for the name?
Don't know, I don't like green names for mercs, maybe because green is already used for zombies, it doesn't fit well for merc name.
Yellow shows that merc has correct clothes and it can disguise (so SeemsLegit returns TRUE).
Flugente
Come to think about it, with this one could remove the hard distinction between spy level 1 and 2 somewhat, and have the suspicion simply rise slower for an expert spy.
Already implemented, I forgot to mention it:
- for 1 level spy skill, added suspicion value is divided by 2
- for 2 level spy skill, added suspicion value is divided by 4
Flugente
I'm not really a fan of the 'uncover spy automatically when in combat and we've seen any hostile', so I'm skipping that part.
Yes, with new suspicion counter this can be removed, for example if enemy is in black state or under fire, then suspicion value from him can be doubled.
Even more, other limits can be incorporated into this:
- covert civilian without skill too close to enemy
- covert soldier without skill too close to enemy
- covert merc too close to corpse
- maybe even things based on merc animation/actions like lock picking etc
...
Simply add modifier to added suspicion value and remove boolean checks, so covert merc will be able to move a few tiles in such situation but will be discovered if he stays longer in enemy sight.
Some changes and improvements to Covert Operations
- only mercs with COVERT trait will disguise automatically, also they will strip clothes if "Loose disguise" button is pressed in Ctrl+dot menu
- default civilian clothes: white + blue/jean
- don't use enemy military colors for civilian clothes
- moved most limits for covert soldiers to suspicion counter
Other changes:
- raise alert in YELLOW state if soldier sees fresh corpse
- enemy will see fresh corpse and raise alert at any range in GREEN/YELLOW state
Now soldier will be uncovered immediately only in following conditions:
- suspicion counter is red
- suspicious animation is seen by enemy
- civilian spy doesn't look like a civilian (has camo or gun in hand or any not covert weapons or military gear)
- soldier spy doesn't look like a soldier (he carries a corpse)
- spy is very close to a corpse (standing next to it)
- soldier is targetting a buddy of observing enemy
All other conditions are moved to suspicion counter:
basic value is 1..5 depending on the level of enemy soldier
+1 for each squadleader skill of enemy soldier
+1 if spy is using flashlight
+2 in capital (Meduna)
Total: 1..10 for each enemy observing our soldier
*2 if spy is running or crawling or swatting
*2 if spy is bleeding or spy soldier is drunk or spy soldier has no covert skill or spy soldier has too good equipment
*2 in special sectors or at night or underground, *4 if sector has Curfew=2
*2 if enemy is alerted
*2 if enemy is in combat (saw enemy this turn or under attack)
Total: basic value (1..10) can be multiplied by 1..64, depending on a situation
/2 if spy has covert skill, for each level of covert skill
if observing soldier is farther than day vision range /4, value is reduced accordingly, so at full day visoin range value will be divided by 4
Total: value can be divided by 1..8, depending on a situation and spy skills
Finally, all suspicion values from observing soldiers are added, and then total value is multiplied by amount of spent APs and added to merc's suspicion counter.
Maximum value for merc's suspicion counter is 100 * AP_MAXIMUM, this means:
100 turns in turnbased being observed by low level enemy close without additional modifiers
50 turns in the same situation but with 2 observing enemies
25 turns if enemy is alerted
etc...
hello to all of the guys here. saying a priori that i am a great fun of your awesome work on the ja1.13 i would like to propose something. i dont know where else i could do it and opening a new thread maybe its not the case. in incubation lab or in experimental i hope its better. anyway i am playing right now the latest version of ja1.13 svn + latest build + latest aimnas on windows 10 and everything looks smooth. the only problem is that the regenaration syring just wont regenarate. it does not work. minor problem for now.
my suggestion, after reading a lot in this site and unless i missed something, is the possibility for the Queen's army to use both local and on patrols the robots. we know that in one quest the player can get one of his own through dr. Kairns i think. but what if the queen had tens of them and like officers or generals they appeared in both tactical and autoresolve. or even better her using huge robots or something likethat. i dont know if its something than can be done. Another idea is for the queen to attack cities through sea. get to balime, chitzena or grumm with battle ships full of soldiers. something out of player's controll. last idea was to expand as possible the
underground levels , even trasporting some quests there, even the queen herself take her to level 3 after take over of meduna.
if i posted on the wrong thread i apologize. keep up the good work.
This thread is definitely not the right place to post requests for unstable builds or Aimnas, it's better to make a new thread if you have some suggestions for 1.13 coders.
Some more fixes and improvements for JA2+AI project
AI:
- soldiers with certain roles are forced to use defensive/cunning orders (officers/commanders/snipers/marksmans/mortar operators), because they usually should stay behind
- test feature: avoid sitting at door tiles when doing random patrols, this should help when playing covert
- don't raise alarm again if found handcuffed friend and status is already RED
- raise alarm when found friend who is captured with binders
- removed yellow flanking as it doesn't make much sense for me and it may be time consuming especially when playing covert in realtime
- performance update for ClosestReachableDisturbance (if we found reachable enemy, check other enemies only if they are closer)
Improvements:
- regen boosters now less cheating as they cause damage to max health, if you healed 40 HP with regen booster, you will lose in average 20 max HP and will have to restore them later with doctor
- auto refill canteens if no hostile enemy in sector (less micromanagement)
- AI always successfully unjams guns
- Camo faces for Monk, Shadow and Tex (feature from VR code)
- added r7745: pre-placed bombs (action items with an explosive) can now be blown up by explosives, this allows clearing mine fields with grenades for example
- disabled taunts for collapsed soldiers
- if soldier is unconscious, he can't see anything
- garotte should be used on head only, also check AI knowledge instead of LOS test
Covert feature:
- soldiers are not allowed to carry drugs in inventory (unlike civilians)
- if a merc intentionally removes the diguise property via the [Ctrl] + [.] menu, the disguise property will not be reapplied until new clothes are applied
- suspicion counter overhaul (will be described later in detail)
My experience with defensive is they won't fight even when attacked. They just hide, or try to hide.
Defensive soldier will shoot if he sees enemy, if he doesn't shoot it's a bug.
But he will not advance to enemy usually.
I want some enemy roles to play more defensively, if this approach will not work well, it's possible to use another way.
edmortimer wrote on Mon, 16 May 2016 01:14
Even when not wearing camo? Why?
It's their 'feature' from original games, it's supposed that they have unique skills in camo and most players dislike new approach in 1.13 when these mercs lost their ability.
Though it's possible to make this change optional.
EDIT: they don'y just have always camo faces, they always have CAMO_KIT_USABLE_AREA % of wood camo that cannot be removed. But you can use any type of camo gear on them as on other mercs.
Messages:1533
Registered:January 2015 Location: Home Free
Quote:
I want some enemy roles to play more defensively, if this approach will not work well, it's possible to use another way.
I always use 'cunning solo' for the snipers, et al. It is perhaps better to make this optional because it over-rides what the modder has designed in the Map Editor when placing the enemy soldiers.
Quote:
It's their 'feature' from original games, it's supposed that they have unique skills in camo and most players dislike new approach in 1.13 when these mercs lost their ability.
Though it's possible to make this change optional.
I realize it was the 'feature' originally, and that some prefer to have it . . . I'm just in the other 'some' who prefer not to have magic camo. Perhaps it also should be optional.
I always use 'cunning solo' for the snipers, et al. It is perhaps better to make this optional because it over-rides what the modder has designed in the Map Editor when placing the enemy soldiers.
CUNNINGSOLO is bad for sniper, as he will start flanking. (though maybe it's good idea to disable flanking for certain enemy roles)
Sniper role means that soldier has long range sniper rifle with optics and MRK > 90 or sniper/marksman trait, so he should not flank or advance to enemy, instead he should hide and support his friends from distance.
The same for mortar guy.
Marksman is the guy who has long range rifle or assault rifle and scope or MRK > 90 or marksman trait, so he will be very effective shooting at enemy from distance. Marksman has his attitude changed BRAVESOLO->CONNINGSOLO and BRAVEAID->CUNNINGAID
Officer and Commander roles are determined by their skills, they usually also should stay behind to add leadership bonuses for their friends, though this part can be changed from attitude changing to AI morale or RangeChangeDesire modifier.
Quote:
I realize it was the 'feature' originally, and that some prefer to have it . . . I'm just in the other 'some' who prefer not to have magic camo. Perhaps it also should be optional.
This part can be made optional.
EDIT: new options in ja2_options.ini, both enabled by default in the code, add this section if you want to disable them
Messages:1533
Registered:January 2015 Location: Home Free
Quote:
CUNNINGSOLO is bad for sniper, as he will start flanking. (though maybe it's good idea to disable flanking for certain enemy roles)
What I've seen is that the enemy snipers will flank, and then snipe from the sides or rear -- which causes some havoc among my forces, especially when the main force is still advancing in the front.
However, I do understand where you're coming from with your intent. I just don't know if 'Defensive' works in game as you'd like it too. I'll test it out.
- if player selected "Loose Disguise" from Ctrl+dot menu, spy will not disguise automatically until clothes are reapplied
- default civilian clothes: white + blue/jean
- don't use enemy military colors for civilian clothes
- moved some limits for covert soldiers to suspicion counter
- garotte attack has effect only when attacking at head
Any soldier will be uncovered immediately when:
- suspicion counter is red
- suspicious animation is seen by enemy
- civilian spy doesn't look like a civilian (has camo or gun in hand or any not covert weapons or military gear)
- soldier spy doesn't look like a soldier (he carries a corpse)
- spy has serious bleeding
- spy is very close to a corpse (standing next to it)
Civilian spy will be uncovered when:
- in restricted area with curfew = 2 or underground
- in restricted area with curfew = 1 at night
- he has suppressed guns on him (if they are not placed in covert LBE)
Soldier spy will be uncovered when:
- soldier is targetting a buddy of observing enemy
- drunk/under drugs soldier is standing next to enemy who sees him
- soldier's equipment is too good (close inspection can be performed only by officers of this or higher type, so elite officer can check any spy, army officer can only check army spy or admin spy etc...)
- soldier is using flashlight at night and alert is raised
All other conditions are moved to suspicion counter:
basic value is 1..5 depending on the level of enemy soldier
+1 for each squadleader skill of enemy soldier
+1 if spy is using flashlight
+1 if spy is bleeding
+1 if spy is drunk or under drugs
+2 if enemy is alerted
+2 if enemy is in combat (seen enemy recently or under attack)
+2 in capital (Meduna)
Total: 1..16 for each enemy observing our soldier
*2 if spy is running or crawling or swatting
*2 if when disguising as soldier
/2 if spy has covert skill, for each level of covert skill
/2 if spy has no covert skills but he is special NPC (native)
if observer is drunk, he is less suspicious (up to 75% penalty at max drunk level)
if observing soldier is farther than day vision range /4, value is reduced accordingly, so at full day visoin range value will be divided by 4
Finally, all suspicion values from observing soldiers are added, and then total value is multiplied by amount of spent APs and added to merc's suspicion counter.
Maximum value for merc's suspicion counter is 100 * AP_MAXIMUM, this means:
100 turns in turnbased being observed by low level enemy close without additional modifiers
50 turns in the same situation but with 2 observing enemies
25 turns if spy is disguised as soldier
etc...
Also, soldier's attitude now can be changed depending on his role for better AI effectiveness:
Commanders and Mortar Operators are always DEFENSIVE
Sniper: BRAVEAID->CUNNINGAID, BRAVESOLO->CUNNINGSOLO, AGGRESSIVE->DEFENSIVE
Officer, Marksman: BRAVEAID->CUNNINGAID, BRAVESOLO->CUNNINGSOLO
Machinegunner: BRAVEAID, BRAVESOLO -> AGGRESSIVE
Also, some enemy roles will not try to flank: Commander, Sniper, Machinegunner, Mortar Operator
Recommended options:
TAUNT_SEEK_NOISE_CHANCE =0 in Taunts_Settings.INI (disable annoying taunts when playing covert)
SHOW_ENEMY_RANK_ICON = 1 in Ja2_Options.INI (show enemy role icon, useful to avoid contact with enemy officers)
The following options in Skills_Setting.ini have no effect in this release:
; if an enemy gets closer than this, he will inspect your equipment much more thorough
COVERT_CLOSE_DETECTION_RANGE = 10
; if disguised as a soldier, we will still be caught if we are this close to a fresh corpse
COVERT_CLOSE_DETECTION_RANGE_SOLDIER_CORPSE = 5
; elite soldiers can uncover even perfectly disguised spies if standing next to them and more expericenced
; this only works on soldier disguises, levels in this trait require the elite to be more experienced to uncover the spy
COVERT_ELITES_DETECT_NEXTTILE = TRUE
Notice it becomes hard to stay covert when red alert is raised - enemy becomes more suspicious and lots of enemies come to see what happens, have to find a good place to hide to lower suspicion counter.
Also, now AI officers will randomly decide to 'inspect' covert soldier/civilian, they will come close to him and randomly call friends (yellow alert).
This simple mission wasn't easy even with using a cheating trick - arm explosives with remote detonators in inventory and drop them later.
Updated feature: Attached explosives
- can attach rubber band to any grenade
- if there's rubber band attached, allow attaching another grenade
- can attach duct tape to any explosives
- can attach any explosives to duct tape
- can attach any tripwire activated item to tripwire
- use buddy item to define special attachments (like gas can, alcohol bottle or marbles)
Cover system update:
- always uncover when spy is standing near armed bomb
AI:
- raise alert if found armed bomb
- avoid going too close to seen armed bombs
- run away if we see armed bomb nearby
- avoid tiles near seen armed bombs when searchng for cover spot
- avoid going too close to seen armed bombs when planning random patrol
Fix:
- don't allow max repair threshold less than current object status when loading items from map
Taunts update:
- TAUNT_INFORM_ABOUT (check that this opponent is really new)
- TAUNT_ALERT (say taunt only when red alert raised, if it's no initial alert, use TAUNT_INFORM_ABOUT instead)
- TAUNT_SUSPICIOUS (only when yellow alert is raised)
for all attachments you want to use with this feature - grenades, explosives, duct tape, rubber band, string, gas can, alcohol bottle and marbles.
To use some items as special explosive attachments, define buddy item for them, for example, in stock 1.13 define
<buddyitem>1703</buddyitem>
for gas tank, then if you attach gas tank to TNT, explosive item will be activated to simulate gas explosion when this TNT will blow up.
For marbles, add
<buddyitem>1704</buddyitem>
to use it as added fragments to any explosion.
For alcohol bottle, add
<buddyitem>979</buddyitem>
to use molotov fire explosion.
Any attached explosive should have volatility > 0 to be activated, also main item should be of normal explosion type (tripwaire activated items attached to tripwire don't need this as they use tripwire activation instead of detonation)/ If you attach mk2 grenade to gas grenade, it will not blow up.
I can't view the video at work, so this might already be explained there, but how do these AI changes work in regards to armed bombs work with minefields, especially still visible bombs, like claymores?
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
I can't view the video at work, so this might already be explained there, but how do these AI changes work in regards to armed bombs work with minefields, especially still visible bombs, like claymores?
AI only checks visible bombs that have attached timed or remote detonators, see code:
- allow throwing grenades at targets someone else sees
- avoid water/gas update
- max flanking distance = vision range + max tiles moved per turn
- watched locations: check personal/public knowledge
- help friends: check public knowledge
- fix: bVisible check
- all interrupts not for player team start as hidden
- MinAPsToPunch fix: allow correct calculation when no target gridno supplied
- use camo/stealth palette at 90+ level of camo/stealth
- allow interrupts on door opening
- buildings: correctly set building info
- more climbing points for buildings on small maps
- improved r8104 fix to allow Fatima quest, added safety checks
Small AI fixes and improvements:
- decide aiming location when shooting or stabbing depending on cth, distance to target and other factors
- AI will aim at head more often when shooting at zombies
- AI will aim at legs more often when using burst fire in NCTH at distance
- limit search range when deciding random patrols or visiting friends in GREEN to reduce CPU load and make enemy green behaviour more realistic
- reduce chance to climb on roof, start new random patrol or visit friend if soldier is wounded or has low breath
Zombie AI reworked and simplified, should work faster with less bugs now:
- zombie will always go to nearest known enemy
- if zombie doesn't know enemy location, it will move to closest friend who knows
- zombies don't do anything that humans do like starting patrol routes or using radio etc, they just roam here and there if not alerted, and attack closest enemy if they see or hear him
- no flanking or hiding or other complex AI for zombies
- added some safety checks for zombies to prevent possible problems - if enemy is on the roof and zombie cannot climb, this enemy will be skipped to avoid AI loop
- zombies always have highest AI morale
Small fixes and AI improvements:
- fixed critical bug that caused crash when soldier tried to pick up item.
- fix: wrong variable used in TerrainBreathPoints
- r8235 fix: after firing an underbarrel GL, it was possible to reload via leftclick for a short time, leading to reload of main gun with a grenade
- FindSoldierByProfileID fix: correctly check last soldier in player team
- DeductPoints, ResolvePendingInterrupt, StartInterrupt: MAX_NUM_SOLDIERS fix
- Drop/pick up backpacks - added check for DropPackFlag, only current squad will drop backpacks, added message for successful drop/pick up
- RandDestWithinRange - removed room limit when alert is not raised
- RED seek, hide: check AI morale < 4 when aborting seek because of dangerous spot
- FindFlankingSpot: avoid locations with fresh corpses
Some fixes and improvements:
- stop cowering animation when new turn starts and soldier has not enough shock for cowering (disable for neutral)
- soldier's damaged by a blast always receive at least 1 damage, even if damage calculation results in 0
- obliterating sector kills tanks
- BASIC_DEPRECIATE_CHANCE = 45
- MinAPsToShootOrStab: add unjam AP cost
- MinAPsToPunch: check enemy only if we have correct gridNo
- Interface Panels: added missing UnloadButtonImage( iBurstButtonImages[ WM_AUTOFIRE ] );
- vehicle is visible if any part of it is visible
- r8206 fix: jumping over a merc allowed moving through walls
- don't use kick animation when attacking with weapon
- less damage to tanks from bullets
- stealing: don't turn to attacker when lying prone
- fix: GetDrunkLevel
- disabled taunts for collapsed soldiers
- garotte should be used on head only
- if soldier is unconscious, he can't see anything
- Taunts update:
TAUNT_INFORM_ABOUT (check that this opponent is really new)
TAUNT_ALERT (say taunt only when red alert raised, if it's no initial alert, use TAUNT_INFORM_ABOUT instead)
TAUNT_SUSPICIOUS (only when yellow alert is raised)
- skip gas if not in gas already
- World Items: don't allow max repair threshold less than current object status
- use camo/stealth palette at 90+ level of camo/stealth
- fix: bVisible check
- all interrupts for all teams except player team start as hidden
- don't show hidden interrupts
- buildings: correctly set building info
- localizations: recommend user to use arrows to scroll map when deploying squad
- improved r8104 fix, added safety checks
- SearchForItems: divide by 0 fix
- fix: wrong variable used in TerrainBreathPoints
- r8235 fix: after firing an underbarrel GL, it was possible to reload via leftclick for a short time, leading to reload of main gun with a grenade
- FindSoldierByProfileID fix: check last soldier in player team
- DeductPoints, ResolvePendingInterrupt, StartInterrupt: MAX_NUM_SOLDIERS fix
- RenderOverheadOverlays: use last soldier in player team
- drop/pick up backpacks - added check for DropPackFlag, only current squad will drop backpacks, added message for successful drop/pick up
Changes:
- Ctrl+D - skip interrupts for this merc only
- Ctrl+Alt+D - skip interrupts for player team
- allow interrupt if soldier is under fire
- don't allow interrupt if shock level percent > 50
- flanking: allow 1/2 of mercs to flank
- RandDestWithinRange: don't go too far from closest not SEEKENEMY friend if alert is not raised yet
- FindBestNearbyCover: correctly calculate AP cost
- ZombieDecideActionRed: deep water check
- AllowedAimingLevels: limit aim levels depending on distance
AI update:
DetermineMovementMode:
- night crawling
- getting closer
- crawling when taking cover
- crawling for snipers on roofs
Attacks:
- allow suppression fire on recently heard opponents
- dying or unconscious soldiers have low priority
RED sniper:
- show "Sniper!" message only for real snipers
BLACK:
- chance to stop shooting with high friendly fire chance
- reserve APs to hide after shot when in dangerous place
- skip autofire completely if have big chance of friendly fire
- allow getting closer before shooting for RCD >= 3
Bug fixes:
- r8247 fix: AimLevels bonus was displayed for OCTH although it doesn't apply there
- HandleSnitchExposition: wrong check
- HourlySnitchUpdate: NUM_PROFILES limit
- Lua IniFunction: assignment instead of check
- l_SetGlobalLuaBool: gLuaGlobal[] 1000 limit
- RemoveMPButtonsForMapScreen: MAX_MP_BUTTONS limit
- StrategicHandleQueenLosingControlOfSector: MAP_WORLD_X * MAP_WORLD_Y limit
- LightCreateOmni: check LightGetFree return value
- LightCreateSquare: check LightGetFree return value
- LightCreateElliptical: check LightGetFree return value
- LightLoad: check LightGetFree return value
- LightSpriteCreate: check LightSpriteGetFree return value
- WrapString: fixed '/0' char
- DrawSecondaryStats: wrong || operator
- gItemDescGenSecondaryRegions: increased size to 36
- FindLegalGrenade: MAXITEMS limit
- ValidItemAttachmentSlot: MAXATTACHMENTS limit
- SwapLarrysProfiles: wrong assignment
- CalcChanceToHitGun: correctly check target level for cowering penalty
Messages:1533
Registered:January 2015 Location: Home Free
Thank you for your work! Is it possible to check Snitch abilities of prevention of bad behaviour and of not reporting? They don't ever work for me -- I can't get the snitches to shut up at midnight, or to prevent scrounging.
Is it possible to check Snitch abilities of prevention of bad behaviour and of not reporting? They don't ever work for me -- I can't get the snitches to shut up at midnight, or to prevent scrounging.
Never tested snitch feature, will take a look someday :-)
Mostly fixes, also some improvements to Watched Locations system:
Removed option: AI_SHOW_RED_DECISION
LuaTacticalSetup fix: TOTAL_SOLDIERS check
Watched locations:
- DecayIndividualOpplist fix: MAX_NUM_SOLDIERS limit
- FindWatchedLoc: check reachable adjacent tiles
- WatchedLocLocationIsEmpty: check that noone from team sees watched tiles
GetUniformType fix: NUM_UNIFORMS limit
SeemsLegit: check for damaged clothes
RandDestWithinRange: check for doors only at level 0
ClosestReachableDisturbance: also consider inspecting watched locations
CalcMorale:
- neutrals always have low AI morale even if they have weapons (so they run from enemy)
- bonus if last target is unconscious or suppressed
DecideAction: new debug information
Main RED AI: don't go prone when watching (to prevent endless turning)
FindBestNearbyCover: path cost fix
Strategic enemy detection:
- UpdateStrategicDetectionLevel fix: detect enemy movement direction using assignments
- scouts can detect enemy direction
- ScoutIsPresentInSquad fix: allow scouting only if soldier is not in a vehicle, not sleeping and not on assignment
- Skyrider can detect enemy direction when flying over sector with enemy
More realistic clothes:
- disguise/lose disguise in [Ctrl]+[.] menu
- [Ctrl]+[.] menu will show if merc has damaged vest/pants
- cannot 'wear off' clothes, only replace them with other color (we dont't have naked Fox animation anyway)
- fix: lose disguise every time we apply clothes
- fix: lose disguise when vest/pants are damaged
- don't disguise automatically when applying clothes, instead use menu (this will also turn on automatic disguise mode)
- don't need new clothes to disguise, only check that they have correct color and not damaged
Other fixes:
- StartCivQuote fix: uninitialized ubCivQuoteID2
Changes:
- r8236 Fix: corpses on a roof cannot be interacted with (by Flugente)
- added optional roof destruction feature (by Flugente) (set ROOF_COLLAPSE = TRUE in [Extended Options] section in ja2_options.ini)
- other small fixes