Opened 16 years ago

Closed 16 years ago

#49 closed enhancement (fixed)

Support lane switches in tiles

Reported by: Henrik Heimbuerger Owned by: Henrik Heimbuerger
Priority: major Milestone: MS1: First release (1.0.0)
Component: track Version: pre-1.0
Keywords: lane, switch Cc:

Description

The tiles must support cars switching lanes. The 'switching lane' has to be described as part of the tile description.

How this can be implemented depends greatly on how tracks with multiple (more than two) lanes are implemented. A lot of planning has to be done before this issue can be fixed.

Change History (9)

comment:1 Changed 16 years ago by Henrik Heimbuerger

Milestone: MS1: First usable versionMS2: Track editor available

comment:2 Changed 16 years ago by Henrik Heimbuerger

Milestone: MS2: Track editor availableMS1: First usable version

Batch moved all tickets from MS2 (track editor) to MS1 (first working version).

comment:3 Changed 16 years ago by Henrik Heimbuerger

Component: unspecifiedtrack

comment:4 Changed 16 years ago by Henrik Heimbuerger

Owner: changed from somebody to Henrik Heimbuerger
Status: newassigned

comment:5 Changed 16 years ago by SVN

New commit by hheimbuerger (revision [311]):
[Partial fix for tickets #49 and #82] Intermediate commit for the implementation of lane change support.

The CarPosition no longer stores a global int to specify the car position on the track. Instead, it now stores a TrackSection and an int for the position of the car on the given section.

The tiles.xml now supports two ways of storing the LaneSections of a Lane. The new method is to specify three groups of LaneSections (and specifying the attribute isLaneChange="true" in the <lane> element):

  • sections inside <common/> are always taken (first)
  • sections inside <regular/> are taken after the common ones if no lane change was triggered
  • sections inside <change/> are taken after the common ones if a lane change was triggered

If the isLaneChange attribute is not set, lane sections are accepted right inside the <lane> element as it has been up to now.

The Lane's getLength() method and the Track's getLaneLength() methods have been removed as the length now depends on whether the lane change is triggered. The Lane's getStepPoint() method and the Track's determineScreenPositionFromPosition() have been slightly modified (incomplete).

The method moveSteps() on the CarPosition class has been adapted to the new way of storing lanes, but it doesn't support lane changes yet.

Two example tiles have been added to the debug tileset.

ATTENTION: The lane change support is incomplete, tiles with lane changes are not handled correctly right now and lane changes is *not* possible!

comment:6 Changed 16 years ago by SVN

New commit by hheimbuerger (revision [318]):
[Partial fix for tickets #49 and #82] Implemented support for setting the exit lane of a lane, the lane a car will be on after leaving a tile.

The exit lane can be specified by giving the lane index (0-based) on the exitLane attribute of the <lane> element. This will be considered the regular exit lane. In the case of lane changing tiles, the same attribute can also be specified on the <regular> and <change> elements. The attribute on <regular> will overwrite the attribute on the <lane> element. The attribute on <change> will define the exit lane of the lane change path.
The attributes are entirely optional and the default is always to stay on the same lane.

The demo_crossing track has been enhanced by a crossover tile demostrating this feature.

comment:7 Changed 16 years ago by SVN

New commit by hheimbuerger (revision [319]):
[Partial fix for tickets #49 and #82] Implemented support for setting the exit lane of a lane, the lane a car will be on after leaving a tile. [MISSING PART]

The exit lane can be specified by giving the lane index (0-based) on the exitLane attribute of the <lane> element. This will be considered the regular exit lane. In the case of lane changing tiles, the same attribute can also be specified on the <regular> and <change> elements. The attribute on <regular> will overwrite the attribute on the <lane> element. The attribute on <change> will define the exit lane of the lane change path.
The attributes are entirely optional and the default is always to stay on the same lane.

The demo_crossing track has been enhanced by a crossover tile demostrating this feature.

NOTE: Added image file missing in the last commit.

comment:8 Changed 16 years ago by SVN

New commit by hheimbuerger (revision [359]):
[Partial fix for #49] Implemented lane change support.

Finally, it should now be possible to change lanes and the have it displayed on the screen properly. There are probably still some bugs, but the basic functionality is there.

NOTE: Due to #114, lane changes currently can't be triggered with the keyboard. For testing, you can remove the

comment:9 Changed 16 years ago by Henrik Heimbuerger

Resolution: fixed
Status: assignedclosed

NOTE: Due to #114, lane changes currently can't be triggered with the keyboard. For testing, you can remove the line

   controllerSignal.setTrigger(false);

in the RaceEngine.

Note: See TracTickets for help on using tickets.