- fix texture mapping on background-sky.ac peters

- fix merge error with mpa1-murasama
- update shadow driver

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

Former-commit-id: 3f9fa426c425575a199690ed4d5b56600036366c
Former-commit-id: 685b31a8d56f49704459870cea386a7d763f5653
This commit is contained in:
torcs-ng 2015-09-24 23:45:36 +00:00
parent 0348c6c40b
commit 08c9eda00b
5 changed files with 30 additions and 30 deletions

View file

@ -218,7 +218,6 @@ TDriver::TDriver(int Index, const int robot_type):
Frc = 0.95;
break;
case SHADOW_LS1:
robot_name = "shadow_ls1";
Frc = 0.85;
@ -373,19 +372,17 @@ void TDriver::GetSkillingParameters(const char* BaseParamPath, const char* PathF
if (SkillEnabled > 0) // If skilling is enabled
{ // Get Skill level
Skilling = true; // of TORCS-Installation
Skilling = true; // of TORCS-Installation
LogSHADOW.debug("#Skilling: On\n");
void* SkillHandle = NULL;
snprintf(PathFilenameBuffer, 256,
"%sconfig/raceman/extra/skill.xml",GetLocalDir());
snprintf(PathFilenameBuffer, 256, "%sconfig/raceman/extra/skill.xml",GetLocalDir());
LogSHADOW.debug("#skill.xml: %s\n", PathFilename);
SkillHandle = GfParmReadFile(PathFilename, GFPARM_RMODE_REREAD);
if (SkillHandle)
{
SkillGlobal = MAX(0.0,MIN(10.0,GfParmGetNum(SkillHandle, "skill", "level",
(char *) NULL, 10.0)));
SkillGlobal = MAX(0.0,MIN(10.0,GfParmGetNum(SkillHandle, "skill", "level", (char *) NULL, 10.0)));
LogSHADOW.debug("#LocalDir: SkillGlobal: %g\n", SkillGlobal);
}
else
@ -396,8 +393,7 @@ void TDriver::GetSkillingParameters(const char* BaseParamPath, const char* PathF
SkillHandle = GfParmReadFile(PathFilename, GFPARM_RMODE_REREAD);
if (SkillHandle)
{
SkillGlobal = MAX(0.0,MIN(10.0, GfParmGetNum(SkillHandle,
"skill", "level", (char *) NULL, 10.0)));
SkillGlobal = MAX(0.0,MIN(10.0, GfParmGetNum(SkillHandle, "skill", "level", (char *) NULL, 10.0)));
LogSHADOW.debug("#DataDir: SkillGlobal: %g\n", SkillGlobal);
}
}
@ -433,14 +429,12 @@ void TDriver::InitTrack( tTrack* pTrack, void* pCarHandle, void** ppCarParmHandl
{
void* hCarParm = 0;
char buf[1024];
char trackName[256];
track = pTrack;
char trackName[256];
strncpy( trackName, strrchr(track->filename, '/') + 1, sizeof(trackName) );
*strrchr(trackName, '.') = '\0';
if (track->length < 2000)
RtTeamManagerLaps(3);
else if (track->length < 3000)
@ -471,7 +465,7 @@ void TDriver::InitTrack( tTrack* pTrack, void* pCarHandle, void** ppCarParmHandl
// ok, lets read/merge the car parms.
//
Meteorology();
Meteorology();
// default params for car type (e.g. clkdtm)
snprintf( buf, BUFSIZE, "drivers/%s/%s/%s.xml", robot_name, m_CarType, trackName );
@ -618,9 +612,7 @@ void TDriver::InitTrack( tTrack* pTrack, void* pCarHandle, void** ppCarParmHandl
MyTrack::SideMod sideMod;
sideMod.side = -1;
const char* pStr = GfParmGetStr(hCarParm, SECT_PRIV, PRV_SIDE_MOD, "");
if( pStr == 0 ||
sscanf(pStr, "%d , %d , %d",
&sideMod.side, &sideMod.start, &sideMod.end) != 3 )
if( pStr == 0 || sscanf(pStr, "%d , %d , %d", &sideMod.side, &sideMod.start, &sideMod.end) != 3 )
{
sideMod.side = -1;
}
@ -667,6 +659,7 @@ void TDriver::NewRace( tCarElt* pCar, tSituation* pS )
LogSHADOW.debug( "CARMASS %g TYRE_MU %g TYRE_MU_F %g TYRE_MU_R %g \n",
m_cm.MASS, m_cm.TYRE_MU, m_cm.TYRE_MU_F, m_cm.TYRE_MU_R );
LogSHADOW.debug( "MU_SC %g KZ_SCALE %g FLY_HEIGHT %g\n",
m_cm.MU_SCALE, m_cm.KZ_SCALE, FLY_HEIGHT );
@ -730,12 +723,9 @@ void TDriver::NewRace( tCarElt* pCar, tSituation* pS )
LogSHADOW.debug("m_path passed\n");
m_pitPath[PATH_NORMAL].MakePath( car, &m_path[PATH_NORMAL], m_cm,
PIT_ENTRY_OFFSET, PIT_EXIT_OFFSET );
m_pitPath[PATH_LEFT]. MakePath( car, &m_path[PATH_LEFT], m_cm2,
PIT_ENTRY_OFFSET, PIT_EXIT_OFFSET );
m_pitPath[PATH_RIGHT]. MakePath( car, &m_path[PATH_RIGHT], m_cm2,
PIT_ENTRY_OFFSET, PIT_EXIT_OFFSET );
m_pitPath[PATH_NORMAL].MakePath( car, &m_path[PATH_NORMAL], m_cm, PIT_ENTRY_OFFSET, PIT_EXIT_OFFSET );
m_pitPath[PATH_LEFT]. MakePath( car, &m_path[PATH_LEFT], m_cm2, PIT_ENTRY_OFFSET, PIT_EXIT_OFFSET );
m_pitPath[PATH_RIGHT]. MakePath( car, &m_path[PATH_RIGHT], m_cm2, PIT_ENTRY_OFFSET, PIT_EXIT_OFFSET );
LogSHADOW.debug("m_pit Path passed\n");

View file

@ -102,8 +102,7 @@ void PitControl::Process( CarElt* pCar )
// bool likeToPit = pCar->_dammage >= 500 || pCar->_fuel < 90;
// bool likeToPit = pCar->_dammage + damagePerLap >= repairLimit ||
bool likeToPit = pCar->_dammage >= repairLimit ||
pCar->_fuel < fuelPerLap * 1.5;
bool likeToPit = pCar->_dammage >= repairLimit || pCar->_fuel < fuelPerLap * 1.5;
// likeToPit = true;
// pitting on the last lap is a silly thing to do (think about it!).

View file

@ -34,11 +34,15 @@ public:
private:
enum
{
PIT_NONE,
PIT_BEFORE,
PIT_ENTER,
PIT_ASKED,
PIT_EXIT
PIT_NONE,
PIT_BEFORE,
PIT_PREPARE,
PIT_ENTER,
PIT_ASKED,
PIT_SERVICE,
PIT_EXIT_WAIT,
PIT_EXIT,
PIT_GONE
};
private:

View file

@ -51,7 +51,8 @@ SimpleStrategy::SimpleStrategy()
m_maxDamage = 0; // [-] max damage before we request a pit stop.
m_Fuel = 0; // [Kg] Security fuel at the strat race.
m_expectedfuelperlap = 0; // [Kg] Expected fuel per lap
TrackLength = 0;
RaceDistance = 0;
}
@ -63,6 +64,9 @@ SimpleStrategy::~SimpleStrategy()
void SimpleStrategy::setFuelAtRaceStart(tTrack* t, void **carParmHandle, tSituation *s, int index)
{
Track = t;
TrackLength = Track->length;
RaceDistance = TrackLength * s->_totLaps;
/* Trivial strategy: fill in as much fuel as required for the whole race, or if the tank is
too small fill the tank completely. */
// Load and set parameters.

View file

@ -156,6 +156,9 @@ protected:
int AlwaysPit;
int strategy_verbose;
float TrackLength;
float RaceDistance;
int laps_to_go(tCarElt *car) {return car->_remainingLaps - car->_lapsBehindLeader;}
virtual void updateFuelStrategy(tCarElt* car, tSituation *s);
};