Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

Livecoding for GameMaker: Studio / GameMaker Studio 2 · By YellowAfterlife

[Answered] Step event is slow (when many instances in the room)

A topic by Pauloondra created Sep 26, 2020 Views: 494 Replies: 4
Viewing posts 1 to 3
(1 edit)

Without writing  " if live_call() return live_result; "  my object's Step event is performing normally with room speed=60. But with this line of code, it's something like 20 steps per second.

Is it ok? You also should know that there're about 100 instances of that object slmultaneously in the room.

Developer(+1)

As per Limitations section in documentation, "live" code is generally slower than native GML - this is perhaps the most visible on code that does a lot of variable access, which is very optimized in compiled GML, but can only be implemented via (relatively slow) variable_ functions in GMLive.

(+1)

Spasibki :)

(1 edit) (+1)

My advice:

  • if there’s a part of code which you not gonna touch in same event, make a separate script for it
  • avoid using too many for-loops in live code. Again - if some part is already completed, move it rather to some script (you don’t need to change code in any way, as it will be run in context of event) and keep the smallest amount in code you want to modify.

I’ve got one object which have around 10 nested for-loops inside, and I’m getting 2FPS cause of it, so above solutions helped me a lot.

Good advice, thanks!