FPS/Ping & More FOV Codes
#1

Hi, how are you, in the pwesty forum (fagot I donated money to you in vain) they had posted the code to be able to see the ping and fps under the radar, does anyone have it? I also think I remember a post about how to increase the FOV, I don't remember If it was changing a value in the ps.dat or editing the client's own source code, someone who can at least instruct me regarding those 2 issues?...

#2


12 hours ago, nicolasg said:




Hi, how are you, in the pwesty forum (fagot I donated money to you in vain) they had posted the code to be able to see the ping and fps under the radar, does anyone have it? I also think I remember a post about how to increase the FOV, I don't remember If it was changing a value in the ps.dat or editing the client's own source code, someone who can at least instruct me regarding those 2 issues?...




UIRadar.cpp
Search :

Line 534

pDrawPort->PutTextExCX( strServerInfo, m_nPosX +this->GetWidth()/2 + 50, m_nLocalTimeY + 17, 0xFFA600FF );

add thins on line 535

// timer variables
#define FRAMES_AVERAGING_MAX 20L
static CTimerValue _tvLasts[FRAMES_AVERAGING_MAX];
static CTimerValue _tvDelta[FRAMES_AVERAGING_MAX];
static INDEX _iCheckNow = 0;
static INDEX _iCheckMax = 0;
#define FPS_LAST_CACHED 120
static INDEX _aiFPS[FPS_LAST_CACHED];
static INDEX _iStartingFPSIndex = 0;
static INDEX _iLastFPSOut = 0;
static INDEX hud_bShowClock = FALSE;
static INDEX hud_bShowNetGraph = FALSE;
static INDEX hud_bShowResolution = FALSE;
static INDEX hud_bShowPauseText = TRUE;
static INDEX dem_bOSD = FALSE;
static INDEX dem_bPlay = FALSE;
static INDEX dem_bPlayByName = FALSE;
static INDEX dem_bProfile = FALSE;
static INDEX dem_iProfileRate = 5;
static FLOAT dem_fMotionBlurStrength = 0.5f; // 0.1=min, 1=max
static CTString dem_strPostExec = "";
INDEX hud_iStats = 3;
static INDEX hud_iFPSGraphSpeed = 4;
static INDEX hud_iFPSGraphMax = 400;
static INDEX hud_bShowTime = FALSE;
// if required, print real time
if (hud_bShowClock) {
// set font, spacing and scale
// determine time
struct tm *newtime;
time_t long_time;
time(&long_time);
newtime = localtime(&long_time);
// printout
CTString strTime;
}
// clamp stat values
extern ENGINE_API INDEX _iStatsMode;
hud_iStats = Clamp(hud_iStats, 0L, 4L);
_iStatsMode = hud_iStats; // send it to engine
hud_iFPSGraphSpeed = Clamp(hud_iFPSGraphSpeed, 0L, 50L);
hud_iFPSGraphMax = Clamp(hud_iFPSGraphMax, 50L, 500L);
// calculate FPS
FLOAT fFPS = 0.0f;
_iCheckMax++;
if (_iCheckMax >= FRAMES_AVERAGING_MAX) {
for (INDEX i = 0; i<FRAMES_AVERAGING_MAX; i++) fFPS += _tvDelta[i].GetSeconds();
fFPS = FRAMES_AVERAGING_MAX*FRAMES_AVERAGING_MAX / fFPS;
_iCheckMax = FRAMES_AVERAGING_MAX;
}

// determine newest time
CTimerValue tvNow = _pTimer->GetHighPrecisionTimer();
_tvDelta[_iCheckNow] = tvNow - _tvLasts[_iCheckNow];
_tvLasts[_iCheckNow] = tvNow;
_iCheckNow = (_iCheckNow + 1) % FRAMES_AVERAGING_MAX;

// fill FPS graph
INDEX iTimeNow = tvNow.GetSeconds() * 2 * hud_iFPSGraphSpeed;
if (iTimeNow != _iLastFPSOut && iTimeNow % 2) {
_iStartingFPSIndex = (_iStartingFPSIndex + 1) % FPS_LAST_CACHED;
_aiFPS[_iStartingFPSIndex] = fFPS;
_iLastFPSOut = iTimeNow;
}

// set display interface (proportional) font
CTString strDebug;
strDebug = "";
// display colored FPS
COLOR colFPS = C_RED;
if (fFPS >= 20) colFPS = C_GREEN;
if (fFPS >= 60) colFPS = C_WHITE;
//if (fFPS < 10) pdpDrawPort->SetTextScaling(fTextScale*1.5); // enlarge output if FPS is extremely low
// prepare FPS string for printing
CTString strFPS = "?";
CTString strRomain = "?";
if (fFPS >= 30) strFPS.PrintF("%s%3.0f", (const char*)strDebug, fFPS);
else if (fFPS >= 0.1f) strFPS.PrintF("%s%3.1f", (const char*)strDebug, fFPS);
// printout FPS number (if allowed)
//pdpDrawPort->PutTextC(strFPS, slDPWidth*0.75f, slDPHeight*0.005f, colFPS | 192);
strRomain.PrintF("Arcania - FPS");
pDrawPort->PutTextExCX(strRomain, m_nPosX + this->GetWidth() / 2 + 50, m_nLocalTimeY + 34, 0xFFFFFFFF);
pDrawPort->PutTextExCX(strFPS, m_nPosX + this->GetWidth() / 2 + 50, m_nLocalTimeY + 54, 0x4BE100FF);

extern ENGINE_API INDEX cli_iCurrentFPS;
cli_iCurrentFPS = fFPS;
// display extensive statistics
CTString strReport;
// printout statistics
strFPS.PrintF( " frame =%3.0f ms\n---------------\n", 1000.0f/fFPS);
//pDrawPort->PutTextExCX(strFPS, 0, 30, C_WHITE | CT_OPAQUE, m_nPosX + this->GetWidth() / 2, m_nLocalTimeY + 48, 0x72D02EFF);
//pDrawPort->PutTextExCX(strReport, 4, 55, C_WHITE | CT_OPAQUE, m_nPosX + this->GetWidth() / 2, m_nLocalTimeY + 55, 0x72D02EFF);
if (!hud_bShowNetGraph)
{ // draw canvas
const INDEX iWidth = FPS_LAST_CACHED;
const INDEX iHeight = 60;
// calculate FPS
FLOAT fFPS = 0.0f;
_iCheckMax++;
if (_iCheckMax >= FRAMES_AVERAGING_MAX)
{
for (INDEX i = 0; i<FRAMES_AVERAGING_MAX; i++) fFPS += _tvDelta[i].GetSeconds();
fFPS = FRAMES_AVERAGING_MAX*FRAMES_AVERAGING_MAX / fFPS;
_iCheckMax = FRAMES_AVERAGING_MAX;
}

// draw graph lines
for (INDEX i = 0; i<FPS_LAST_CACHED; i++)
{
const INDEX iValue = ClampUp(_aiFPS[(i + _iStartingFPSIndex + 1) % FPS_LAST_CACHED], hud_iFPSGraphMax);
COLOR iCol = C_RED;
if (iValue>100) iCol = C_lBLUE;
if (iValue> 60) iCol = C_WHITE;
if (iValue> 20) iCol = C_GREEN;
const INDEX iNormalizedValue = ((FLOAT)iValue) / hud_iFPSGraphMax * iHeight;
}
// print max normalization value
CTString strMaxFPS;
strMaxFPS.PrintF("%d", hud_iFPSGraphMax);
//Show Max FPS
//pDrawPort->PutTextExCX(strMaxFPS, m_nPosX + this->GetWidth() / 2, m_nLocalTimeY + 40, 0x72D02EFF);
}

Here you have the original post with code to show FPS from pwesty's forum

If you just want to edit the default FOV, that's indeed inside the ps.dat and should be quite easy to find there ?

#3

It's a bit depressing, november's source is completely different ?

#4

that code works in novemebers source

in void CUIRadar::RenderObjectLocation() probably

#5

In my case it returns some errors when compiling, when I have time I'll take a look at it...

btw changing the FOV is not enough for my taste, it ended up distorting the image too much (Going up from 86 looks bad). So searching the source I found the line:

FLOAT fDistanceLimit = 9.5f

In PlayerView.cpp

By changing the value we can move the camera even further away from the character, without distorting the image.

#6

that's max zoom != FOV ?

 

#7


1 hour ago, Desarija said:




that's max zoom != FOV ?



 




hmm, maybe I'm wrong, u have field of view of camera and then there is this line, which serves to define the maximum distance of the camera in relation to the character

!= i'm blind ?

#8


9 hours ago, nicolasg said:





hmm, maybe I'm wrong, u have field of view of camera and then there is this line, which serves to define the maximum distance of the camera in relation to the character



!= i'm blind ?




You could just change the FOV with editing it in the Data/Etc/ps.dat file, that's the fastest way. A better way would be to put it to the options with a slidebar to adjust it ingame without editing the ps.dat manually.

#9

I insist in this point cannot add a lot of fov without generating distortion. I thought that i could achieve what i wants by simply adding fov but no... In any case, it is not bad to know that you can also change the maximum distance limit that can be moved away the player's camera. 

#10


On 3/24/2022 at 2:56 PM, Desarija said:



UIRadar.cpp
Search :

Line 534

pDrawPort->PutTextExCX( strServerInfo, m_nPosX +this->GetWidth()/2 + 50, m_nLocalTimeY + 17, 0xFFA600FF );

add thins on line 535

// timer variables
#define FRAMES_AVERAGING_MAX 20L
static CTimerValue _tvLasts[FRAMES_AVERAGING_MAX];
static CTimerValue _tvDelta[FRAMES_AVERAGING_MAX];
static INDEX _iCheckNow = 0;
static INDEX _iCheckMax = 0;
#define FPS_LAST_CACHED 120
static INDEX _aiFPS[FPS_LAST_CACHED];
static INDEX _iStartingFPSIndex = 0;
static INDEX _iLastFPSOut = 0;
static INDEX hud_bShowClock = FALSE;
static INDEX hud_bShowNetGraph = FALSE;
static INDEX hud_bShowResolution = FALSE;
static INDEX hud_bShowPauseText = TRUE;
static INDEX dem_bOSD = FALSE;
static INDEX dem_bPlay = FALSE;
static INDEX dem_bPlayByName = FALSE;
static INDEX dem_bProfile = FALSE;
static INDEX dem_iProfileRate = 5;
static FLOAT dem_fMotionBlurStrength = 0.5f; // 0.1=min, 1=max
static CTString dem_strPostExec = "";
INDEX hud_iStats = 3;
static INDEX hud_iFPSGraphSpeed = 4;
static INDEX hud_iFPSGraphMax = 400;
static INDEX hud_bShowTime = FALSE;
// if required, print real time
if (hud_bShowClock) {
// set font, spacing and scale
// determine time
struct tm *newtime;
time_t long_time;
time(&long_time);
newtime = localtime(&long_time);
// printout
CTString strTime;
}
// clamp stat values
extern ENGINE_API INDEX _iStatsMode;
hud_iStats = Clamp(hud_iStats, 0L, 4L);
_iStatsMode = hud_iStats; // send it to engine
hud_iFPSGraphSpeed = Clamp(hud_iFPSGraphSpeed, 0L, 50L);
hud_iFPSGraphMax = Clamp(hud_iFPSGraphMax, 50L, 500L);
// calculate FPS
FLOAT fFPS = 0.0f;
_iCheckMax++;
if (_iCheckMax >= FRAMES_AVERAGING_MAX) {
for (INDEX i = 0; i<FRAMES_AVERAGING_MAX; i++) fFPS += _tvDelta[i].GetSeconds();
fFPS = FRAMES_AVERAGING_MAX*FRAMES_AVERAGING_MAX / fFPS;
_iCheckMax = FRAMES_AVERAGING_MAX;
}

// determine newest time
CTimerValue tvNow = _pTimer->GetHighPrecisionTimer();
_tvDelta[_iCheckNow] = tvNow - _tvLasts[_iCheckNow];
_tvLasts[_iCheckNow] = tvNow;
_iCheckNow = (_iCheckNow + 1) % FRAMES_AVERAGING_MAX;

// fill FPS graph
INDEX iTimeNow = tvNow.GetSeconds() * 2 * hud_iFPSGraphSpeed;
if (iTimeNow != _iLastFPSOut && iTimeNow % 2) {
_iStartingFPSIndex = (_iStartingFPSIndex + 1) % FPS_LAST_CACHED;
_aiFPS[_iStartingFPSIndex] = fFPS;
_iLastFPSOut = iTimeNow;
}

// set display interface (proportional) font
CTString strDebug;
strDebug = "";
// display colored FPS
COLOR colFPS = C_RED;
if (fFPS >= 20) colFPS = C_GREEN;
if (fFPS >= 60) colFPS = C_WHITE;
//if (fFPS < 10) pdpDrawPort->SetTextScaling(fTextScale*1.5); // enlarge output if FPS is extremely low
// prepare FPS string for printing
CTString strFPS = "?";
CTString strRomain = "?";
if (fFPS >= 30) strFPS.PrintF("%s%3.0f", (const char*)strDebug, fFPS);
else if (fFPS >= 0.1f) strFPS.PrintF("%s%3.1f", (const char*)strDebug, fFPS);
// printout FPS number (if allowed)
//pdpDrawPort->PutTextC(strFPS, slDPWidth*0.75f, slDPHeight*0.005f, colFPS | 192);
strRomain.PrintF("Arcania - FPS");
pDrawPort->PutTextExCX(strRomain, m_nPosX + this->GetWidth() / 2 + 50, m_nLocalTimeY + 34, 0xFFFFFFFF);
pDrawPort->PutTextExCX(strFPS, m_nPosX + this->GetWidth() / 2 + 50, m_nLocalTimeY + 54, 0x4BE100FF);

extern ENGINE_API INDEX cli_iCurrentFPS;
cli_iCurrentFPS = fFPS;
// display extensive statistics
CTString strReport;
// printout statistics
strFPS.PrintF( " frame =%3.0f ms\n---------------\n", 1000.0f/fFPS);
//pDrawPort->PutTextExCX(strFPS, 0, 30, C_WHITE | CT_OPAQUE, m_nPosX + this->GetWidth() / 2, m_nLocalTimeY + 48, 0x72D02EFF);
//pDrawPort->PutTextExCX(strReport, 4, 55, C_WHITE | CT_OPAQUE, m_nPosX + this->GetWidth() / 2, m_nLocalTimeY + 55, 0x72D02EFF);
if (!hud_bShowNetGraph)
{ // draw canvas
const INDEX iWidth = FPS_LAST_CACHED;
const INDEX iHeight = 60;
// calculate FPS
FLOAT fFPS = 0.0f;
_iCheckMax++;
if (_iCheckMax >= FRAMES_AVERAGING_MAX)
{
for (INDEX i = 0; i<FRAMES_AVERAGING_MAX; i++) fFPS += _tvDelta[i].GetSeconds();
fFPS = FRAMES_AVERAGING_MAX*FRAMES_AVERAGING_MAX / fFPS;
_iCheckMax = FRAMES_AVERAGING_MAX;
}

// draw graph lines
for (INDEX i = 0; i<FPS_LAST_CACHED; i++)
{
const INDEX iValue = ClampUp(_aiFPS[(i + _iStartingFPSIndex + 1) % FPS_LAST_CACHED], hud_iFPSGraphMax);
COLOR iCol = C_RED;
if (iValue>100) iCol = C_lBLUE;
if (iValue> 60) iCol = C_WHITE;
if (iValue> 20) iCol = C_GREEN;
const INDEX iNormalizedValue = ((FLOAT)iValue) / hud_iFPSGraphMax * iHeight;
}
// print max normalization value
CTString strMaxFPS;
strMaxFPS.PrintF("%d", hud_iFPSGraphMax);
//Show Max FPS
//pDrawPort->PutTextExCX(strMaxFPS, m_nPosX + this->GetWidth() / 2, m_nLocalTimeY + 40, 0x72D02EFF);
}


Here you have the original post with code to show FPS from pwesty's forum



If you just want to edit the default FOV, that's indeed inside the ps.dat and should be quite easy to find there ?




Hello, I have used the code, I have copied and pasted but it only works when I place myself on top of those texts, how can I make it always show up? sorry for my ignorance but i'm new and i'm learning

 





 



Forum Jump:


Users browsing this thread: 3 Guest(s)