Code Percentage Scrollbar Notifier for Easier Navigation

Jumping around pieces of code on a crowded event sheet can sometimes be a little cumbersome and precarious. Sometimes I scroll from near the top of the events, down to some point near the bottom. Then going back to near the top it can be challenging to find the exact position. Can take a little bit longer than it needs to.

It’d be useful to have a percentage reference which takes into account the scrollbar and the length of the code.

So if you’re right near the top of the code, somewhere on the screen it’ll display “0%”. Maybe a pop up display on the mouse, or some dedicated area in the editor window. As you scroll down, this percentage display increases to reflect at what percent in the code you’re at. Obviously go all the way down and at the end you hit “100%”. Everything else is interpolated in between. This way, when you need to scroll down to a piece of code, you can quickly remember the percentage that you are currently positioned on, before scrolling down. Once you finished, you can then use the percentage reference to go back up to the previous code. Like a quick reference system that displays the percentage of the code on the position of the scrollbar.

Maybe it’s too much hassle though because the length of the event sheet can always change depending on various factors such as collapsed or expanded groups, new events being added, and so on. So the percentage calculation would have to dynamically adjust to reflect the current state of the event sheet. This might cause some performance issues in the editor so probably not worth it if that’s the case.

1 Like

I can’t argue that it would be useful for many ppl

But for me it would just show me where i am in my code an not help me to find what i want
Since that number would change
Unless it would go beyond 100%
And maybe instead go with Line number

But what i found useful is hiding all events in groups even when they don’t need any
Look how small space it takes when it is collapsed

And look on scrollbar knob on the right if i just expand each tree in touch stuff

And now i can collapse whole touch group and revert back to see all groups

I would say we need better support for groups instead

But i won’t say your idea does not have potential

1 Like

You’re right, groups are really useful too. Although in this case I’m thinking more along the lines of “in the moment” editing, rather than long term reference points. The percentage notifier would be more useful when editing on a session-by-session basis. Groups are more useful as consistent reference points, with an overview of the entire game. The percentage notifier would help to quickly navigate to events for that particular session. When more code is added, the “percentage-to-events” relationship would gradually change. So each session, you would just take note of the percentage for that coding session to quickly hop around.

For example, say I had events near the top of the code and I note that they’re at 10%. These events are somehow linked to events down at 90%, lets say they both use the same variable. During that session, we could edit the 10% code once, then find the relevant code down at 90%. Then make a note of those two numbers. Now we can easily navigate those two areas of the code for that particular programming session. It’d be more useful for in-the-moment editing, if you know what i mean.

There’s another use also… If we could type or select the percentage from a small entry field or selection box, it would cause the event sheet to jump to that position. This “percentage selection box” would be like a alternative way of navigating the event sheet instead of using the scroll bar or page up, page down keys.

Yeah and as i said your idea is not bad
But look imagine 50% (from the top) of your events are idk UI
And another 10% (so 50% to 60%) are movement
Now 60% to 100% are enemies and environment
Imagine you add something to UI events
Imagine you gonna add something below that 100%
Like after 100% you add aesthetic stuff like falling leafs or weather or day night cycle
And how that affect game + player
Imagine you added like 50% more of events atop of what you already had
You won’t have now 150% of events you will still have 100%
You think your movement events will still be at 50% to 60% of events?
Or that UI will still end at 50%?
That is the problem with going for 100%
Line numbers would make sense but that is also if you don’t add something in between them
Because if something is at line 204
And you add 15 lines before it then what was at line 204 will now be at line 219
And exact same problem will occur with 100%
As for going above 100% problem would only start if you add something in between existing events
Where adding only new stuff at the bottom would not affect % of existing stuff

1 Like

Good points but these issues crossed my mind before. The steady build up of work would effect the percentage quite drastically as the amount of code increases. For that reason, it would be more useful as a per-session quick reference guide, as opposed to a reference guide that remains consistent for the duration of the project, which might be weeks, months or even years.

Say every time you load up GDevelop and work on the project, you wouldn’t necessarily refer to the percentage from the last time you loaded the project. Instead you would refer to the new percentages for that specific session. Getting used to the feature, you’d quickly become aware that these percentages would change as you add more code. But on a per-session basis, I think it’d offer a speedier way of jumping to areas of code faster. As you mentioned earlier, Groups are more useful as a consistent reference point throughout the duration of the game dev process. The Percentage Scrollbar is more of a quick reference guide that is expected to adapt as the game code expands. Once the user “knows” that the percentage scrollbar is adaptable as you add more code, they’d be able to use approximate values to quickly jump to areas of the code.

Lets say you have 100 lines of code, and you note that the area of code you’re working on is at 15%. Then you jump down to 90% in the code, and add 50 lines of code. So now you have 150 lines of code. And the code that was previously at 15%, is now located at 10%. But without doing any of that maths, the benefit of the Percentage Scrollbar is that you know the code is before 15% so you can quickly scroll up to 15% and sift back further until reaching the code. Basically I just think it’d speed up the process of jumping to areas of code a bit. It’s definitely not an essential feature, just more of a “workflow multiplier” I guess. Perhaps people wouldn’t even find it particularly useful and it might even be unnecessarily confusing.