GDevelop icon indicating copy to clipboard operation
GDevelop copied to clipboard

Leaderboard improvements (block input while loading, add "pause scene" option)

Open tristanbob opened this issue 2 years ago • 3 comments

Description

Leaderboards are very simple to implement; they can even be displayed on top of existing scenes. However, there are a few things that can make this even better.

  1. While the leaderboard is loading, there is a period of time when the existing game interface is still active and responding to clicks. This can cause unintended actions to take place.
  • [ ] Inputs to the game should be blocked while loading the leaderboard the same way they are blocked while the leaderboard is displayed.
  1. While the leaderboard is loading and being displayed, the existing scene is still running.
  • [ ] Why not offer the ability to pause the active scene? I think this would make sense as a boolean parameter to "Display leaderboard". "Pause scene while leaderboard is shown?"

@AlexandreSi

tristanbob avatar Jun 05 '22 21:06 tristanbob

Thanks for the suggestions!

  1. While the leaderboard is loading, there is a period of time when the existing game interface is still active and responding to clicks. This can cause unintended actions to take place.

Do you confirm that this only applies when you use the built-in loader? Good idea for the inputs!

Why not offer the ability to pause the active scene?

Seems legit!

I'll have a look during the week

AlexandreSi avatar Jun 06 '22 15:06 AlexandreSi

From what I remember, the built in loader, when trying to modify it to prevent click on the game, was also triggering something different: the game was thinking (because it's not receiving clicks/mouse events anymore) that the mouse button was still pressed. This was unintuitive from the persepective of events. But something to look at for sure: ideally we want the loader to prevent clicks and not have this issue of the game thinking the button is still pressed.

4ian avatar Jun 07 '22 09:06 4ian

I do know that the game thinks the cursor is static while the leaderboard is up. I discovered this because I had some text moving up and down with sine-movement and added a sound when the user hovered the cursor over the text.

While the leaderboard was up, I noticed that the "hover" sound was playing occasionally. I realized the game was moving the text on and off the cursor position.

tristanbob avatar Jun 07 '22 14:06 tristanbob

👋 I'm giving the leaderboard feature a try and I have a few requests/issues. My levels are procedurally generated, so I made a leaderboard scene as explained in the wiki, and I want to switch to that scene for each level.

  • I'm trying to use the leaderboard instructions using the expression "Leaderboard_"+ ToString(GlobalVariable(level)), and it's not working. Is this expression feature only compatible with the leaderboard number id? I haven't seen this mentioned, and it's quite inconvenient.
  • It would be nice to be able to duplicate leaderboards in the leaderboard editor. I mean create a new leaderboard with the same parameters as the one currently displayed, with a new ID of course, and a new or incremented name.
  • The Delete pop-up closes the leaderboard editor, whether you confirm, cancel or click anywhere. Is this on purpose?

PascalLadalle avatar Dec 12 '22 23:12 PascalLadalle

  • I'm trying to use the leaderboard instructions using the expression "Leaderboard_"+ ToString(GlobalVariable(level)), and it's not working. Is this expression feature only compatible with the leaderboard number id? I haven't seen this mentioned, and it's quite inconvenient.

Indeed, it only works with the leaderboard id at the moment. I see why you would be interested in such a feature.

  • It would be nice to be able to duplicate leaderboards in the leaderboard editor. I mean create a new leaderboard with the same parameters as the one currently displayed, with a new ID of course, and a new or incremented name.

That's a good idea, I'll see how/where we can put a button for that.

  • The Delete pop-up closes the leaderboard editor, whether you confirm, cancel or click anywhere. Is this on purpose?

I couldn't reproduce this bug. Could you send a video of this bug happening?

AlexandreSi avatar Dec 13 '22 15:12 AlexandreSi

Thanks for the feedback!

@arthuro555 suggested on the Discord that I might be able to create new leaderboards on the fly through the GD API. Any chance of this happening inside GDevelop, or is this prone to causing overloads/issues on the server side if people misuse it? My game is supposed to have an infinite number of levels, so ideally, new leaderboards would be created only when necessary (highscore to submit).

Here's a video of the issue I mentioned. Looks like Windows recording app doesn't show clicks, but you should see what I meant. https://user-images.githubusercontent.com/25978830/207396103-9e10bfb4-0989-4dbe-8017-703e7dd7bc94.mp4

PascalLadalle avatar Dec 13 '22 17:12 PascalLadalle