Module Doom.MakeSource

Parameters

module A : Owl_types_ndarray_algodiff.Sig

Signature

Sourceval make : ?frame_skip:int -> ?downsample:int -> seed:int -> string -> (A.arr, int) Owl_rllib.Ndenv.t

make ~seed scenario loads scenario.cfg from VizDoom's scenarios.

One step repeats the action for frame_skip tics (default 4) and returns their summed reward. The 160x120 grayscale screen is averaged over downsample x downsample blocks (default 2) and scaled to [0, 1]: observations have shape [60; 80; 1] by default, ready for Owl_rllib.Frame_stack. An episode that reaches the scenario's time limit is truncated; one that ends otherwise (a kill, a death) is terminated. VizDoom renders no screen after the end, so the final observation repeats the last one. Raises Invalid_argument unless downsample divides 120 and 160.

Sourceval make_with_renderer : ?frame_skip:int -> ?downsample:int -> seed:int -> string -> (A.arr, int) Owl_rllib.Ndenv.t * (unit -> int * int * bytes)

Like make, with a callback returning width, height and row-major 8-bit grayscale pixels at the original screen resolution. Call after reset or step. At episode end, returns the last available frame. Rendering does not advance the environment.