|
From: Eric E. <eri...@fr...> - 2003-11-23 20:52:41
|
Hi all,
I have added in CVS some race rules to the race engine.
The rules are concerning the pit lane:
- exceeding the speed limit in the pit lane will be
punished by a "drive through" to be done within
the 5 next laps.
- entering or exiting the pit lane elsewhere than
the normal pit entry and exit will recieve a
"stop and go" to be done within the 5 next laps.
- if the penalty is not "cleared" within the allowed laps,
the car will be eliminated.
This concerns only the "pro" mode drivers.
The car structure is modified to manage this feature, and
the current robots (running in semi-pro mode) are
not to be modified (only recompiled).
car->_penaltyList : is a (GF_TAILQ) list of the current penalties
of the car.
Each penalty is defined as follow:
#define RM_PENALTY_DRIVETHROUGH 1
#define RM_PENALTY_STOPANDGO 2
/** One penalty */
typedef struct CarPenalty
{
int penalty; /**< penalty type */
int lapToClear; /**< the lap before the penalty has to be cleared */
GF_TAILQ_ENTRY(struct CarPenalty) link;
} tCarPenalty;
to access to the first penalty:
tCarPenalty penalty = GF_TAILQ_FIRST(&(car->_penaltyList));
IMPORTANT: Penalties have to be cleared in the order of the list.
The pit command was modified too to manage the "stop and go":
/** Command issued by the car during pit stop */
typedef struct
{
tdble fuel;
int repair;
#define RM_PIT_REPAIR 0
#define RM_PIT_STOPANDGO 1
int stopType;
} tCarPitCmd;
#define _pitFuel pitcmd.fuel
#define _pitRepair pitcmd.repair
#define _pitStopType pitcmd.stopType
so to declare a pit stop as a "stop and go":
car->_pitStopType = RM_PIT_STOPANDGO;
Normally, the robots should not be concerned as they drive
according to the rules.
The player's interface have been enhanced to have
a "speed limiter" command, and a "stop and go" mode
in the pit screen.
Have fun,
Eric.
--
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
TORCS
The Open Racing Car Simulator
AKA The Other Release Coming Soon (Skin'r)
http://torcs.org
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
|