Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLTV Director Module issue #1064

Open
kekusprod opened this issue Nov 16, 2024 · 0 comments
Open

HLTV Director Module issue #1064

kekusprod opened this issue Nov 16, 2024 · 0 comments

Comments

@kekusprod
Copy link

kekusprod commented Nov 16, 2024

Hello everyone! I have an issue using Auto-Director feature from HLTV. It working fine except it selects players which will be dead in few seconds. In other words, no first-person kills were shown so far, only deaths. Digging thru source code of Director module gave no result, except theres an FindBestEvent() function which is choosing best event to capture using DRC_FLAG_PRIO_MASK define and BestEvent[] BestEventPrio[] ints

Director::worldHistory_t *Director::FindBestEvent()
{
	const int MAX_BEST_EVENT = 4;
	int i;
	int nseqMod = m_nextCutSeqnr % m_historyLength;
	int bestEvent[MAX_BEST_EVENT] = { 0, 0, 0, 0 };
	int bestEventPrio[MAX_BEST_EVENT] = { 0, 0, 0, 0 };

	for (i = 0; i < MAX_BEST_EVENT; i++)
	{
		bestEventPrio[i] = 0;
		bestEvent[i] = 0;

		float tillTime = (i + 1) * 2 + m_nextCutTime;
		while (tillTime > m_history[nseqMod].time)
		{
			if ((m_history[nseqMod].event.flags & DRC_FLAG_PRIO_MASK) > (unsigned int)bestEventPrio[i]) {
				bestEventPrio[i] = (m_history[nseqMod].event.flags & DRC_FLAG_PRIO_MASK);
				bestEvent[i] = nseqMod;
			}

			if (++nseqMod == m_historyLength) {
				nseqMod = 0;
			}
		}
	}

	if (bestEventPrio[0] || bestEventPrio[1] || bestEventPrio[2])
	{
		if (bestEventPrio[1] >= bestEventPrio[0]
			&& bestEventPrio[1] >= bestEventPrio[2]
			&& bestEventPrio[1] >= bestEventPrio[3]) {
			return &m_history[ bestEvent[1] ];
		}

		else if (bestEventPrio[0] > bestEventPrio[1]
			&& bestEventPrio[0] > bestEventPrio[2]) {
			return &m_history[ bestEvent[0] ];
		}

		else if (bestEventPrio[2] > bestEventPrio[3]) {
			return &m_history[ bestEvent[2] ];
		}

		if (bestEventPrio[0]) {
			return &m_history[ bestEvent[0] ];
		}
	}

	return nullptr;
}

But found nothing about masks itself, how these priorites are given.
Had 3 different versions of Director.dll, but they all have same problem
Also, in Director.h there are some includes

#include <HLTV/IProxy.h>
#include <HLTV/IWorld.h>
#include <HLTV/IDirector.h>

but noone of them exist
Also had some discuss with Sergey, he said that in CS flag is set in CHalfLifeMultiplay:PlayerKilled() but only for pVictim->m_bIsVIP
So. I want to exclude Death event from FindBestEvent function, or give lower priority to it.
Please help!

SERVERSIDE:

ReHLDS built from master branch
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 21:59:05 Nov 15 2024 (3870)
Metamod-r v1.3.0.0, API (5:13)
Metamod-r build: 23:27:47 Nov 15 2024
Metamod-r from: /commits/
AMX Mod X version 1.10.0.5467
ReGameDLL version: 5.28.0.0-dev
YaPB v4.5.1121
       id  name                    version     author            url                              file         status   
 [  1] 0   Admin Base              1.10.0.546  AMXX Dev Team                                      admin.amxx   running  
 [  2] 1   Admin Commands          1.10.0.546  AMXX Dev Team                                      admincmd.am  running  
 [  3] 2   Admin Help              1.10.0.546  AMXX Dev Team                                      adminhelp.a  running  
 [  4] 3   Slots Reservation       1.10.0.546  AMXX Dev Team                                      adminslots.  running  
 [  5] 4   Multi-Lingual System    1.10.0.546  AMXX Dev Team                                      multilingua  running  
 [  6] 5   Menus Front-End         1.10.0.546  AMXX Dev Team                                      menufront.a  running  
 [  7] 6   Commands Menu           1.10.0.546  AMXX Dev Team                                      cmdmenu.amx  running  
 [  8] 7   Players Menu            1.10.0.546  AMXX Dev Team                                      plmenu.amxx  running  
 [  9] 8   Maps Menu               1.10.0.546  AMXX Dev Team                                      mapsmenu.am  running  
 [ 10] 9   Plugin Menu             1.10.0.546  AMXX Dev Team                                      pluginmenu.  running  
 [ 11] 10  Admin Chat              1.10.0.546  AMXX Dev Team                                      adminchat.a  running  
 [ 12] 11  Anti Flood              1.10.0.546  AMXX Dev Team                                      antiflood.a  running  
 [ 13] 12  Scrolling Message       1.10.0.546  AMXX Dev Team                                      scrollmsg.a  running  
 [ 14] 13  Info. Messages          1.10.0.546  AMXX Dev Team                                      imessage.am  running  
 [ 15] 14  Admin Votes             1.10.0.546  AMXX Dev Team                                      adminvote.a  running  
 [ 16] 15  NextMap                 1.10.0.546  AMXX Dev Team                                      nextmap.amx  running  
 [ 17] 16  Nextmap Chooser         1.10.0.546  AMXX Dev Team                                      mapchooser.  running  
 [ 18] 17  TimeLeft                1.10.0.546  AMXX Dev Team                                      timeleft.am  running  
 [ 19] 18  Pause Plugins           1.10.0.546  AMXX Dev Team                                      pausecfg.am  running  
 [ 20] 19  Stats Configuration     1.10.0.546  AMXX Dev Team                                      statscfg.am  running  
 [ 21] 20  StatsX                  1.10.0.546  AMXX Dev Team                                      statsx.amxx  running  
 [ 22] 21  Player Info Logger      1.0         kekusprod          unknown                          KEKUSMATCH2  running  
 [ 23] 22  Player Data Logger      1.0         kekusprod                                          kekusloggin  debug    
 [ 24] 23  Event bomb planting     1.0         kekusprod                                              kekusdefuse  running  
 [ 25] 24  ReDeathmatch            1.0.0-b11   Sergey Shorokhov                                   ReDeathmatc  debug    
 [ 26] 25  ReDM: Spawns manager    1.0.0-b11   Sergey Shorokhov                                   redm_spawns  debug 

HLTV and Director.dll:
Built from master ReHLDS branch

Os: Windows 22H2 (19045.4780)

Video
cshltv.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant