wiki:vc

Version 1 (modified by jpawlick, 13 years ago) (diff)

--

This ProtocolZero query uses the graphical abilities of Quake 3 to render the world as seen from the bot's perspective. Unlike , this uses a linear projection to produce an image much like the ones the player sees while playing the game.

Currently, drawing of the first-person gun and of two-dimensional overlays (such as ammo counts, health meters, reticule, name displays, score displays, and so forth) is disabled under most conditions.

vc requires graphics acceleration and so cannot be used on a dedicated server. Any graphics options (such as image resolution, texture detail, and so forth) will match the options of the client that is running as host.

Performance will rely on your graphics hardware. Due to the nature of accelerated drawing surfaces, if part of the Quake 3 window is obscured by another window while the system conducts a vc or vd command, that portion of the resulting image is undefined.

It is not uncommon to notice a hiccup in Quake's performance while a vc operation is being undertaken. This is usually because of the socket transfer time rather than the drawing time.

FIXME: A disconnection or the client's refusal to read can cause Quake to hang indefinitely as it waits to complete the sending of the image data. See the comment in Trap_Com_QuagentsGLGetView in code/qcommon/common.c.

Parameters: None.

Responds:

  • w h DATA where w is the width of the image, h is the height of the image, and DATA is w*h*3 bytes of color information. The first three bytes define the red, green, and blue values (in that order) of the first pixel in the buffer (lower left corner of the image). The next three belong to the pixel immediately right of that pixel, and so on (row major order).

Reports:

  • done when the task completes.
  • popped if popped by po.
  • forgotten if deleted by fa or fm.
  • replaced if replaced by a command scheduled with 'r'.

Example:

  • User sends: "n vc 512"
  • Bot replies "rs vc 512 640 480 5q'5hn?o1qin716[32\-..."
  • Bot replies "cp rb 512 done"

The following images demonstrate the relationship between vc and vd. Note that vd does not really return an "image", but its returned raster has been visualized as an image below.

If you experience color cycling (it seems like the red component is where you expect the blue, and so on), make sure you are reading the space from the socket before you start reading image data.

Attachments (2)

Download all attachments as: .zip