magmaOffenburg / RoboViz

Monitor and visualization tool for the RoboCup 3D Soccer Simulation League
Apache License 2.0
50 stars 17 forks source link

Improve timer for when a team can score after pass mode ends #108

Closed pmacalpine closed 3 years ago

pmacalpine commented 4 years ago

After a pass mode playmode ends, and the PlayOn playmode starts, the team that had the pass mode must wait 10 seconds to score. However, as soon as the playmode changes from PlayOn to something else, a team no longer has to wait for the 10 second timer to expire before scoring. RoboViz should show this by removing the timer whenever the PlayOn playmode transitions to something else.

Another improvement for the timer would be to show which team the timer is for (perhaps have it be the color of the team whose pass mode just ended).

A change for the 2020 competition is to allow a team to score after pass mode once at least two players from the team have touched the ball, and with at least one of those touches occurring after the ball has left the location of the original pass mode protective circle. While this rule change isn't in the server yet (although I do have a working prototype for it), it might be nice to have a way for the server to let roboviz know that it's now OK for a team to score after pass mode so that roboviz can cancel the timer.

Gama11 commented 4 years ago

it might be nice to have a way for the server to let roboviz know that it's now OK for a team to score after pass mode so that roboviz can cancel the timer.

I think the ideal scenario would be that RoboViz doesn't even have to manage a timer - otherwise it needs hardcoded knowledge about the cooldown duration and other things (cancel on playmode changes etc). The server could simply tell RoboViz how long each team has to wait until they can score again, and RoboViz could then simply render that value if it's > 0.

pmacalpine commented 4 years ago

I agree the server should let RoboViz know how long a team has to wait to score after pass mode ends. I have a working prototype of the server that provides this information to the monitor (as well as the duration of pass mode and the minimum distance opponents can be from the ball during pass mode) at https://gitlab.com/robocup-sim/SimSpark/-/tree/2020_updates. This version of the server has a number of changes for the 2020 competition including the new rules I mentioned earlier that allows for the timer to be cancelled if the ball has moved outside the original location of the pass mode circle and two players from the team have touched the ball.

I put together a prototype branch of roboviz that takes advantage of the added information from the server at https://github.com/pmacalpine/RoboViz/tree/pass_mode_timer_update. This branch also supports backwards compatibility with the current version of the server and recorded logs by correctly displaying the wait to score timer with the current set of rules. Additionally it shows the timer in the color of the team that the timer is for.