Skip to content

feat: Add display state change signal to RewindableStateMachine#331

Merged
elementbound merged 11 commits intofoxssake:mainfrom
krazyjakee:state-machine-example-fix
Nov 22, 2024
Merged

feat: Add display state change signal to RewindableStateMachine#331
elementbound merged 11 commits intofoxssake:mainfrom
krazyjakee:state-machine-example-fix

Conversation

@krazyjakee
Copy link
Copy Markdown
Contributor

Attempting to fix #327

While this resolves the issue of synchronizing states across all clients and host, we're 2 steps back with the state flickering after certain events such as landing a jump.

@krazyjakee
Copy link
Copy Markdown
Contributor Author

explorer_pSTlOHwPzp-00.00.06.357-00.00.26.416.mp4

Let me know if this solves the base issue and I'll address the other issues mentioned here and by BatteryAcidDev on discord.

@krazyjakee krazyjakee closed this Nov 19, 2024
@krazyjakee krazyjakee force-pushed the state-machine-example-fix branch from 08ebb39 to d37b47d Compare November 19, 2024 22:22
@krazyjakee krazyjakee reopened this Nov 19, 2024
@krazyjakee krazyjakee force-pushed the state-machine-example-fix branch from d5f2844 to 5caa45e Compare November 21, 2024 20:14
for child in find_children("*", "RewindableState", false):
_available_states[child.name] = child
func _notification(what: int):
if what == NOTIFICATION_READY:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does the same as the _ready callback, why the change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's so users can comfortably add their own logic without overriding what's underneath (which is what batteryaciddev bumped into). I know you can call _ready.super() but this is just an easier solution.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha! I've restored this form. Though long-term I'm unsure of this pattern - while this is comfortable for the user, it's less explicit and more magic.

Anyway, let's leave this in and see the reactions.

@krazyjakee
Copy link
Copy Markdown
Contributor Author

Confirmed this is working just fine, even at high latency.

@elementbound elementbound changed the title State machine Example Fix feat: Add display state change signal to RewindableStateMachine Nov 22, 2024
@elementbound elementbound merged commit dc57069 into foxssake:main Nov 22, 2024
@krazyjakee krazyjakee deleted the state-machine-example-fix branch November 26, 2024 10:48
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.

State Machine example is broken

2 participants