-
Notifications
You must be signed in to change notification settings - Fork 4.3k
cleanup port logic in UnityEnvironment #3673
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
Conversation
@@ -193,7 +193,7 @@ messages to the Unity environment from Python using it. | |||
string_log = StringLogChannel() | |||
|
|||
# We start the communication with the Unity Editor and pass the string_log side channel as input | |||
env = UnityEnvironment(base_port=UnityEnvironment.DEFAULT_EDITOR_PORT, side_channels=[string_log]) | |||
env = UnityEnvironment(side_channels=[string_log]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these should now do the correct thing, I removed the explicit port (for simplicity and future-proofing) wherever I found it in the docs.
@@ -8,8 +8,8 @@ def __init__(self, worker_id=0, base_port=5005): | |||
""" | |||
Python side of the communication. Must be used in pair with the right Unity Communicator equivalent. | |||
|
|||
:int worker_id: Offset from base_port. Used for training multiple environments simultaneously. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rearranged to match the argument order. I think I changed the wording of this wherever I saw it (git blame
showed it was 3 years old).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Proposed change(s)
@awjuliani hit this a few weeks ago, and it came up in an issue today too. If no environment was specified, we would still default to port 5005, but we should be smart enough to use 5004 (the editor port) in this case.
Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
#3667
https://jira.unity3d.com/browse/MLA-709?
Types of change(s)
Checklist
Other comments