eckhchri / pcars-ds-liveview

Provides a html page for project cars dedicated server and display a map of the current race.
14 stars 1 forks source link

On map and session change the markers should go to the new positions without transition. #32

Open viper4gh opened 9 years ago

viper4gh commented 9 years ago

If the map changes and the new positions are far away from the old ones, the markers sometimes moves with transition and sometimes with intermediate steps to the final position.

A solution could be to set the transtions time to 0ms at a map change and after it back to the value before. Second solution: use the function transform instead of transformWithEase.

You can se it here at 6:24: https://www.youtube.com/watch?v=mIhFekqmO30

viper4gh commented 9 years ago

Maybe same problem if you zoom in and out the google map, then a transition is also not needed.

viper4gh commented 9 years ago

https://developers.google.com/maps/documentation/javascript/events API events for catching a zoom change for example.

viper4gh commented 8 years ago

If a session changes from quali to race for example, the cars are set to their new position in the start grid. This should happen without transition.

If you set DisplayDuration to 0 and you zoom the map all markers hold the correct coordinates on the map, only with transition with ease the markers hang on wrong positions, before they jump back to the correct coordinates. Check if transition.interrupt function can help.

If the time between to worker runs is extrem short it is not sufficient to set StopTransitionDelay to true for only one worker run. Zooming in Google maps needs some time. A solution could be using a timer where the StopTransitionDelay=true is for example 500 ms active.

viper4gh commented 8 years ago

Relevant SessionState changes where StopTransitionDelay should be set to true: Lobby ("NO_PARTICIPANT_TestData"/PosX=271 --> Loading (driverarray with names ""/PosX=0) Loading(driverarray with names ""/PosX=0) -> Race (Real PosX data)

https://www.youtube.com/watch?v=UEhY86IYT6M

Analyse_SessionState_Change.txt

The DS API provides driver data with default values on SessionState Loading. The PosX, PosY and PosZ values are 0. Further this data is available two worker runs before the the session switches from Lobby to Loading. See line 188 at Analyse_SessionState_Change.txt.

analyse_sessionstate_change_posx0_data

During the SessionState switch from Loading to Race the data is also not consistent. Some worker runs after the switch to Race, the PosX data is still 0, then Name switches from "" to the real name for first driver for example, PosX is still 0. Other drivers in the array have a real PosX value (see video at 0:29).

analyse_sessionstate_change__loading_to_race

analyse_sessionstate_change__loading_to_race2

viper4gh commented 8 years ago

For CREST mode we need first of all the SessionStates. Update: SessionState available now. Check which State is when active.