david-pfx / PuzzleScriptNext

A direct successor to PuzzleScript, building on the work of PuzzleScript Plus, Pattern:Script and others.
http://www.puzzlescriptnext.polyomino.com
MIT License
13 stars 6 forks source link

Level select improvements #79

Open Draknek opened 2 months ago

Draknek commented 2 months ago

I was very confused by this until I realised that in the LEVELS section, the section command comes from PS Plus and the level command comes from PatternScript, and they don't interact with each other - the former is used only by the level select screen and the latter is only shown on the pause menu/main menu.

Additionally, the documentation says about the level command: This name will appear in the pause menu and in the "continue from" option of the title screen. This does not appear to be the case: this name appears in the pause menu but not on the title screen. I don't think there's much value in the name appearing on the title screen, so I think the documentation should be updated and the behaviour should be kept.

IMO there should be an easy way to enable a level select containing every level in the game, without having to manually name them all. That doesn't seem to be possible currently.

Suggestion for short-term fix:

Suggestion for long-term fix:

These are the backwards compatibility edge cases:

david-pfx commented 2 months ago

I agree broadly, and I was kind of waiting and hoping someone would notice and raise an issues. Thanks! There is a point you've missed. SECTION is valuable because it can introduce a group of levels starting with one or more MESSAGEs, and LEVEL from P:S can't do that. And GOTO as defined is just on SECTIONs (I think). My preferences is:

Draknek commented 2 months ago

My instinct is still that they're redundant with each other, and it's confusing to have both.

The functionality of both is basically equivalent to an end-user: they let you name a level. Having two different ways to do that, with slightly different behaviours, is not intuitive.

You should be able to put a LEVEL declaration before one or more MESSAGEs, and it would apply that level name to whichever level follows. I tested this yesterday and it seemed to work (the level name appeared in the pause menu, even if it went LEVEL / MESSAGE / level contents).

Draknek commented 2 months ago

Another level select feature that would be nice is to have the levels shown in a grid rather than a list, so you can fit more onscreen at once.

image

For games with numbered levels rather than named levels, it's a bit cleaner.

https://pancelor.com/PuzzleScript/editor.html?hack=e7402e0b3aa51eaaaa860400edfc0263

This is Pancelor's fork: https://github.com/pancelor/puzzlescript

Note: in this branch, it uses the enable_level_select prelude flag.

david-pfx commented 2 months ago

I think not. Current behaviour (for compatibility with existing PS+ games):

  1. if you use SECTION then only section names appear in the level select screen
  2. user cannot select intermediate levels
  3. message screens appear in sequence within sections. New behaviour: if you enable level select then
  4. all levels appear in the selection screen by name
  5. LEVEL command overrides the default name
  6. MESSAGE screens always appear preceding the following level.
david-pfx commented 2 months ago

Please move level select grid and Pancelor fork to its own issue. It looks worth doing.

Draknek commented 2 months ago

I don't think I follow: do you think SECTION and LEVEL should be different commands with different behaviour because of backwards compatibility, or because there's a valuable distinction for users?

For backwards compatibility, the behaviour I'm suggesting would only affect games which have level_select enabled, and use both SECTION and LEVEL commands, with different values (i.e. every level has a LEVEL but not every level has a SECTION). I am not aware of any such game.

If you think there's a valuable distinction to users, I'd love to hear the use case.

david-pfx commented 2 months ago

The difference is that PS+ games use SECTION and only show SECTION labels in the level_select dialog. The new behaviour is no SECTION, and show all levels in the dialog, using whatever name is available.

Draknek commented 2 months ago

Okay, so the specific case you're worried about is: an existing PS+ or PS Next game uses level_select, and has SECTION names for some but not all levels?

I agree that this is the main backwards compatibility issue to resolve, but it seems unrelated to the question of whether SECTION and LEVEL should be synonyms (with one deprecated) or different.

For this backwards compatibility scenario, these seem like the plausible options for how to handle it:

  1. If at least one level has a name, then only levels with names appear in the level select.
  2. Using level_select in the prelude will only show named levels, but an optional parameter level_select all is added which would enable the new behaviour I'm suggesting.