[GREENFOOT-354] Change the speed slider
Currently, in terms of frames per second (which is how most users seem to think of speed: basically, the frequency with which act() will be called), the Greenfoot speed slider is exponential. I did the maths a while back when someone asked, and here's the slider value on the left (1--100) and FPS value on the right (assuming that each act/redraw takes 0 time):
{noformat} 1: 0.11 FPS 6: 0.22 11: 0.41 16: 0.78 21: 1.48 26: 2.82 31: 5.36 36: 10.19 41: 19.38 46: 36.83 51: 70.00 56: 133.06 61: 252.92 66: 480.75 71: 913.80 76: 1736.95 81: 3301.56 86: 6275.57 91: 11928.62 96: 22673.68 {noformat}
As you can see, probably only about 35% of the range has sensible values for running the simulation and seeing the differences (which I'd characterise as maybe 1--100 FPS). The upper end of the FPS will never be achieved, it will just run at max speed once it can't keep up with the desired FPS, so I doubt you can do more than a few hundred frames per second. There's a few options to make the slider more usable:
-
We could change the slider to be FPS (perhaps just mapping the 1--100 slider range to 1--100 FPS). This is simple and understandable in terms of understanding it, but in practice it may appear jumpy at the lower end: going from 1--5 FPS runs the simulation five times as fast, but 90--95 will be almost no difference.
-
We could keep the slider as exponential, but limit it to a more useful range. So the bottom could be 1 FPS, the top could be, say, 1024 FPS, but it could be exponential between those two. So you would have a mapping like:
{noformat} 1: 1 FPS 11: 2 21: 4 31: 8 41: 16 51: 32 61: 64 71: 128 81: 256 91: 512 100: ~1000 {noformat}
This has the nice property that the middle of the slider maps to around 30 FPS, which seems like a reasonable default. (I need to look up what the current default speed is...)
Issue metadata
- Issue type: Task
- Priority: Low