Hi! I had a bit of spare time so thought I'd make a start, try and document what is going on in those *.trk files located in the ‘track’ directory. I plan to copy this into the readme.txt located in the 'track' directory for the next release.
Quick OverviewYou should read track files from the bottom upwards. If you open ‘remake.trk’ with notepad you’ll see the last line of text in the file is “ROAD_DESERT,GREY,45,1,4,20,-60,60,SNAP”. That is where the track begins. This line of text is known as a RoadChange. Associated with each RoadChange are RoadEvents. RoadEvents are set to occur at specific distances after a RoadChange has occurred. Although it has no function other than to make my track files more readable, I’ve Tab indented the RoadEvents in my track files so that its easy to spot which RoadEvents are associated with which RoadChange.
The track ends when the last RoadChange (at the top of the track file) has run its distance. After that, the track will loop back to the very first RoadChange, or to the RoadChange that has been prefixed with the '*' character. For example:
*ROAD_FOREST,GREY,45,1,4,20,-60,60,MERGE
If you don't want the track to loop back to an old RoadChange, you can the trigger the completion of the game by adding an EVENT_GOAL RoadEvent.
If you switch the TRACK_DEBUG gameplay configuration option on, this will switch off car collisions and also output useful information to the console window the about the RoadChanges and RoadEvents that are as the occur. It also outputs the Cars current distance. Helps if you are designing a track, working out the best distances for particular events to occur.
More about RoadChangesA RoadChange comprises of 9 comma separated values.
Name, Colour, Distance, MinCars, MaxCars, Difficulty, LBarrier, RBarrier, InitBarrierStateWhere,
Name - The name of the road which can be one of the following:
ROAD_DESERT
ROAD_FOREST_ICE
ROAD_TUNNEL
ROAD_TUNNEL_ICE
ROAD_HARBOUR
ROAD_BRIDGE
ROAD_BRIDGE_NIGHT
ROAD_BEACH
ROAD_SNOW
ROAD_MARSH
ROAD_MARSH_ICE
ROAD_GOAL
Colour - The base/tarmac colour of the track. This is not applicable to ROAD_***_ICE type tracks, but you still have to provide a value. Possible colour values are:
GREY
NAVY
Disatance - How many miles the road continues for.
MinCars - When the game decides to feed cars randomly onto the screen, this is the minimum amount that will appear.
MaxCars - When the game decides to feed cars randomly onto the screen, this is the maximum amount that will appear.
Difficulty - This is a bit of a magic value, it reflects how fast the opponent cars travel towards you. I usually choose values between 20 (easy) to 40(hard)
LBarrier - Given the center of the screen on the X axis is 0, this value indicates where the Left barrier should be positioned when the road first appears.
RBarrier - Given the center of the screen on the X axis is 0, this value indicates where the Right barrier should be positioned when the road first appears.
InitBarrierState - When the new road appears, should the barrier position snap immediately to that new position (for instance, when approaching a bridge) , or to merge new position over the nest few miles. Possible InitBarrierState values are:
MERGE
SNAP
More about RoadEvents EVENT_BARRIER_CHANGE – To change barrier to a specific width.
A barrier change comprises of 5 comma separated values:
EVENT_BARRIER_CHANGE,Distance, LBarrier, RBarrier, InitBarrierStateWhere,
Distance - The event will activate after this amount of miles.
LBarrier - Given the centre of the screen on the X axis is 0, this value indicates the proposed Left barrier position
RBarrier - Given the centre of the screen on the X axis is 0, this value indicates the proposed Right barrier position
InitBarrierState - Should the barrier position snap immediately to the proposed position, or gradually merge to it. Possible InitBarrierState values are:
MERGE
SNAP
EVENT_BARRIER_RANDOM - To randomly and continuously change the width and position of the barriers. Once set, the barriers will continue to change until the next RoadChange, or an EVENT_BARRIER_CHANGE.
A barrier random event comprises of 4 comma separated values:
EVENT_BARRIER_RANDOM,Distance,MinBarrier,MaxBarrierWhere,
Distance - The event will activate after this amount of miles.
MinBarrierWidth - The minimum amount of width random roads may have
MaxBarrierWidth - The maximum amount of width random roads may have
EVENT_BRIDGE_SIGN - Enables the flashing bridge sign until the next RoadChange. Comprises of 2 comma separated values:
EVENT_BRIDGE_SIGN,DistanceWhere,
Distance - The event will activate after this amount of miles.
EVENT_SNOW_DRIFT - A snow drift will appear at a random place in the road. Comprises of 2 comma separated values:
EVENT_SNOW_DRIFT,DistanceWhere,
Distance - The event will activate after this amount of miles.
EVENT_PUDDLE - A puddle will appear at a random place in the road. Comprises of 2 comma separated values:
EVENT_PUDDLE,DistanceWhere,
Distance - The event will activate after this amount of miles.
EVENT_POLICE_ON - The police will be after you if you go too slow and this event occurs. Once enabled, they will remain enabled until the end of the race. Comprises of 2 comma separated values:
EVENT_POLICE_ON,DistanceWhere,
Distance - The event will activate after this amount of miles.
EVENT_PRINT - Print something out to the console window. Comprises of 3 comma separated values:
EVENT_PRINT,Distance,<YourMessage>Where,
Distance - The event will activate after this amount of miles.
<YourMessage> - Can be any text you want, but it must be just one word.
EVENT_EXTENDED_PLAY - Trigger the Extended Play sig and award the player with extra time. Note. If you design a track that continuously loops, and the Extended Play event is in that loop, extra time will be keep being awarded. The amount of time awarded each time maybe lessoned each lap by a certain amount. This amount can be set by the TIME_EXTENDED_SEQUENT Gameplay option. Comprises of 2 comma separated values:
EVENT_EXTENDED_PLAY,DistanceWhere,
Distance - The event will activate after this amount of miles.
EVENT_AMBULANCE - Trigger the Ambulance. Comprises of 3 comma separated values:
EVENT_AMBULANCE, Distance, PositonWhere,
Distance - The event will activate after this amount of miles.
Position - Can either be set to 'RANDOM' or a specific value from 0 to 240 (where 120 will be the center of the road).
EVENT_FIRETRUCK - Trigger the Firetruck. Comprises of 3 comma separated values:
EVENT_FIRETRUCK, Distance, PositionWhere,
Distance - The event will activate after this amount of miles.
Position - Can either be set to 'RANDOM' or a specific value from 0 to 240 (where 120 will be the center of the road).
EVENT_CAMERA_SPEED - This event is only applicable when viewing the track in attract mode. It speed or slows the camera down. Comprises of 3 comma separated values:
EVENT_CAMERA_SPEED, Distance, SpeedWhere,
Distance - The event will activate after this amount of miles.
Speed - Speed of the Camara. If set to zero and the EX_SHOW_HISCORE Gameplay option is enabled, the car will come to a standstill at the hiscores will be shown, after which the
attract mode track will repeat again. If the speed of the camera is set to zero and the EX_SHOW_HISCORE Gameplay option is disabled, this event is ignored.
EVENT_GOAL - Completes the game. Comprises of 2 comma separated values:
EVENT_GOAL, DistanceWhere,
Distance - The event will activate after this amount of miles.
I think that is about everything for now, hope it was an interesting read!