Пример #1
0
def generate_world(combat_test=False):
    _menu = MENUS[menus.get_menu_by_name('World Generation')]
    _settings = {}

    for entry in _menu['menu']:
        _settings[entry['key']] = entry['values'][entry['value']]

    if _settings['Map'] == 'Generate Map':
        _settings['Map'] = mapgen.generate_map(towns=1,
                                               factories=0,
                                               outposts=2,
                                               forests=1)['name']

    if _settings['World Age'] == 'Day 0':
        _ticks = 10
    elif _settings['World Age'] == '1 Week':
        _ticks = 1000  #30000
    elif _settings['World Age'] == '2 Weeks':
        _ticks = 2000
    elif _settings['World Age'] == '3 Weeks':
        _ticks = 3000
    elif _settings['World Age'] == '4 Weeks':
        _ticks = 4000
    elif _settings['World Age'] == '5 Weeks':
        _ticks = 5000

    maps.load_map(_settings['Map'], cache_map=True)

    worldgen.generate_world(WORLD_INFO['map'],
                            dynamic_spawns=_settings['Dynamic Spawns'],
                            wildlife_spawns=_settings['Wildlife Density'],
                            simulate_ticks=_ticks,
                            save=True,
                            thread=True)
Пример #2
0
def generate_world(combat_test=False):
	_menu = MENUS[menus.get_menu_by_name('World Generation')]
	_settings = {}
	
	for entry in _menu['menu']:
		_settings[entry['key']] = entry['values'][entry['value']]
	
	if _settings['Map'] == 'Generate Map':
		_settings['Map'] = mapgen.generate_map(towns=1,
		                                       factories=0,
		                                       outposts=2,
		                                       forests=1)['name']
	
	if _settings['World Age'] == 'Day 0':
		_ticks = 10
	elif _settings['World Age'] == '1 Week':
		_ticks = 1000#30000
	elif _settings['World Age'] == '2 Weeks':
		_ticks = 2000
	elif _settings['World Age'] == '3 Weeks':
		_ticks = 3000
	elif _settings['World Age'] == '4 Weeks':
		_ticks = 4000
	elif _settings['World Age'] == '5 Weeks':
		_ticks = 5000
	
	maps.load_map(_settings['Map'], cache_map=True)
	
	worldgen.generate_world(WORLD_INFO['map'],
		dynamic_spawns=_settings['Dynamic Spawns'],
		wildlife_spawns=_settings['Wildlife Density'],
		simulate_ticks=_ticks,
		save=True,
		thread=True)
Пример #3
0
 def __init__(self):
     self.turn = 0
     self.players = playergen.classic(self)
     self.playergen = itertools.cycle(self.players)
     self.current_player = self.players[0]
     #self.world = worldgen.generate_world(shape='classic', radius=6, algorithm='random_ots', spawntype='classic', players=self.players)
     self.world = worldgen.generate_world(shape='hexagon',
                                          radius=20,
                                          algorithm='random_ots',
                                          spawntype='random',
                                          players=self.players)
     self.initial_layout = worldgen.layout
     playergen.create_player_cameras(self)
Пример #4
0
    def runTest(self):
        world = worldgen.generate_world(64, 64)

        # assert map has proper amounts of terrain
        assert True