I'd like to, by I my Python knowledge is close to zero. I'm toying with the idea.Vezzra wrote: ↑Sun Oct 27, 2019 12:53 pmAh ok, that must have been added after I last tinkered with that code then. Well, good. If the data is passed in, expanding the algorithm to take team assignments into account shouldn't be too much of a problem. Except for the problem that I really don't have any time for this right now (or in the near/foreseeable future). Of course, anyone who wants is welcome to take on the task...
I see the good stuff is in create_universe(psd_map) (default/python/universe_generation/universe_generator.py):
Code: Select all
print "Compile list of home systems..."
seed_rng(seed_pool.pop())
home_systems = compile_home_system_list(total_players, systems, gsd)
if not home_systems:
err_msg = "Python create_universe: couldn't get any home systems, ABORTING!"
report_error(err_msg)
raise Exception(err_msg)
print "Home systems:", home_systems
# set up empires for each player
seed_rng(seed_pool.pop())
for empire, psd, home_system in zip(psd_map.keys(), psd_map.values(), home_systems):
if not setup_empire(empire, psd.empire_name, home_system, psd.starting_species, psd.player_name):
report_error("Python create_universe: couldn't set up empire for player %s" % psd.player_name)
setup_empire(), the function that assigns HWs to each player/empire, is called for each pair of player/empire and HWs taken as they come out from the players setup and the the list of HWs. That is, it currently assigns HWs to players in the same order they are given. So nothing to change there.
Maybe a good-enough solution could be to order the players in PlayerSetupData so that the members of each team are consecutive (before universe generation), and change compile_home_system_list() so that it returns a list of HWs for which HWs close in the list are also close in the galaxy. Hmmm...