Database Control Pro Documentation
Version 1.0.0 onwards



Contents > Using the Sequencer Window > Command Sequence Efficiency
Command Sequence Efficiency

Some Commands take longer to run than others. Obviously, you want your Command Sequences to be as quick as possible in your game so you need to make sure you are being efficient. Also, long Command Sequences might timeout and not be completed.

The Commands you want to avoid using as much as you can are Get Data and Set Data. These take the longest as they are reading and writing data from/to the database. Also, the Time Diff Command can take some time as we use an extension for this which needs to be initialized. And obviously, if used incorrectly the worst of them all is the For Command, especially if it contains some longer Commands or is having to do a huge number of iterations.

In a sequence, if you need to use a Command, sometimes the only option is to use it. If this is the case then you should think about limiting the number of times it is run. 'If' Commands are useful for this. For example, if you are iterating down the rows of a database and getting usernames and passwords to log in a user, you might have two Get Data Commands one after the other. This is bad because, both will be run in each iteration when they don't need to be. Instead you should have the Get Data Command for the username, then check the username with an If Command and inside the If Command have the second Get Data Command to get the password. This means the second Get Data Command will only be run once for the row with the correct username, rather than every single row.

If, String Ops and Float Ops Commands, are generally quite quick to run. So, sometimes you might be able to replace other Commands by these. For example, you have a Time Diff Command getting a time difference in minutes, then another Time Diff Command getting exactly the same time difference in seconds. It would be much more efficient to use a Float Ops Command instead of the second Time Diff Command. You can simply multiply the first result by 60 to achieve the same result of the second Time Diff Command.