Skip to content

Remove unnecessary physics tick delay after the initial reset issued from Python server - #66

Open
stefanfausser wants to merge 1 commit into
edbeeching:mainfrom
stefanfausser:fixes/obs2
Open

Remove unnecessary physics tick delay after the initial reset issued from Python server#66
stefanfausser wants to merge 1 commit into
edbeeching:mainfrom
stefanfausser:fixes/obs2

Conversation

@stefanfausser

@stefanfausser stefanfausser commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Issue - affects the first steps in the training mode:

After the reset is initiated from the Python server by a reset message, all agents are correctly resetted. However, after doing the actual reset in the env(s), it is waited another physics tick before the action (for the resetted-state(s)) is retrieved from the Python server via an action message and then applied to the env(s). This is unnecessary because the Python server sends an action message immediately after receiving the reset message with the observations so there is no need to wait another physics tick before receiving the action message and applying it to the env(s).

(I checked this behaviour with the SB3 example by some debug messages that are removed in this final submission).

Edit: In addition to waiting one physics tick too much, without this PR, the first action is unlikely to be the correct action for the resetted states (in the best case the player is not moving). In contrast, ONNX inference has no such delay. Overall, it is a minor issue as this only happens once after the initial reset via reset message. However, I would like to fix this to eventually get the exact same sequence of obs + actions during Python model inference and ONNX inference. I know how to get there and this is the first out of two required PRs. This does not touch resets triggered from the Godot side, e.g. after a game over or time out / truncation.

How this is fixed:

After having resetted the environments and sending back the reset message with the current obs, the action message is now immediately received and applied from the Python server (with debug messages I could confirm that the action message was indeed received immediately after sending the reset message on the Godot side).

@stefanfausser stefanfausser changed the title fix: Remove unnecessary additional physics tick after the initial reset Remove unnecessary additional physics tick after the initial reset Jun 27, 2026
@stefanfausser stefanfausser changed the title Remove unnecessary additional physics tick after the initial reset Remove unnecessary additional physics tick after the initial reset issued from Python server Jun 27, 2026
@stefanfausser stefanfausser changed the title Remove unnecessary additional physics tick after the initial reset issued from Python server Remove unnecessary physics tick delay after the initial reset issued from Python server Jul 9, 2026
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.

1 participant