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

Fix hanging cutscenes on fast machines #1153

Merged
merged 1 commit into from
Oct 3, 2023
Merged

Conversation

lawadr
Copy link
Contributor

@lawadr lawadr commented Jun 25, 2023

On machines that can load levels faster than the hardcoded entity spawning delay, the Icarus sequencer could reference non-existing entities and therefore fail to chain events to progress cutscenes.

This change increases the number of warmup frames by 1 to push the possible client-server connection time to after all relevant entities have been spawned.

Fixes #1150

On machines that can load levels faster than the hardcoded entity
spawning delay, the Icarus sequencer could reference non-existing
entities and therefore fail to chain events to progress cutscenes.

This change increases the number of warmup frames by 1 to push the
possible client-server connection time to after all relevant entities
have been spawned.
@ensiform
Copy link
Member

ensiform commented Jun 26, 2023

After all that checking and investigating only adding 1 additional frame was sufficient? Crazy.

I do know that Enemy Territory uses 6 frames but I never really knew why. Maybe their mod code scripting depends on that too. But it's MP only. Perhaps Rtcw SP also does.

@lawadr
Copy link
Contributor Author

lawadr commented Jun 26, 2023

After all that checking and investigating only adding 1 additional frame was sufficient? Crazy.

I do know that Enemy Territory uses 6 frames but I never really knew why. Maybe their mod code scripting depends on that too. But it's MP only. Perhaps Rtcw SP also does.

Very.

There's a few constants defined in the source, such as START_TIME_REMOVE_ENTS, whose purpose seems to be to stagger things enough to just make everything work. Initialisation events seem to happen in a series of "waves" separated by 50 to 100ms. If the client connects too early then you'll probably hit an issue of some kind. I guess you just need to make sure the warmup frames are sufficient for the number of these "waves" in a game.

Obviously computers were nowhere near fast enough back then to ever hit this issue. I think what finally did it was SSD speeds. I'm loading a level in 0.4 seconds now.

Razish
Razish previously approved these changes Sep 13, 2023
Copy link
Contributor

@Daggolin Daggolin left a comment

Choose a reason for hiding this comment

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

If I recall correctly the discussion mentioned by @Razish concluded that this pull request should work for vanilla maps, but there were concerns about possible custom missions or other custom mods.

As any other approach to this issue is likely to take some time and changes to a lot more places of code I would suggest to merge this for now, because several users have reported that they couldn't finish the game, because they would get stuck due to this issue over the past few months.

If someone is concerned about possible side effects one could add a cvar to specify the amount of warmup frames and default it to 4 so the change can easily be reverted by users for testing purposes or extended if a custom mission requires even more warmup frames.

@Razish Razish merged commit c9d3e97 into JACoders:master Oct 3, 2023
MaceMadunusus pushed a commit to MBII/OpenJK that referenced this pull request Oct 24, 2023
On machines that can load levels faster than the hardcoded entity
spawning delay, the Icarus sequencer could reference non-existing
entities and therefore fail to chain events to progress cutscenes.

This change increases the number of warmup frames by 1 to push the
possible client-server connection time to after all relevant entities
have been spawned.
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.

Cutscenes failing to play correctly
4 participants