Gdevelop: Ability to nest events under comments

Created on 2 Sep 2018  路  5Comments  路  Source: 4ian/GDevelop

Description

Right now the newIde's event sheet can't do any grouping of events. A workaround is to nest events under an empty event and use the empty event to collapse the nested events. Then add a comment on top - so when its collapsed you know what's inside

Solution suggested

Instead of creating a new type of row, called 'Group', we could simply make it possibe to nest events under comments. The comments could be used to collapse/uncollapse whats nested. That way we have the description+ the ability to collapse

Most helpful comment

I don't understand, groups are already supported right since a long time right? ^^
image
image

They are used to group events in the profiler too: http://wiki.compilgames.net/doku.php/gdevelop5/interface/debugger/profile-your-game so that you know which group are consuming the most computing time when playing the game.
And they can be collapsed.

You can find an example of their usage in the Space Shooter starter.

Am I missing something or is that just that you've not seen that it's already there?

All 5 comments

I think it's a bit dangerous to start mixing comments with sub events as:

  • comments events are considered Non executable, and will be deleted by the preprocessing step when events are translated to code - so will require heavy changes.
  • comments are similar to comments in programming languages, and in an AST (tree representing the source code: https://astexplorer.net/), they are not nodes that can get sub nodes.

So I would be more in favor of analyzing again what is the problem that we're trying to solve here, and fin another solution. Maybe it's groups that are painful to use for some reason?

Closing this now - we can continue discussion but for now I don't consider adding a card on the roadmap as I think there is either a better approach to be find, and comments should stay "pure" of any code generation for simplicity and cleanliness of the architecture/code base.

@4ian perhaps I should rename the thread to ability to create Groups in the event sheet?

A group is kind of like a collapsible folder for events. You can give it a name and toggle its collapsed state.
Both construct and clickteam fusion allow for event grouping - as it allows for better code organisation.
You can that way put player movement for example in a player movement group.

Groups are also great for debugging, as they allow for quick and easy toggling of groups of code - such as player movement for example.

Groups can be enabled/disabled in the runtime - without need to make new variables - so they make the event sheet in general much easier to use. Its great for easy optimisation

I don't understand, groups are already supported right since a long time right? ^^
image
image

They are used to group events in the profiler too: http://wiki.compilgames.net/doku.php/gdevelop5/interface/debugger/profile-your-game so that you know which group are consuming the most computing time when playing the game.
And they can be collapsed.

You can find an example of their usage in the Space Shooter starter.

Am I missing something or is that just that you've not seen that it's already there?

Ah sorry, I initially didn't even notice that we already have them! There is no need for this request at all then. You are right - its bad to mix comments with code

Ok no worries :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Bouh picture Bouh  路  3Comments

Wend1go picture Wend1go  路  5Comments

ced64k picture ced64k  路  4Comments

Jeje2201 picture Jeje2201  路  5Comments

Bouh picture Bouh  路  4Comments