While digging through the code untouched by man for several years, one sometimes stumbles upon interesting things. One such things is that people stink. Wherever a character steps, he marks this region with his smell (no, really). This is then used by bloodcats and crepitus to track their prey. Not that they do that a lot...
I've decided to use this for something else. I hereby redefine these marks as 'tracks'. Mercs with the Ranger trait or a specific background can now read these tracks (think of those old Wild West adventures where the Indians could read the tracks the bad guys made). If your currently selected merc has that ability, you will see these tracks:
As seen in the video, you can activate and deactivate this via calling the Overlay menu with [Ctrl] + [c].
Tracks decay over time from green to yellow, then to orange, and then they disappear.
Blood is also shown and with a higher priority. So you can actually track an enemy by the blood he spills while running away from you. It is, however, erased very fast for internal coding reasons.
There is no differentiation between your team and the enemy team, or between human and creature (there is codewise, but lets make this as easy as possible).
Tracks on roofs, in water, on paved roads and building floors are not shown. They exist, but I just decide not too. Most boots don't leave marks in concrete.
AI rangers will pay no heed to this.
Ranger settings in Skills_Settings.ini:
; Rangers can look out for tracks of people. This can be activated in the [Ctrl] + [C] menu.
; This is the maximum range at which one can spot tracks.
TRACKER_MAX_RANGE = 30
; per level of the trait, we can spot tracks at up to TRACKER_ABILITY % of TRACKER_MAX_RANGE. Values from 0 to 50, default 30.
TRACKER_ABILITY = 30
New background tag in Backgrounds.xml:
<tracker_ability>0</tracker_ability> <!-- +- % range on tracking ability, see [Ranger] in Skills_Settings.ini, 0 to 40 -->
This background was added to a few merc's backgrounds. This does stack with the Ranger trait.
Does not break savegame compatibility.
No, this will not go into any 2014 stable release patches.
This has been added to the trunk in r7646 and GameDir r2178.
Flugente, stop making new stuff so i can play through this damn game! I've fought through Omerta so many times now! aaaaaaaaarg! ROFL
Great to hear! I have no intention of doing so :angel:
This feature is very small, and does not affect savegame compatibility - you can simply update the exe and continue a campaign. I always state that on my features. If I remember correctly, the last hard break to savegame compatibility was in r6070. Provided you update GameDir data as well when updating your exe, you should be fine (this requires at some knowledge in using the SVN log though):
The tracking patch introduces very large periodic CPU spikes due to a large number of sudden successive cover display calculations when in COVER_DRAW_MERC_VIEW, or in another expensive cover view.
AFAICT, this is because SOLDIERTYPE::SoldierPropertyUpkeep() is triggered a large number of times in a row about every ~3 seconds, forcing a cover recalculation each time due to the call to DisplayCover( TRUE ).
While I think that the periodic runs of SoldierPropertyUpkeep() is probably a bug worth investigating, calling DisplayCover() with the forceUpdate parameter to TRUE causes the expensive cover calculation to be recalculated before an interval of COVER_SYSTEM_UPDATE_DELAY has passed.
Calling DisplayCover( FALSE ) fixes this issue, and relieves the problem somewhat. There are still CPU spikes during cover display, but this fix at least addresses this performance regression.
Oh, one last thing, since I notice you are attempting to clean up some of the craziness in the code.
The signature of DisplayCover() is:
void DisplayCover( const BOOLEAN& forceUpdate )
There is no reason to pass a "const BOOLEAN&" when a simple BOOLEAN would do!
EDIT:
I just realized that there should not really be any reason to call DisplayCover() at all, since cover redisplay is handled by another game loop. Removing that if-block entirely has no apparent effect on the tracker display or any other cover display:
Index: Build/Tactical/Soldier Control.cpp
===================================================================
--- Build/Tactical/Soldier Control.cpp (revision 7650)
+++ Build/Tactical/Soldier Control.cpp (working copy)
@@ -17429,11 +17429,6 @@
{
this->usSoldierFlagMask &= ~SOLDIER_BATTLE_PARTICIPATION;
}
-
- if ( this->bInSector && this->bTeam == gbPlayerNum && !this->bCollapsed )
- {
- DisplayCover( TRUE );
- }
}
// check if Soldier can use the spell skillwise, with fAPCheck = TRUE also check current APs
[Updated on: Tue, 11 November 2014 03:51] by Moderator
Yeah, the DisplayCover-signature is an old relic I didn't alter. The deleted check would likely also benefit from checking whether this->ubID == gusSelectedSoldier, but perhaps deleting works best. I'll check it in the evening, thanks!
Edit: Committed in r7651.
[Updated on: Tue, 11 November 2014 21:27] by Moderator
Great feature! Just spit-balling here, but can the graphics for the trail be altered? to for instance be exchanged with those foot steps that track where you move in turn based? Just thinking it could look cool if the tracks looked like well you know tracks. sorry for being inconvenient or ungrateful, just asking is all.
They could, but not easily. Not sure whether coloured foot steps would even be possible (internal reasons) (I want colour, as this is an easy way to display the 'age' of a trail).