Author Topic: Tips & Tricks for Optimization  (Read 643 times)

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 21: Magmus
  • *
  • Posts: 1984
  • Total likes: 163
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Tips & Tricks for Optimization
« on: February 10, 2020, 12:25:30 PM »
Platform Builder it's quite laggy right now. It has been laggier, but even with the fixes TingThing made, still we need from our own code to be most optimized as we can.

Here are some tips & tricks:

1.- Avoid looping increases performance:
Looping decreases performance a lot, for example, when using custom huds, performance decreases a lot if we update the hud constantly. To fix this, instead, update the hud parts when something has changed it. If you collect a coin, you update the coin counter in the hud, but not constantly. I checked this and it's impressively helpful. If you use looping only when it's necessary, performace will be very better.

2.- Avoid cluttering a lot of tiles in the screen:
Tiles seems to break performance, when you use a lot of tiles and you can see 'em all within the screen.

3.- Minimize code as you can
Less lines of code easier for PB to execute them.
« Last Edit: February 10, 2020, 12:26:11 PM by Antikore »
Sorry because my English is not very good because I'm Spanish ;) :P

warrior

Re: Tips & Tricks for Optimization
« Reply #1 on: February 10, 2020, 12:43:34 PM »
Platform Builder it's quite laggy right now. It has been laggier, but even with the fixes TingThing made, still we need from our own code to be most optimized as we can.

Here are some tips & tricks:

1.- Avoid looping increases performance:
Looping decreases performance a lot, for example, when using custom huds, performance decreases a lot if we update the hud constantly. To fix this, instead, update the hud parts when something has changed it. If you collect a coin, you update the coin counter in the hud, but not constantly. I checked this and it's impressively helpful. If you use looping only when it's necessary, performace will be very better.

2.- Avoid cluttering a lot of tiles in the screen:
Tiles seems to break performance, when you use a lot of tiles and you can see 'em all within the screen.

3.- Minimize code as you can
Less lines of code easier for PB to execute them.
Everyone should follow these tricks else their games succs

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 21: Magmus
  • *
  • Posts: 1984
  • Total likes: 163
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Tips & Tricks for Optimization
« Reply #2 on: February 10, 2020, 12:47:07 PM »
Yeah!
Sorry because my English is not very good because I'm Spanish ;) :P

Christian Game Maker (CGM)

  • Christian, videogame dev hobbyist. Servant of Jesus Christ.
  • Master Builder
  • *
  • Posts: 3833
  • Total likes: 70
  • The way of the Cross leads home.
    • View Profile
    • The Adventures of Super Mike Website (ASM)
Re: Tips & Tricks for Optimization
« Reply #3 on: February 10, 2020, 02:07:22 PM »
Looping commands aren't a problem, but tiles are. You need to use expandable tiles every time it makes sense.

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 21: Magmus
  • *
  • Posts: 1984
  • Total likes: 163
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Tips & Tricks for Optimization
« Reply #4 on: February 11, 2020, 12:26:31 PM »
Looping commands aren't a problem, but tiles are. You need to use expandable tiles every time it makes sense.
Looping commands are more a problem than you can think.
Sorry because my English is not very good because I'm Spanish ;) :P