Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New Feature: Tracking
New Feature: Tracking[message #337545] Tue, 04 November 2014 21:56 Go to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
New Feature: Tracking

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.

[Updated on: Fri, 01 May 2015 11:58]

Report message to a moderator

Captain

Re: New Feature: Tracking[message #337548] Tue, 04 November 2014 22:32 Go to previous messageGo to next message
Deleted.

 
Messages:2663
Registered:December 2012
Location: Russian Federation
When I found smell lines in the code I thought about something like:

Toggle Spoiler

Report message to a moderator

Lieutenant

Re: New Feature: Tracking[message #337549] Wed, 05 November 2014 00:13 Go to previous messageGo to next message
grim is currently offline grim

 
Messages:344
Registered:July 2006
Location: France
Let's go hunting!

Report message to a moderator

Master Sergeant
Re: New Feature: Tracking[message #337583] Thu, 06 November 2014 00:55 Go to previous messageGo to next message
Kirill_OverK is currently offline Kirill_OverK

 
Messages:257
Registered:September 2010
good news for military dogs !!


---
AI can use this skills for better player find ?

Report message to a moderator

Master Sergeant
Re: New Feature: Tracking[message #337586] Thu, 06 November 2014 02:39 Go to previous messageGo to next message
M16AMachinegun is currently offline M16AMachinegun

 
Messages:304
Registered:September 2013
Flugente, stop making new stuff so i can play through this damn game! I've fought through Omerta so many times now! aaaaaaaaarg! ROFL

Report message to a moderator

Master Sergeant
Re: New Feature: Tracking[message #337592] Thu, 06 November 2014 14:55 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
M16AMachinegun
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):

Report message to a moderator

Captain

Re: New Feature: Tracking[message #337686] Tue, 11 November 2014 02:42 Go to previous messageGo to next message
Ocular

 
Messages:24
Registered:September 2014
Hiya Flugente, great feature!

I have a bug report:

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.

Trivial patch follows. Thanks!

Index: Build/Tactical/Soldier Control.cpp
===================================================================
--- Build/Tactical/Soldier Control.cpp  (revision 7650)
+++ Build/Tactical/Soldier Control.cpp  (working copy)
@@ -17432,7 +17432,7 @@
 
        if ( this->bInSector && this->bTeam == gbPlayerNum && !this->bCollapsed )
        {
-               DisplayCover( TRUE );
+               DisplayCover( FALSE );
        }
 }
 



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

Report message to a moderator

Private 1st Class
Re: New Feature: Tracking[message #337688] Tue, 11 November 2014 13:04 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
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

Report message to a moderator

Captain

Re: New Feature: Tracking[message #337969] Tue, 25 November 2014 02:58 Go to previous messageGo to next message
JohnnySideburns

 
Messages:19
Registered:September 2007
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.

Report message to a moderator

Private
Re: New Feature: Tracking[message #337975] Tue, 25 November 2014 13:00 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
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).

Report message to a moderator

Captain

Re: New Feature: Tracking[message #337986] Tue, 25 November 2014 23:30 Go to previous message
Kirill_OverK is currently offline Kirill_OverK

 
Messages:257
Registered:September 2010
may be use numbers, no color .. ?

Report message to a moderator

Master Sergeant
Previous Topic: Zombies! WH40K! and more.
Next Topic: New Feature: Helicopter drops anywhere
Goto Forum:
  


Current Time: Fri Mar 29 09:24:27 GMT+2 2024

Total time taken to generate the page: 0.01055 seconds