PythonHivemind.initialize_hive(packet) called with invalid GameTickPacket (after updating from RLBot 1.48 to 1.54)
See original GitHub issueWe are running into a nasty issue after updating our (pipenv) virtual environment from Rlbot 1.48 to the newest release (1.54).
Context
For testing purposes, we use
from rlbot import runner
runner.main()
as well as some custom functionality build around it.
- Our bot is a PythonHivemind (launched as a helper process).
- This issue does not occur when launching our code via the GUI.
- We do not have support_early_start enabled.
The Issue
Since the update, the packet that is passed to self.initialize_hive(packet)
during bot startup is no longer valid. For instance, it has values:
num_boost:0
num_cars:0
num_teams:0
num_tiles:0
…instead of the expected values as read from the MatchConfig.
This call results in incorrect initialization of our bot and finally in fatal errors during calls to get_output()
We have attempted to debug the SetupManager/PythonHivemind/GameInterface, but it’s hard.
The only workaround that we have found so far is:
- check in
initialize_hive
“if packet.num_cars == 0: then skip initialize_hive's functionality
”. - During calls to
get_outputs
, return{index: PlayerInput() for index in self.drone_indices}
until the input packet in theget_outputs
call is finally a valid one (packet.num_cars != 0
) - Then we retry a call to
self.initialize_hive(packet)
.
Notes
This seems to be a bug somewhere in the game interface. We have also noticed, since the RLBot update, this change in the implementation of PythonHivemind
. This bit of code is new:
# Line 67:
# Wait for legitimate field info
while True:
self.game_interface.update_field_info_packet(self._field_info)
if self._field_info.num_goals > 0:
break
time.sleep(0.2)
Deleting this part doesn’t solve our issue (as expected), but maybe this was an attempt to prevent it?
Conclusion
It definitely doesn’t seem like intended behaviour. Why would you have to tell the game interface what your bot wants to do before the game’s match is even properly populated?
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (4 by maintainers)
Seems like there are a few lingering questions, but I’ll go ahead and close. Trezorro, feel free to reopen and/or open a new issue if you’re getting blocked by errors!
Not sending message to Rocket League because that would bring the bytes sent since last receive to 82144, and the limit is 65535 bytes.
This error probably has to do with rendering. You should split up your rendering into groups to avoid this. https://github.com/RLBot/RLBot/wiki/Rendering#rendering-a-large-amount