Re: Code Snippets[message #332754]
|
Sat, 17 May 2014 23:06 ![Go to previous message Go to previous message](/theme/Bear_Classic_Brown/images/up.png)
|
|
Deleted. |
![](/images/ranks/liutenant.png) |
Messages:2656
Registered:December 2012 Location: Russian Federation |
|
|
@rummtata
You can turn off tooltips at any time using Shift+D
[Updated on: Mon, 09 March 2015 16:30] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Code Snippets[message #343363 is a reply to message #342101]
|
Sun, 29 November 2015 21:07 ![Go to previous message Go to previous message](/theme/Bear_Classic_Brown/images/up.png)
|
|
Deleted. |
![](/images/ranks/liutenant.png) |
Messages:2656
Registered:December 2012 Location: Russian Federation |
|
|
Tactical\opplist.cpp
INT8 FindUnusedWatchedLoc( UINT8 ubID )
{
INT8 bLoop;
for ( bLoop = 0; bLoop < NUM_WATCHED_LOCS; bLoop++ )
{
// WANNE: I think this was a bug, should be != NOWHERE!
//if ( gsWatchedLoc[ ubID ][ bLoop ] == NOWHERE )
if (!TileIsOutOfBounds(gsWatchedLoc[ ubID ][ bLoop ]))
{
return( bLoop );
}
}
return( -1 );
}
I think this 'fix' is wrong and prevents game from using "Watched Locations" system completely.
gsWatchedLoc array is initialized with NOWHERE values
// initialize public last known locations for all teams
for (cnt = 0; cnt < MAX_NUM_SOLDIERS; cnt++)
{
for (cnt2 = 0; cnt2 < NUM_WATCHED_LOCS; cnt2++ )
{
gsWatchedLoc[ cnt ][ cnt2 ] = NOWHERE;
gubWatchedLocPoints[ cnt ][ cnt2 ] = 0;
gfWatchedLocReset[ cnt ][ cnt2 ] = FALSE;
}
}
So if we want to find unused location, we search for NOWHERE value.
[Updated on: Sun, 29 November 2015 21:53]
Left this community.Report message to a moderator
|
|
|
|
Re: Code Snippets[message #343511 is a reply to message #343363]
|
Sat, 19 December 2015 15:12 ![Go to previous message Go to previous message](/theme/Bear_Classic_Brown/images/up.png)
|
|
Deleted. |
![](/images/ranks/liutenant.png) |
Messages:2656
Registered:December 2012 Location: Russian Federation |
|
|
Some AI/tactical fixes and improvements
Bugfixes:
Fix: Watched Locations system (never worked in 1.13)
Fix: LineOfSight test with NO_DISTANCE_LIMIT (stopped on trees previously)
AI/tactical improvements:
- EstimateThrowDamage additionally calculates damage from fragments (important for AI to use frag grenades with low main damage and many fragments)
- EstimateThrowDamage correctly adds IndoorModifier
- Additional checks for RED suppression (check that the soldier will not shoot his friends, check that he has extra clip to reload weapon, check that target is not cowering, don't suppress when flanking)
- ClosestReachableDisturbance will use general noise only if cannot find any enemy
- Allow RED seeking in prone stance if we haven't seen enemy for several turns
Flanking improvements:
- allow YELLOW flanking for CLOSEPATROL at night
- better YELLOW/RED flanking start/stop conditions
- better RED AI behavior when finished flanking (try to reach flanking spot)
- allow RED flanking for CLOSEPATROL soldiers when at night, overcrowded or no other flanking soldiers yet
Optional AI improvements:
AI_EXTRA_SUPPRESSION
AI will use suppression fire more often in RED state (set minimum AI CTH to 1)
AI_NEW_MORALE
Better dynamic morale calculation depending on tactical situation.
Additional min/max limits for AI morale
Disabled HOPELESS morale for soldiers without guns (they can pick up weapon or attack with hands sometimes)
AI_BETTER_COVER
Additional checks for line of sight, fresh corpses and overcrowded locations
AI_EXTRA_FLANKING
Allow flanking for BRAVEAID/BRAVESOLO
source 8005 patch
gamedir 2274 patch
[Updated on: Sat, 19 December 2015 15:32]
Left this community.Report message to a moderator
|
|
|
|
|
|
|
Re: Code Snippets[message #343917 is a reply to message #343916]
|
Sun, 31 January 2016 17:29 ![Go to previous message Go to previous message](/theme/Bear_Classic_Brown/images/up.png)
|
|
Flugente |
![](/images/ranks/captain.png) |
Messages:3507
Registered:April 2009 Location: Germany |
|
|
Good catch! Committed in r8046.
[Updated on: Sun, 31 January 2016 17:29]
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.Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Code Snippets[message #345165 is a reply to message #345154]
|
Sat, 23 April 2016 17:29 ![Go to previous message Go to previous message](/theme/Bear_Classic_Brown/images/up.png)
|
|
Flugente |
![](/images/ranks/captain.png) |
Messages:3507
Registered:April 2009 Location: Germany |
|
|
sevenfm wrote on Fri, 22 April 2016 12:53In Soldier Init List.cpp:
// we simply look for a entry point inside a bigger circle, but not inside the merc deployment zone.
INT32 bettergridno = NOWHERE;
UINT16 counter = 0;
UINT8 ubDirection = DIRECTION_IRRELEVANT;
while ( counter < 100 && (bettergridno == NOWHERE || PythSpacesAway( bettergridno, gMapInformation.sCenterGridNo ) <= gAmbushRadiusModifier * gGameExternalOptions.usAmbushEnemyEncircleRadius1) )
{
bettergridno = FindRandomGridNoBetweenCircles( gMapInformation.sCenterGridNo, gAmbushRadiusModifier * gGameExternalOptions.usAmbushEnemyEncircleRadius1, gAmbushRadiusModifier * gGameExternalOptions.usAmbushEnemyEncircleRadius2, ubDirection );
}
if ( bettergridno != NOWHERE )
{
tempDetailedPlacement.sInsertionGridNo = bettergridno;
// have the soldier look inward. We add + 100 because later on we use this to signify that we want really enforce this direction
tempDetailedPlacement.ubDirection = (UINT8)GetDirectionToGridNoFromGridNo( tempDetailedPlacement.sInsertionGridNo, gMapInformation.sCenterGridNo ) + 100;
}
The counter variable is added probably to prevent endless loop, but it's never incremented.
Hu. Good spot. Fixed in r8169.
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.Report message to a moderator
|
|
|
|
|
|
|
|