- Wed 23 Aug 2017, 08:56
sleeper_service wrote:Also another question: From your experience, what are the most stressing conditions and actions the event editor uses?
It depends on a lot of things, but basically it's really chronometers : i don't use anymore actions and conditions related to this, i only use TimeDelta() custom chronometer, wich is really lighter. I also avoid to use mutliple chronos, sometimes you have to create one for each objects when it's AI related, but for some case, a global chromometer is enough for multiples things (refreshing UI for example).
Refreshing text is really stressfull if you have a lot of values : it's not always related to the game, but i use a custom "debug feature" in my projects to display every parameters of objects in realtime, and it's really stressful if you have a lot of objects, so it's needed to limit text refresh.
There is no action really stressfull, it always depends on the numbers of objects affected, and the complexity of the script. I really often make stress test : for example, i spawn 400 enemy entities and look how does it react ; i check in realtime each loops and group of events, and i try to reduce it to the maximum with the tips i given previously.
The most consuming things that i saw is using a lot of concatenations in variables conditions, used in sub event, sub event, sub event in a "for each" main loop, but there is nothing you can do on it. I'm also a bit "mad" with it since i use it a bit like SQL with tons of structures variables
Performance on events is something, but you should also take a look on global ms for the display render (and fps of the game wich can drop sometimes) : using particules extensions for explosions for examples can create fps drop (with too much particles/objects created). Optimize your images, for both sprites/mosaic/particles, don't use png and transparency when it's not needed, optimize your png with tools like Tinypng to reduce the file weight (and destroy useless pixels information that even photoshop/gimp keep : transsparent pixel aren't deleted, they just have maximum alpha channel value set).
Also, and last tips, i always chase for undeleted object : sometimes and i've never figured how/why, some object that should be destroyed aren't (for example you destroy an ennemy, destruction generated 3/4 objects (explosions/lights/etc.) or even your projectile). In the order of event, it should be destroyed, but not.. it's often related to particule objects, and even if you have picked "self destruction" of the object when the capacity number of particles is over .. For it, the only solution is to check the debugger objects list, and after try different order/sub order for the events.
I hope this will be helpful. For now my projects are sleeping because of the bug i've spotted few months ago. I always have memory leak problem in IDE preview, and it's related to external events.... i'm waiting for new Gdevelop version to support native games.
And then, i discovered GDevelop !