Found this one thanks to one of our QA testers.
(As some folks here know from previous posts, appending large amounts of text to a textfield in HTML5 targets causes significant performance issues. A bug bounty was put out by yours truly )
We had just enabled WASD movement in our game to scroll around the world map. After using our in-game cheat console to allow access to anywhere on the map, a tester noted that using WASD caused the game to slow down significantly.
I profiled using Chrome dev tools and saw that it was spending over 400 ms processing text added to a textfield. The only textfield that had input at all was the one in our cheat console and it was not even on display. The stage focus was also set to null.
I wrote a test case where the game would log the following to the JS console
- Change in character length of the cheat console’s textfield
- What the current stage focus object is
- If the stage focus object is the textfield
I ran the test and the character length was indeed increasing even though the stage focus was null because it was capturing the WASD input still.
Quick solution was to change the type of textfield from “input” to “dynamic”, but I figured this bug should still be noted here.