We built an instant camera for DayZ (working prototype). A player looks through the camera and presses the shutter, and a photo item with the real picture comes out of the camera. Other players can pick the photo up and look at it. Everything works today except one step: MakeScreenshot() only writes a file when the game was started with the launch option -autotest. Without it nothing is written and nothing is logged.
DZG-2402 asks to drop the same check. This ticket adds a complete use case, a repro mod, measurements and suggested limits. Please link the two.
What the mod does (images 1 to 3; images 4 and 5 show the repro):
1. The player raises the camera and looks through the viewfinder (an optics view).
2. On the shutter, the client hides its UI for one frame and calls MakeScreenshot("$profile:...bmp"). The engine writes the frame one frame later.
3. Script crops the frame to a square, shrinks it to 512x512 and 256x256, and encodes DXT1 .paa files (175 KB and 44 KB). The work is spread over frames, so the game does not stutter.
4. The client uploads both files to the server over RPC. The server checks size and format, then stores them.
5. The server creates a photo item in an attachment slot of the camera. The photo is a normal item: it can be taken out, carried and dropped.
6. Any other client that sees the photo downloads the 44 KB picture once and puts it on the item with SetObjectTexture(). Looking at the photo up close loads the 512 version.
Measured on 1.30.164423 (local server, client started with -autotest=1, 1280x720 window):
- The frame is saved one frame after the call (12 to 25 ms): the full window, including UI.
- The whole capture (read, crop, shrink, encode) takes 1.3 to 1.7 s, spread over frames.
- The photo is stored on the server about 5 s after the shutter.
- Another client downloads the 256 picture in about 1.2 s and the 512 picture in about 5 s.
- The files cached on the client are byte-identical to the server's.
We can't ask every player to add a developer launch option: most players never touch launch options, and the option has other effects (the game quits when started with -autotest but without -connect or -mission).