When displaying a very long string on screen (using hint, systemChat, any dialogue field) the game FPS drops relative to the overall length of the string, even though a small portion of the string is displayed on the screen. This FPS drop can be quite significant, and with a long enough string it will hang the game. {F19806}
Description
Details
- Legacy ID
- 906150339
- Severity
- None
- Resolution
- Open
- Reproducibility
- Always
- Category
- Scripting
- Use some method of monitoring game FPS (eg FRAPS)
- In editor, load attached repro mission. Preview mission.
- Note string length is displayed by systemChat, while string is displayed by hint.
- Repeatedly activate radio Juliet to double string length. Observe FPS drop as string length increases, and game eventually hangs.
- Modify mission to display myString using systemChat, or in watch field of Debug Console and observe similar drop in FPS.
This is a trivial issue, but caused me some confusion trying to find the cause of low FPS while debugging a mission.
My test results (using hint):
String length, FPS
1, 118
2, 118
4, 118
8, 118
16, 118
32, 118
64, 117
128, 116
256, 114
512, 111
1024, 100
2048, 75
4096, 40
8192, 14
16384, 4
32768, <1
65536, <1
131072, (Arma3.exe not responding)
Event Timeline
This issue won't affect people playing missions (max characters for hint is about 1000)
However it can cause problems for people making missions with large arrays etc (the simplest way to monitoring dynamic variables is to display them on screen).
I'd like to refine this a little.
Assigning a variable with concatenated strings using the form myString = myString + myString does not have an effect on performance. However, as soon as this long string is used in any way - output to screen, rpt file, or sent to callExtension, a performance hit is encountered. The severity can range from a short pause, to a complete hardlock.
Update using dev branch 1.43.130502.
1 - 108
...
1k - 108
2k - 91
4k - 45
8k - 14
16k - 4
32k - <1
64k - <1
128k - <1
256k - <1
There is some improvement, as game remains somewhat responsive at longer string length, although extremely slow (many seconds between frames). This issue still has malicious potential.
Displayed stings could be limited to the maximum that actually fits on the screen at any resolution, say 2048 characters?