Add cutscene property for levels (title screen, credits, in-game cutscenes)#3536
Add cutscene property for levels (title screen, credits, in-game cutscenes)#3536Semphriss wants to merge 2 commits intoSuperTux:masterfrom
cutscene property for levels (title screen, credits, in-game cutscenes)#3536Conversation
swagtoy
left a comment
There was a problem hiding this comment.
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 :)
|
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. |
|
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. |
|
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. |
|
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? |
|
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. |
|
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.
|
@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. |
|
I think it should be fine for now. Ill review in a bit. Thanks for all your work!!! '-'7 |
cutscene property for levels (title screen, credits, in-game cutscenes)
MatusGuy
left a comment
There was a problem hiding this comment.
What about the forest cutscenes? Was this PR created before that? Please rebase it if so.
|
@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. |
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.