mrcrowbar.lib.games.keen module¶
File format classes for the Commander Keen: Invasion of the Vorticons engine (DOS, 1991)
Sources: RLE compressor http://www.shikadi.net/moddingwiki/Keen_1-3_RLE_compression
RLEW compressor http://www.shikadi.net/moddingwiki/RLEW_compression
LZW compressor http://www.shikadi.net/moddingwiki/LZW_Compression (Special thanks to Fleexy)
EGA header http://www.shikadi.net/moddingwiki/Commander_Keen_EGA_Header
Level format http://www.shikadi.net/moddingwiki/Commander_Keen_1-3_Level_format
-
class
mrcrowbar.lib.games.keen.EGAHeader(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]¶ Bases:
mrcrowbar.blocks.BlockBase class for Blocks.
- source_data
- Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
- parent
- Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
- preload_attrs
- Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
- endian
- Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
- cache_bytes
- Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
- path_hint
- Cache a string containing the path of the current Block, relative to the root.
- strict
- Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
- cache_refs
- Pre-cache all the Refs. Defaults to True.
-
bitmap_count¶
-
bitmap_offset¶
-
image_data_start¶
-
latch_compressed¶
-
latch_plane_size¶
-
sprite_compressed¶
-
sprite_count¶
-
sprite_data_start¶
-
sprite_offset¶
-
sprite_plane_size¶
-
tile16_count¶
-
tile16_offset¶
-
tile32_count¶
-
tile32_offset¶
-
tile8_count¶
-
tile8_offset¶
-
class
mrcrowbar.lib.games.keen.EGAHeaderBitmapRef(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]¶ Bases:
mrcrowbar.blocks.BlockBase class for Blocks.
- source_data
- Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
- parent
- Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
- preload_attrs
- Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
- endian
- Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
- cache_bytes
- Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
- path_hint
- Cache a string containing the path of the current Block, relative to the root.
- strict
- Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
- cache_refs
- Pre-cache all the Refs. Defaults to True.
-
height¶
-
location¶
-
name¶
-
width_raw¶
-
class
mrcrowbar.lib.games.keen.EGAHeaderSpriteRef(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]¶ Bases:
mrcrowbar.blocks.BlockBase class for Blocks.
- source_data
- Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
- parent
- Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
- preload_attrs
- Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
- endian
- Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
- cache_bytes
- Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
- path_hint
- Cache a string containing the path of the current Block, relative to the root.
- strict
- Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
- cache_refs
- Pre-cache all the Refs. Defaults to True.
-
height¶
-
hitbox_left¶
-
hitbox_right¶
-
hitbox_top¶
-
horiz_offset¶
-
httbox_bottom¶
-
location¶
-
location_raw¶
-
name¶
-
prog_offset¶
-
vert_offset¶
-
width_raw¶
-
class
mrcrowbar.lib.games.keen.EGALatch(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]¶ Bases:
mrcrowbar.blocks.BlockBase class for Blocks.
- source_data
- Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
- parent
- Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
- preload_attrs
- Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
- endian
- Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
- cache_bytes
- Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
- path_hint
- Cache a string containing the path of the current Block, relative to the root.
- strict
- Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
- cache_refs
- Pre-cache all the Refs. Defaults to True.
-
tilestore¶
-
class
mrcrowbar.lib.games.keen.EGALatchComp(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]¶ Bases:
mrcrowbar.blocks.BlockBase class for Blocks.
- source_data
- Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
- parent
- Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
- preload_attrs
- Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
- endian
- Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
- cache_bytes
- Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
- path_hint
- Cache a string containing the path of the current Block, relative to the root.
- strict
- Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
- cache_refs
- Pre-cache all the Refs. Defaults to True.
-
tilestore¶
-
class
mrcrowbar.lib.games.keen.EGATile16(*args, **kwargs)[source]¶ Bases:
mrcrowbar.blocks.Block-
image_data¶
-
-
class
mrcrowbar.lib.games.keen.EGATile32(*args, **kwargs)[source]¶ Bases:
mrcrowbar.blocks.Block-
image_data¶
-
-
class
mrcrowbar.lib.games.keen.EGATile8(*args, **kwargs)[source]¶ Bases:
mrcrowbar.blocks.Block-
image_data¶
-
-
class
mrcrowbar.lib.games.keen.EGATileStore(*args, **kwargs)[source]¶ Bases:
mrcrowbar.blocks.Block-
data¶
-
tile16= <StoreRef: 0x00007f5d71d04850>¶
-
tile16_offset¶
-
tile16_size¶
-
tile32= <StoreRef: 0x00007f5d71d04a10>¶
-
tile32_offset¶
-
tile32_size¶
-
tile8= <StoreRef: 0x00007f5d71d04690>¶
-
tile8_offset¶
-
tile8_size¶
-
-
class
mrcrowbar.lib.games.keen.Level(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]¶ Bases:
mrcrowbar.unknown.UnknownBase class for Blocks.
- source_data
- Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
- parent
- Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
- preload_attrs
- Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
- endian
- Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
- cache_bytes
- Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
- path_hint
- Cache a string containing the path of the current Block, relative to the root.
- strict
- Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
- cache_refs
- Pre-cache all the Refs. Defaults to True.
-
data¶
-
class
mrcrowbar.lib.games.keen.LevelHeader(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]¶ Bases:
mrcrowbar.blocks.BlockBase class for Blocks.
- source_data
- Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
- parent
- Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
- preload_attrs
- Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
- endian
- Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
- cache_bytes
- Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
- path_hint
- Cache a string containing the path of the current Block, relative to the root.
- strict
- Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
- cache_refs
- Pre-cache all the Refs. Defaults to True.
-
height¶
-
plane_count¶
-
plane_size¶
-
plane_size_calc¶
-
ted_vars¶
-
unknown_1¶
-
unknown_2¶
-
width¶
-
class
mrcrowbar.lib.games.keen.LevelTile(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]¶ Bases:
mrcrowbar.blocks.BlockBase class for Blocks.
- source_data
- Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
- parent
- Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
- preload_attrs
- Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
- endian
- Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
- cache_bytes
- Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
- path_hint
- Cache a string containing the path of the current Block, relative to the root.
- strict
- Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
- cache_refs
- Pre-cache all the Refs. Defaults to True.
-
tile_id¶
-
class
mrcrowbar.lib.games.keen.Loader[source]¶ Bases:
mrcrowbar.loaders.Loader
-
class
mrcrowbar.lib.games.keen.Preview(*args, **kwargs)[source]¶ Bases:
mrcrowbar.blocks.Block-
image_data¶
-
-
class
mrcrowbar.lib.games.keen.PreviewCompressor[source]¶ Bases:
mrcrowbar.transforms.Transform-
import_data(buffer, parent=None)[source]¶ Perform a reverse-transform on a byte string.
- buffer
- Source byte string.
- parent
- Parent object of the source (to provide context for Refs).
-
plan= <mrcrowbar.lib.images.base.Planarizer object>¶
-
rle= <mrcrowbar.lib.games.keen.RLECompressor object>¶
-
-
class
mrcrowbar.lib.games.keen.Scores(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]¶ Bases:
mrcrowbar.blocks.BlockBase class for Blocks.
- source_data
- Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
- parent
- Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
- preload_attrs
- Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
- endian
- Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
- cache_bytes
- Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
- path_hint
- Cache a string containing the path of the current Block, relative to the root.
- strict
- Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
- cache_refs
- Pre-cache all the Refs. Defaults to True.
-
items¶
-
names¶
-
num_cities¶
-
term¶
-
unknown_1¶
-
values¶
-
class
mrcrowbar.lib.games.keen.ScoresItems(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]¶ Bases:
mrcrowbar.blocks.BlockBase class for Blocks.
- source_data
- Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
- parent
- Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
- preload_attrs
- Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
- endian
- Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
- cache_bytes
- Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
- path_hint
- Cache a string containing the path of the current Block, relative to the root.
- strict
- Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
- cache_refs
- Pre-cache all the Refs. Defaults to True.
-
battery¶
-
joystick¶
-
liquor¶
-
vacuum¶
-
class
mrcrowbar.lib.games.keen.ScoresName(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]¶ Bases:
mrcrowbar.blocks.BlockBase class for Blocks.
- source_data
- Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
- parent
- Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
- preload_attrs
- Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
- endian
- Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
- cache_bytes
- Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
- path_hint
- Cache a string containing the path of the current Block, relative to the root.
- strict
- Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
- cache_refs
- Pre-cache all the Refs. Defaults to True.
-
name¶
-
class
mrcrowbar.lib.games.keen.SoundHeader(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]¶ Bases:
mrcrowbar.blocks.BlockBase class for Blocks.
- source_data
- Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
- parent
- Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
- preload_attrs
- Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
- endian
- Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
- cache_bytes
- Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
- path_hint
- Cache a string containing the path of the current Block, relative to the root.
- strict
- Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
- cache_refs
- Pre-cache all the Refs. Defaults to True.
-
count¶
-
magic¶
-
padding¶
-
size¶
-
unknown_1¶
-
class
mrcrowbar.lib.games.keen.SoundRef(source_data: common.BytesReadType | None = None, *, parent: Block | None = None, preload_attrs: dict[str, Any] | None = None, endian: EndianEncoding = None, cache_bytes: bool = False, path_hint: str | None = None, strict: bool = False, cache_refs: bool = True)[source]¶ Bases:
mrcrowbar.blocks.BlockBase class for Blocks.
- source_data
- Source data to construct Block with. Can be a byte string, dictionary of attribute: value pairs, or another Block object.
- parent
- Parent Block object where this Block is defined. Used for e.g. evaluating Refs.
- preload_attrs
- Attributes on the Block to set before importing the data. Used for linking in dependencies before loading.
- endian
- Platform endianness to use when interpreting the Block data. Useful for Blocks which have the same data layout but different endianness for stored numbers. Has no effect on fields with an predefined endianness.
- cache_bytes
- Cache the bytes equivalent of the Block. Useful for debugging the loading procedure. Defaults to False.
- path_hint
- Cache a string containing the path of the current Block, relative to the root.
- strict
- Throw an exception if parsing a BlockField fails, instead of logging a warning and returning an Unknown. Defaults to False.
- cache_refs
- Pre-cache all the Refs. Defaults to True.
-
name¶
-
offset¶
-
priority¶
-
rate¶