Action to remove external layout would be great optimization for big maps


#1

First of all Im talking about a single object(platform) that is created multiple times on the map, so you cannot add function to recreate them all in their exact position, even if possible it would take too long to add actions to create hundreds of objects each in their exact position.

Second of all I have tested it works, it optimizes, If I have hundred objects and then I add few hundred more by external layout the game slows, so opposite will definitely work.

Some games with too many collision objects or big maps will be able to remove unused objects offscreen and recreate them back in the same position when player returns to them.

For Example I have hundreds of Platforms made by the same object:

Right now there is a way to remove objects offscreen but they are not created back. And there is way to remove object by action, but it will remove all the objects in that object.


How to load part of the map or objects when you reach at a certain point? for performance reasons
#2

we talked about this already if you remember

there isnt much performance to be gained.

what you want to do, you can archieve by giving each of your platforms a variable, according to what layout there in.

since you must have a positioncheck for the player in place already to load the layouts, you can use them to delete the platforms too.


#3

Look “giving each of your platforms a variable” I don’t know how to and I have hundreds of platforms, if I have to add each, it would take very long, I think.

And “there isn’t much performance to be gained” If your saying that gdevelop engine already removes offscreen objects & remembers their positions and adds them onscreen? Then in external layout it doesn’t need to remember their positions(saving power), as you can load & unload many objects+ position in one action


#4

to give them a variable, click the object and the object property window to the left pops up.
there you give the object the variable that is the number of your layout.


clicking thru hundres of platforms is annoying, but by no means too long.

GD has to remember the object and its position, otherwise it couldnt be loaded. That is also true for external layouts.


#5

Thanks for explaining, I got it its easy

I will test performance with this vs external layout and will update here, maybe even make a video about it if external layout has better performance.


#6

keep in mind, that you give the variable to the object inside the layout.


#7

You could also at the beginning of the scene select a chunk of object and add the variable for them. About the feature. Many new users might not know much in-depth about object variables and IDs. So, this might make it accessible to them. But, this might not be able to be used with all the game’s. Like, if you are literally making an object not be there or being processed. When, it is loaded back in, it might bring lag depending upon the complexity and size. And also, you will also have to save the state of that layout and it’s object if it would be loaded back in and also assign those back to it. And also the GDevelop script is more made for a game where the object is always accessible and not removed time to time and added back in. But still, for those some times this might come in handy, it will be a game changer


#8

this wouldn’t work in this case (external layouts), since most of the platforms are not there at the beginning of the scene.


#9

Selecting and saving Chunk of objects = External layout

but easier in external layout as you just copy paste(from scene to external layout)


#10

Oh, I forgot it was about external layout. I thought it was removing chunks and reloading them :sweat_smile: