Author Topic: Help me optimize the command prompt!  (Read 2561 times)

TingThing

  • Admin and Developer
  • Level 20: Nobom
  • *
  • Posts: 1395
  • Creator and Developer of Platform Builder
    • View Profile
    • Platform Builder Home
Help me optimize the command prompt!
« on: October 18, 2020, 07:06:05 PM »
Hi everyone,


I'm working on optimizing the command prompt so that it runs faster in Platform Builder. I think Antikore mentioned some things like removing commands and extra space on compile. That stuff is happening. But there's something else I'm doing too.


The command prompt works by searching through a long list of commands until it finds the one that its looking for. Once it finds the command in the list, it will stop searching and execute the command.


What this means is that I want to have the most commonly used commands to appear early in the list so that they are found quickly.


Could you help me out by commenting below which commands you tend to use most often in Platform Builder? (This also goes for conditionals)


Thanks!
-TingThing

Gizgord

  • average
  • Level 18: Statix
  • *
  • Posts: 835
    • View Profile
Re: Help me optimize the command prompt!
« Reply #1 on: October 18, 2020, 09:12:14 PM »
here's a list of what I (generally) use the most:
  • ground style = athletic/custom
  • swim style = standard/topdown
  • wall jump = 0/1
  • area & world = x, y
  • sfx & fx = x
  • pause/resume music
  • fade out/fade in music
  • timeline = x
  • lens = (...)
  • distance = 1-9
  • follow player1/enemy1/spawn, 1/(...) & view jump
  • screen shake & shake power
  • rain/snow/lighning = 0/1
  • disable/enable player
  • delay (seconds) = x
  • (if) (game) var whatever = x
  • _(Message)/<ID>(Message)
  • enemy1 = item1, etc.
« Last Edit: October 18, 2020, 09:14:23 PM by Gizgord »

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Help me optimize the command prompt!
« Reply #2 on: October 18, 2020, 09:29:47 PM »
It's hard for me to give such a list since I use such a wide variety of commands.

TingThing

  • Admin and Developer
  • Level 20: Nobom
  • *
  • Posts: 1395
  • Creator and Developer of Platform Builder
    • View Profile
    • Platform Builder Home
Re: Help me optimize the command prompt!
« Reply #3 on: October 18, 2020, 10:30:19 PM »
It's hard for me to give such a list since I use such a wide variety of commands.


Can you think of the commands or conditionals that you often use in looping command prompts?

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Help me optimize the command prompt!
« Reply #4 on: October 19, 2020, 01:18:42 AM »
@TingThing I haven't used PB in awhile, and I haven't written commands in awhile either. But I do know that when I was using it a lot, I was using random commands, and as for common ones, I used variables a lot, (a whole lot) and other things, but I used so many, it's hard to put it into a list.

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: Help me optimize the command prompt!
« Reply #5 on: October 19, 2020, 07:33:42 AM »
Command Prompt could run lot faster if using switch statements, however, I think that's not possible maybe...
Here is my list:

  • timeline
  • any variable commands
  • disable/enable player
  • hide/unhide players
  • hud sprite
  • upload sfx
  • area command
  • delay command
  • shake command
  • random bracketing
  • ^ Overhead Text Command
« Last Edit: October 19, 2020, 08:16:35 AM 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: Help me optimize the command prompt!
« Reply #6 on: October 19, 2020, 01:38:45 PM »
which commands you tend to use most often in Platform Builder?
Didn't used PB seriously since Spring 2020, so I can't say. However if you are able to delay this optimization (since it's just build speed after all), you should add a thing to the next version that, if enabled, would check for each export the amount of times each commands is used, and generate a log file that would be sent to you, so you can get information on the most used commands.
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!

TingThing

  • Admin and Developer
  • Level 20: Nobom
  • *
  • Posts: 1395
  • Creator and Developer of Platform Builder
    • View Profile
    • Platform Builder Home
Re: Help me optimize the command prompt!
« Reply #7 on: October 19, 2020, 03:01:06 PM »
Command Prompt could run lot faster if using switch statements, however, I think that's not possible maybe...



Good thinking, yes, and that's what I already do, and then break the switch once the command has been found. It's also divided up into one switch statement for each letter of the alphabet, dividing up the workload further.


Quote
you should add a thing to the next version that, if enabled, would check for each export the amount of times each commands is used, and generate a log file that would be sent to you, so you can get information on the most used commands.


Also good thinking Warrior. I might do that in the future to polish up the command prompt further.