4ian / GDevelop

🎮 Open-source, cross-platform 2D/3D/multiplayer game engine designed for everyone.
https://gdevelop.io
Other
10.48k stars 836 forks source link

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

Open tristanbob opened 2 years ago

tristanbob commented 2 years ago

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.
  1. While the leaderboard is loading and being displayed, the existing scene is still running.

@AlexandreSi

AlexandreSi commented 2 years ago

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

4ian commented 2 years ago

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.

tristanbob commented 2 years ago

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.

PascalLadalle commented 1 year ago

👋 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.

AlexandreSi commented 1 year ago
  • 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?

PascalLadalle commented 1 year ago

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