- update shadow's driver

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7149 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 5344ff8ee8ec632b7f960dd0eab34dc461645cd6
Former-commit-id: 0829ed1e98056856909ac608f9e2f23ff740ce2a
This commit is contained in:
torcs-ng 2020-07-06 00:36:41 +00:00
parent 5db23f5992
commit 7631e22f5d
3 changed files with 15 additions and 12 deletions

View file

@ -236,6 +236,7 @@ void Driver::InitTrack(
strncpy(m_carName, GfParmGetStr(pCarHandle, path, key, ""), 99); strncpy(m_carName, GfParmGetStr(pCarHandle, path, key, ""), 99);
m_carName[99] = '\0'; m_carName[99] = '\0';
char* p = strrchr(m_carName, '.'); char* p = strrchr(m_carName, '.');
if( p ) if( p )
*p = '\0'; *p = '\0';
@ -255,10 +256,7 @@ void Driver::InitTrack(
// //
const char* raceTypeStr[] = { "practice", "qualify", "race" }; const char* raceTypeStr[] = { "practice", "qualify", "race" };
int raceType = pS->raceInfo.type; unsigned int raceType = pS->raceInfo.type;
//if( raceType == RM_TYPE_PRACTICE && (pS->raceInfo.totLaps == 3 || pS->raceInfo.totLaps == 10) )
// raceType = RM_TYPE_QUALIF;
LogSHADOW.debug(" # Shadow Race type = %s \n", raceTypeStr[raceType]); LogSHADOW.debug(" # Shadow Race type = %s \n", raceTypeStr[raceType]);
@ -283,13 +281,13 @@ void Driver::InitTrack(
snprintf( buf, sizeof(buf), "%sdrivers/%s/%s/default.xml", snprintf( buf, sizeof(buf), "%sdrivers/%s/%s/default.xml",
GfDataDir(), MyBotName, m_carName); GfDataDir(), MyBotName, m_carName);
hCarParm = MergeParamFile(hCarParm, buf, hCarParm != pCarHandle); hCarParm = MergeParamFile(hCarParm, buf, hCarParm != pCarHandle);
LogSHADOW.debug("PATH = %s \n", buf); LogSHADOW.info("PATH = %s \n", buf);
// override params for car type on track of specific race type and driver. // override params for car type on track of specific race type and driver.
snprintf( buf, sizeof(buf), "%sdrivers/%s/%s/%s-%d.xml", snprintf( buf, sizeof(buf), "%sdrivers/%s/%s/%s-%d.xml",
GfDataDir(), MyBotName, m_carName, m_trackName, weathercode); GfDataDir(), MyBotName, m_carName, m_trackName, weathercode);
hCarParm = MergeParamFile(hCarParm, buf, hCarParm != pCarHandle); hCarParm = MergeParamFile(hCarParm, buf, hCarParm != pCarHandle);
LogSHADOW.debug("PATH = %s \n", buf); LogSHADOW.info("PATH = %s \n", buf);
} }
else else
{ {
@ -297,13 +295,13 @@ void Driver::InitTrack(
snprintf( buf, sizeof(buf), "%sdrivers/%s/%s/default.xml", snprintf( buf, sizeof(buf), "%sdrivers/%s/%s/default.xml",
GfDataDir(), MyBotName, m_carName); GfDataDir(), MyBotName, m_carName);
hCarParm = MergeParamFile(hCarParm, buf, hCarParm != pCarHandle); hCarParm = MergeParamFile(hCarParm, buf, hCarParm != pCarHandle);
LogSHADOW.info("PATH = %s \n", buf); LogSHADOW.info(" # Loaded default = %s \n", buf);
// override params for car type on track of specific race type and driver. // override params for car type on track of specific race type and driver.
snprintf( buf, sizeof(buf), "%sdrivers/%s/%s/%s.xml", snprintf( buf, sizeof(buf), "%sdrivers/%s/%s/%s.xml",
GfDataDir(), MyBotName, m_carName, m_trackName); GfDataDir(), MyBotName, m_carName, m_trackName);
hCarParm = MergeParamFile(hCarParm, buf, hCarParm != pCarHandle); hCarParm = MergeParamFile(hCarParm, buf, hCarParm != pCarHandle);
LogSHADOW.info("PATH = %s \n", buf); LogSHADOW.info(" # Loaded = %s \n", buf);
} }
// setup the car param handle to be returned. // setup the car param handle to be returned.

View file

@ -143,9 +143,14 @@ void Strategy::Process( CarElt* pCar, TeamInfo::Item* pTeamInfo )
damagePerM = m_totalDamage / pCar->_distRaced; damagePerM = m_totalDamage / pCar->_distRaced;
if(m_HasTYC) if(m_HasTYC)
{
tyreWearPerM = (1.0 - m_lastTyreWear) / pCar->_distRaced; tyreWearPerM = (1.0 - m_lastTyreWear) / pCar->_distRaced;
LogSHADOW.debug(" # Fuel per meter = %.6f - Damage per meter = %.1f - Wear per meter = %.8f\n", fuelPerM, damagePerM, tyreWearPerM);
LogSHADOW.debug(" # Fuel per meter = %.6f - Damage per meter = %.1f - Wear per meter = %.8f\n", fuelPerM, damagePerM, tyreWearPerM); }
else
{
LogSHADOW.debug(" # Fuel per meter = %.6f - Damage per meter = %.1f\n", fuelPerM, damagePerM);
}
} }
// //

View file

@ -35,9 +35,9 @@ const float Stuck::delta8_t[8] = {1.0f/Stuck::SPD, 1.0f/Stuck::SPD * 1.414f,
1.0f/Stuck::SPD, 1.0f/Stuck::SPD * 1.414f, 1.0f/Stuck::SPD, 1.0f/Stuck::SPD * 1.414f,
1.0f/Stuck::SPD, 1.0f/Stuck::SPD * 1.414f}; 1.0f/Stuck::SPD, 1.0f/Stuck::SPD * 1.414f};
const float Stuck::delta64_t[64] = const float Stuck::delta64_t[64] =
{ {
1.0f/Stuck::SPD * 1.000f, 1.0f/Stuck::SPD * 1.050f, 1.0f/Stuck::SPD * 1.100f, 1.0f/Stuck::SPD * 1.150f, 1.0f/Stuck::SPD * 1.000f, 1.0f/Stuck::SPD * 1.050f, 1.0f/Stuck::SPD * 1.100f, 1.0f/Stuck::SPD * 1.150f,
1.0f/Stuck::SPD * 1.500f, 1.0f/Stuck::SPD * 1.480f, 1.0f/Stuck::SPD * 1.460f, 1.0f/Stuck::SPD * 1.440f, 1.0f/Stuck::SPD * 1.500f, 1.0f/Stuck::SPD * 1.480f, 1.0f/Stuck::SPD * 1.460f, 1.0f/Stuck::SPD * 1.440f,
1.0f/Stuck::SPD * 1.414f, 1.0f/Stuck::SPD * 1.440f, 1.0f/Stuck::SPD * 1.460f, 1.0f/Stuck::SPD * 1.480f, 1.0f/Stuck::SPD * 1.414f, 1.0f/Stuck::SPD * 1.440f, 1.0f/Stuck::SPD * 1.460f, 1.0f/Stuck::SPD * 1.480f,
1.0f/Stuck::SPD * 1.500f, 1.0f/Stuck::SPD * 1.150f, 1.0f/Stuck::SPD * 1.100f, 1.0f/Stuck::SPD * 1.050f, 1.0f/Stuck::SPD * 1.500f, 1.0f/Stuck::SPD * 1.150f, 1.0f/Stuck::SPD * 1.100f, 1.0f/Stuck::SPD * 1.050f,