Skip to content

Comments

Add cutscene property for levels (title screen, credits, in-game cutscenes)#3536

Open
Semphriss wants to merge 2 commits intoSuperTux:masterfrom
Semphriss:no-multiplayer-on-title
Open

Add cutscene property for levels (title screen, credits, in-game cutscenes)#3536
Semphriss wants to merge 2 commits intoSuperTux:masterfrom
Semphriss:no-multiplayer-on-title

Conversation

@Semphriss
Copy link
Member

@Semphriss Semphriss commented Jan 5, 2026

Plugging/unplugging controllers while on the main menu would add and remove players automatically. I've added an option to prevent this from happening.

Edit:

Per discussion further below, the new solution involves making certain levels as cutscenes, which, among others, prevents the level from having more than one player.

It also updates the code that had hardcoded checks for the title screen to check for that property instead, which is now shared with the credits scene and the introduction of the main story, and will later be by other cutscene levels.

Copy link
Member

@swagtoy swagtoy left a comment

Choose a reason for hiding this comment

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

Please use m_savegame->is_title_screen() to internally decide within GameSession if players should be added. We do not need an extra property here :)

@Brockengespenst
Copy link
Contributor

Brockengespenst commented Jan 5, 2026

Maybe a more generic approach might make sense. There is always a problem with Nolok's Castle and multiple players. If any other but the first player do not move in time behind the closing barrier, they are stuck forever. The other players could spawn when the control is handed back to the first player.
Or the player scripting should be extended to all players and not the first one only.

@Semphriss
Copy link
Member Author

I moved the logic of deciding whether or not to spawn new players to the GameSession class to avoid putting the logic relating to that class into the controller-related classes, which would duplicate the logic between the JoystickManager and the GameControllerManager. I can revert this part of the changes anyways if you prefer it like that.

@Semphriss
Copy link
Member Author

After further testing, I found that cutscene levels suffer from the same issue and would benefit from a similar mechanism, so I'll try to see if I can implement something for them.

@swagtoy
Copy link
Member

swagtoy commented Jan 6, 2026

WOw... i wrote a comment here and must've never sent it.. odd.

Just some pointers: The current is_titlescreen_level() thing is a hack, because it checks if the worldname is set to "". You could maybe do something similar to the credits thing, like setting the credits level but not setting the worldname at all (which would make m_savegame null... which is fine.

Do not rely on m_savegame being null for this. In the editor PR (well, before that too), i refactored the GameSession so you can play levels without one (this is required for the Level editor to play "ephemeral" levels).

However... I completely forgot to consider, how do cutscenes handle this? Perhaps a should actually be set in levels itself, like the CAR allow_multiplayers? Plus, there may be levels/worldmaps where multiplayer makes zero sense (like some absurd kaizo level) or would be considered cheating. In any such case, what should be do about this?

@Semphriss
Copy link
Member Author

In my own personal opinion, it would be best if there could be an option in the level itself representing whether the level supports multiplayer or not. I can implement that if it sounds good.

@swagtoy
Copy link
Member

swagtoy commented Jan 6, 2026

Might not be a bad idea. Go for it! I feel though like it shouldn't be exposed to the editor menu, because i do wonder if people could misuse it.

Improves on the parent commit by adding a new property to mark certain levels as cutscenes. They will always have only one player regardless of multiplayer. Various places in the code that checked only for the title screen have been updated accordingly.

Some levels were updated to be marked as cutscenes, such as the credits sequence, but not all levels were updated.
@Semphriss
Copy link
Member Author

@swagtoy I've updated the code; now levels can have a "cutscene" property which, when set to true, will prevent the level from having more than one player. I've already marked the menu, retro menu, credits and Icy Island intro levels as cutscenes, but I haven't gone through all levels of all worlds to identify the cutscenes; I'll leave that to the level designers.

I updated various places in the code that checked for the title screen specifically and made them check for the cutscene mark instead. Make of them should also have been checking for the credits scene, so I presumed all cutscene-like levels were applicable.

I agree that this feature could be abused by eager or unaware level designers, but since many levels may be cutscenes as there are in the two main worlds, I decided to go ahead and expose it anyways. I'm open to have this discussed further if you prefer to keep the option hidden from the level editor.

@swagtoy
Copy link
Member

swagtoy commented Jan 7, 2026

I think it should be fine for now.

Ill review in a bit. Thanks for all your work!!! '-'7

@Semphriss Semphriss changed the title Prevent players from spawning in the main menu Add cutscene property for levels (title screen, credits, in-game cutscenes) Jan 7, 2026
Copy link
Contributor

@MatusGuy MatusGuy left a comment

Choose a reason for hiding this comment

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

What about the forest cutscenes? Was this PR created before that? Please rebase it if so.

@Semphriss
Copy link
Member Author

@MatusGuy None of the cutscenes are covered by this PR, neither in the Forest world, nor in the Icy Island, nor any other world. I did not yet play through the game as it is currently, and I would prefer to leave the adaptation of in-game cutscene levels to other people, since I'm unfamiliar with them and may miss some important details.

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.

4 participants