The ball in Plinko bounces around on a board of pegs, moving in different directions, until it falls into a slot. This simple browser animation can be tested on a 120Hz monitor. Will JavaScript keep up with the fast screen refresh rate of the 120Hz monitor?
What 120Hz Means for Casino Games
Plinko is a good example of browser animation for casino games. In Plinko, the ball falls down a board of pegs and changes direction several times before landing in a slot. For each of these movements, the ball is at a different location on the screen. On bestcasino.com players can find reviews of the different online casinos and also a comprehensive guide to all casino games, including slots, table games and more.
If a reel spins for 2 seconds then there could be 120 different frames of animation shown on a 60Hz display, or 240 on a 120Hz display, as long as the game is sending enough frames of animation to the display. The result of a round of a casino game is determined by the game’s rules, while the movement on screen is affected by the refresh rate of the monitor.
Eight Milliseconds Goes Quickly
60Hz equals roughly 16.67 milliseconds between refreshes, whereas 120Hz equals roughly 8.33 milliseconds between refreshes. The interval is shared with other tasks running in the browser. These can include calculating styles, updating positions of elements on screen and rendering the resulting image to the screen.
The documented browser rendering process explains how JavaScript, layout, painting and compositing contribute to producing frames. Some animations can avoid expensive layout calculations, depending on how developers implement them.
An arcade game with thirty moving objects will require updating their coordinates on each frame. If there are complex backgrounds that require redrawing or if the page layout has to be re-calculated then that will also require time.
Even though a 120Hz display can show more frames of animation than a 60Hz display, it can only show the number of frames that the browser and application can produce.
Recording a Short Game Session
A simple action, such as moving a ball around on a board of pegs, is ideal for a test of this nature as it can be repeated many times in order to identify consistent problems.
Keep browser window size and graphics settings constant for a controlled browser test. Record a sequence of events including the animation, a button press and the transition to the next game round. Check for the following things:
- Frame intervals. Look for long gaps between completed frames.
- Scripts taking too long to execute.
- Rendering work. This includes work done in the layout phase as well as work done in the painting phase.
- Input timing. Inspect what happens between pressing a control and seeing its response. You can use the performance recording tools to record the CPU activity for a short period of time and then analyze that data in order to identify possible bottlenecks. The timeline will show you long running tasks as well as other tasks that were running at the time of the delayed frame. One recording of the above sequence will suffice to identify any occasional problems; repeated recordings of the same sequence will enable the developer to distinguish such occasional problems from persistent ones.
The Animation Clock Matters
Browser games frequently use requestAnimationFrame() to schedule animation updates before each frame is repainted. This means that if a ball moves 3 pixels each frame, it will move 180 pixels each second at 60Hz but 360 pixels each second at 120Hz. If the game calculates the movement of the ball based on elapsed time then it will move at the same speed on both 60Hz and 120Hz screens. Some games even run physics calculations on a separate thread to ensure that the game’s physics remain stable even if the frame rate drops.
What the Test Can Actually Tell You
A 120Hz monitor can display more frames of animation than a 60Hz monitor. By recording the frame timing of a Plinko game and the JavaScript that is running during that time, developers can see exactly how the ball is moving between the pegs in the game. Arcade games can be used to measure the time that it takes for a player’s key presses to be processed by the browser.
Top comments (0)