Example #1
0
def make_wad(seed):
    wad_dir = sys.path[0] + '/WADS/' + str(seed)
    wad_path = wad_dir + '/' + str(seed) + '.wad'
    if not os.path.exists(wad_dir):
        os.makedirs(wad_dir)
    if not os.path.isfile(wad_path):
        gen = oblige.DoomLevelGenerator(seed)
        gen.generate(wad_path)
        return wad_path
    return (False)
Example #2
0
                        default=DEFAULT_OUTPUT_FILE,
                        help="Where the wad file will be created.")
    parser.add_argument("-x", "--exit",
                        action="store_true",
                        help="Do not test the wad, just leave after generation.")

    args = parser.parse_args()

    game = vzd.DoomGame()
    # Use your config
    game.load_config(args.config)
    game.set_doom_map("map01")
    game.set_doom_skill(3)

    # Create Doom Level Generator instance and set optional seed.
    generator = oblige.DoomLevelGenerator()
    generator.set_seed(args.seed)

    # Set generator configs, specified keys will be overwritten.
    generator.set_config({
        "size": "micro",
        "health": "more",
        "weapons": "sooner"})

    # There are few predefined sets of settings already defined in Oblige package, like test_wad and childs_play_wad
    generator.set_config(oblige.childs_play_wad)

    # Tell generator to generate few maps (options for "length": "single", "few", "episode", "game").
    generator.set_config({"length": "few"})

    # Generate method will return number of maps inside wad file.