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

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • 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

War

  • "The top player is here!"
  • Level 20: Nobom
  • *
  • Posts: 1490
    • View Profile
    • My website
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
Hey, wassup wassup? My name is Warrior555MainsGanon (but just call me War) and I'm the main guy behind Megaman Zero Online and the upcoming Matt's Adventure! I don't speak often here but I'm a very friendly lad so if you wanna talk, don't hesitate!

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • 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

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
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 22: Trex
  • *
  • Posts: 2020
  • 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