10-23-2015, 10:37 AM
Hello Sphere devs!
I'm roaming in your core once again and I have a question about this:
Taken from CCharNPCAct.cpp start is at line 975 ( on git ).
SO my question is about TICK_PER_SEC. I've found a define in another file and there TICK_PER_SEC is 10.
You can not configure this anywhere else.
1)So does this mean that the last part of the formula with * TICK_PER_SEC / 10 is useless, as TICK_PER_SEC always equals 10?
2)SetTimeout(iTickNext) if iTickNext == 16, does it mean, that next *AI tick* for this object will be over 1.6 sec ?
Thanks in advance,
-Aimed
I'm roaming in your core once again and I have a question about this:
Code:
// TAG.OVERRIDE.MOVERATE
INT64 tTick;
CVarDefCont * pValue = GetKey("OVERRIDE.MOVERATE", true);
if (pValue)
tTick = pValue->GetValNum(); //Taking value from tag.override.moverate
else
tTick = pCharDef->m_iMoveRate; //no tag.override.moverate, we get default moverate (created from ini's one).
// END TAG.OVERRIDE.MOVERATE
if (fRun)
{
if (IsStatFlag(STATF_Pet)) // pets run a little faster.
{
if (iDex < 75)
iDex = 75;
}
iTickNext = TICK_PER_SEC / 4 + Calc_GetRandLLVal((100 - (iDex*tTick) / 100) / 5) * TICK_PER_SEC / 10;
}
else
iTickNext = TICK_PER_SEC + Calc_GetRandLLVal((100 - (iDex*tTick) / 100) / 3) * TICK_PER_SEC / 10;
if (iTickNext < 1)
iTickNext = 1;
else if (iTickNext > 50)
iTickNext = 50;
SetTimeout(iTickNext);
EXC_CATCH;
return 1;Taken from CCharNPCAct.cpp start is at line 975 ( on git ).
SO my question is about TICK_PER_SEC. I've found a define in another file and there TICK_PER_SEC is 10.
You can not configure this anywhere else.
1)So does this mean that the last part of the formula with * TICK_PER_SEC / 10 is useless, as TICK_PER_SEC always equals 10?
2)SetTimeout(iTickNext) if iTickNext == 16, does it mean, that next *AI tick* for this object will be over 1.6 sec ?
Thanks in advance,
-Aimed
). So I've copied this formula exactly like it is in sphere core. My AI Timer ticks every 100 miliseconds, the NPC's have the same dex and moverate amount converted and it still doesn't work as it should work on Sphere 