Conversation
xluox
commented
Apr 29, 2022
- Add a random seed to make sure the same maps are generated every time.
- Update PCG to generate multiple maps at a time
- Update vec_env to read in PCG/maps folder
Support randomly generating maps including walls, obstacles, resources, bases, workers. Conflicting issue remains
Fix the formatting
| self.initiate_units(root, "units") | ||
| tree = ET.ElementTree(root) | ||
| tree.write("./maps/filename.xml") | ||
| tree.write(os.path.join("PCG/maps/", "pcg_map" + "_" + str(mapKey) + ".xml")) |
There was a problem hiding this comment.
Nit: the output directory should be configurable (not hard coded like this).
There was a problem hiding this comment.
So what kind of configurable output directory you are expecting?
|
|
||
| # prepare training maps | ||
| self.cycle_maps = list(map(lambda i: os.path.join(self.microrts_path, i), cycle_maps)) | ||
| self.pcg_map_path = os.path.join(PCG.__path__[0], "maps") |
There was a problem hiding this comment.
This input PCG map path should be configurable.
|
Could you add some brief documentation in the |
|
Hey Yifu sorry for the delay. I suggest do not modify the In the envs = MicroRTSGridModeVecEnv(
num_selfplay_envs=args.num_selfplay_envs,
num_bot_envs=args.num_bot_envs,
partial_obs=args.partial_obs,
max_steps=2000,
render_theme=2,
ai2s=[microrts_ai.coacAI for _ in range(args.num_bot_envs - 6)]
+ [microrts_ai.randomBiasedAI for _ in range(min(args.num_bot_envs, 2))]
+ [microrts_ai.lightRushAI for _ in range(min(args.num_bot_envs, 2))]
+ [microrts_ai.workerRushAI for _ in range(min(args.num_bot_envs, 2))],
map_paths=[args.train_maps[0]],
reward_weight=np.array([10.0, 1.0, 1.0, 0.2, 1.0, 4.0]),
cycle_maps=pcg_maps,
) |
Add flag to turn on varying wall rings and non varying wall rings
|
Thanks Yifu! Have you successfully run training with this? |
Yes |
|
Everything looks good, except one last thing. Would you mind adding a section in the README.md file in the roof folder of this project to explain how to run things? Once you add that I think we are ready to merge. Something like below (note that #76 is merged so you need to specify the evaluation maps now) Basically, we want to provide instructions so that people can run it with copy-and-paste commands. Training with Procedural Content GenerationYou can train the agent with procedurally generated maps now thanks to @xluox! Try running: |