Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added multiplayer functions #45

Merged
merged 5 commits into from
Jan 24, 2021
Merged

added multiplayer functions #45

merged 5 commits into from
Jan 24, 2021

Conversation

zsunberg
Copy link
Member

@zsunberg zsunberg commented Jan 16, 2021

@jonathan-laurent here is my best suggestion for how we should support multiplayer environments (in response to #43 ). What do you think?

This includes the following optional functions:

  • player_indices
  • player
  • all_act!
  • all_observe
  • UtilityStyle

@jonathan-laurent
Copy link

This looks reasonable to me! Also, the documentation is good.

@zsunberg
Copy link
Member Author

zsunberg commented Jan 17, 2021

Ok, I am going to implement a quick example of tictactoe just to make sure that is pretty easy.

One thing I did think of is that it will get really hard for algorithm writers if player_indices can return something other than a range of integers because then how does an algorithm writer know what kind of container to submit to all_act!? I think it is better for all_act! to always use a vector of actions. Hence player_indices should always return a list of integers.

But in that case should we just switch from player_indices to num_players?

@zsunberg
Copy link
Member Author

Unfortunately I probably won't be able to touch this again until Tuesday. I or someone else also needs to update the Documenter docs for this.

@findmyway
Copy link
Member

One thing I did think of is that it will get really hard for algorithm writers if player_indices can return something other than a range of integers because then how does an algorithm writer know what kind of container to submit to all_act!? I think it is better for all_act! to always use a vector of actions. Hence player_indices should always return a list of integers.

I think if we force all_act! to always use a vector of actions, then player_indices can return anything else only if it is ordered. And maybe we can simply rename it to players?

@zsunberg
Copy link
Member Author

zsunberg commented Jan 23, 2021

After thinking about it a bit more, I see no compelling reason to support anything other than integer indices for players right now. That being said, players feels better than num_players and feels like it could be expanded in the future, and player/players seems more consistent than player/player_indices (player_index/player_indices would be more consistent).

Going with player/players and players returns an ordered list of integers starting at one for now. Will make the change and merge soon and then tag a version later tonight, so stop me soon if there are any objections :)

@zsunberg zsunberg merged commit 7fe4bfb into master Jan 24, 2021
@zsunberg zsunberg deleted the multi branch January 24, 2021 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants