I am a novice Gdevelop 5 user and currently I am learning how to create a game with multi scenes. I found that I can simply copy and paste an existing scene, rename it, edit its objects to create a new scene. This will also copy all the events, conditions and their associated actions. I found this option easier since I only have to change the objects in the new scene to create a new level. Also, any changes to a given scene does not impacts other scenes.
I would like to know what are the pros and cons of using this approach to create levels vs. creating levels using external layouts when most of the events and objects in my levels are similar (except their placements and sprites). Is there any performance or other impact to the overall gaming experience?
I found it little inconvenient to start designing a level all over again with external scenes (since it only copies all the objects in the scene, not their placements and their related events).
Please forgive me for asking this question in the âOpen Topicâ category as I did not find any other category to ask your opinion.
The issue here is that if you need to change an event that affects all the scenes, you have to open all the scenes and modify each one. Or if you want to add another object, it has to be added to each scene (unless itâs a global object).
The way around this is to use an external event, and link to that event from each scene. Then it becomes one set of events used across multiple scenes.
An advantage of external layouts is that if you have the same set of events for multiple levels, then you need just one scene that creates the playing objects from the external layout, and so again only have one set of events. And if you add an object to the scene, it is automatically available in the external layouts.
Another advantage is that you can combine multiple external layouts in one scene. So your UI which would be pretty much the same for each level, mixed with a different background based on whatever level is being played. You can even define a number of different enemy formations in an external layout and then add one or some of them to the scene as you need them.
Great suggestions! I like the idea of using an external event and link it from each scene.
I tried creating objects from an external layout, but was unsuccessful. I am sure I must be doing something wrong, but I like the concept of editing the layout once and re-using it in different scenes.
How are you creating the external layout objects? Remember the external layout has to have the scene thatâs using it as the base scene, and it has to be done once (beginning of scene is the usual way):
Where are the external objects positioned? Do the objectâs co-ordinates fall within the window that the scene starts with?
For example, if your object is placed at 1000,1000, but your resolution is 800x600, then it wonât get displayed until you move the scene camera. Where you position the object in the external event is where it gets placed in the scene.
Also, is the scene that uses the external layout also the scene that is set as the base for the external layout?
I did a little digging and found the following simple flow for global events/layouts:
Create a Base Scene with UI and events.
Create an External Layout with Base scene as its base. This will create a new layout with all objects and events used in the Base Scene. In fact, External Layout does not have an event sheet, it points to Base Scene Events.
You can create a new Derived Scene and use the External Layout by adding âCreate Objects From External Layoutâ with event " At the beginning of the scene. The objects will only appear in the Derived Scene if they are set as global objects.
You can link events in the Derived Scene from the Base Scene using âInclude events from the Base Sceneâ.
Any objects added/modified in the Base Scene layout and events will be automatically reflected in the External Layout. However, they will only appear in the derived scene if the object added/modified is set as global object.
Any objects added to External Layout will not impact Base Scene even if they are set as Global objects. They will only appear as Global objects in the object explorer of the Base scene. You can add them to the Base Scene if you want, but any changes to the Base scene will impact External Layout. So you may end up creating unnecessary duplicate objects.
You can continue to create new objects/events in the derived scene which are specific to that scene.
If you delete the Base Scene, the External Layout has to be linked again with the new scene.
If you add an object to the external layout, it is added to the base scene. The objects listed in the external event object panel are those from the base scene.
This is not what I have observed. I have cross verified with a sample Base Scene and External Layout and hereâs what I got:
Any object added to the Base Scene will appear in the External Layout not vice versa. Any object added to External Layout will not appear in the object explorer of the Base Scene unless it is added as a Global Object in the External Layout.
Even if the Base Scene has the Global Object in the object explorer, it will not show up in the scene unless explicitly added.
Any objects added to External Scene will not impact Base Scene even if they are set as Global objects.
I donât now what you are doing, but if you add a sprite to an external layout, it is added to the associated scene, not to the external layout. The external layout only uses the objects available to itâs associated base scene.
I might be mistaken, but I think what MrMen is saying hereâŚ
âŚis that rather than creating a new Scene for each Level,
you should instead create a new External Layout for each Level,
& load the appropriate External Layout for the appropriate Level.