This is the package I've been using for my tests in the http://www.gamesas.com/index.php?/topic/1139867-script-optimisation/ thread on this forum. Hopefully anyone else interested in investigating script efficiency will find this useful.
Cipscis' Code Comparer - CCC
CCC is a scripter's utility that allows two code segments to be easily compared with one another. It consists of a standalone plugin file (CCC.esp) which can be activated anywhere in your load order, and a batch file called test.txt which should be placed in your "fallout new vegas" directory (not your Data folder).
In order to set up a test, you'll want to edit CCCQuestScript in CCC.esp. The sections of the script where you should enter your code are marked via comment, and you should be able to leave the rest of it alone for most tests. Once you've got your script ready, there are a few global variables that you might also want to tweak:
- CCCAutoRepeat
1 by default. If set to a non-0 value, after running a series of tests at a certain number of iterations per frame, another test will automatically be initiated at a different number of iterations per frame. Tests will continue until the frame rate of one of the tests drops below CCCMinFrameRate (in fps)
- CCCFramesPerTest
50 by default. The length of each test, including the buffers before each test, in frames.
- CCCHotkey
49 (N) by default. Specifies the key to press to initiate the test.
- CCCIterationsPerFrame
- 0 by default. The number of times each segment of code will run per frame (except when <=0, where it will run once per frame). If CCCAutoRepeat is set to a non-0 value, it will increment itself automatically after each series of tests.
- CCCIterationsPerFrameIncr
- 500 by default. The value that is added to CCCIterationsPerFrame after multiplying it by CCCIterationsPerFrameMult when automatically incrementing CCCIterationsPerFrame if CCCAutoRepeat is set to a non-0 value.
- CCCIterationsPerFrameMult
- 1 by default. The value that CCCIterationsPerFrame is multiplied by before incrementing it by CCCIterationsPerFrameIncr when automatically incrementing CCCIterationsPerFrame if CCCAutoRepeat is set to a non-0 value.
- CCCMinFrameRate
30 by default. After the frame rate of one of the tests drops below this value, automatic tests will stop. You'll want to edit this value depending on what sort of baseline frame rate you're experiencing at the time.
- CCCNumCodeSnippets
2 by default. The number of code snippets to compare. No more than 3 are currently supported, although CCCQuestScript can easily be extended to compare more code snippets.
- CCCNumTests
5 by default. The number of times to repeat a test before incrementing CCCIterationsPerFrame. If CCCAutoRepeat is set to 0, only this many tests will be run.
- CCCQuitWhenComplete
1 by default. If set to a non-0 value, New Vegas will automatically quit once your tests have completed. If set to 0, the console will be opened instead.
Once you've got everything set up, I recommend using test.txt to set you up in a controlled environment and specify an output file (Output.txt by default). To do this, start Fallout New Vegas and open the console as soon as you're able to. Then, run the following console command:
bat test
You should then be moved to the testing cell called TestJoshWeapons. Once you're here, press the hotkey specified by CCCHotkey (N by default) and leave all other controls alone. You'll hear the noise of the Pip-Boy light being turned on after each set of tests, and once all tests are complete you'll hear the level up noise and the console will open. I recommend quitting right after this so as not to clutter your output file with more console input/output.
If you leave the controls alone in GameMode for 2 minutes, the vanity camera will activate. I've included another plugin (Disable Vanity Camera.esp) with this package that you can use to effectively disable the vanity camera for tests running longer than 2 minutes.
Once your tests are complete, you can find your output file (Output.txt by default) in your "fallout new vegas" folder.
If you have any questions, suggestions, or feedback, you can contact me as Cipscis on the BGS or Nexus forums, or via email at mark@cipscis.com
CCC is a scripter's utility that allows two code segments to be easily compared with one another. It consists of a standalone plugin file (CCC.esp) which can be activated anywhere in your load order, and a batch file called test.txt which should be placed in your "fallout new vegas" directory (not your Data folder).
In order to set up a test, you'll want to edit CCCQuestScript in CCC.esp. The sections of the script where you should enter your code are marked via comment, and you should be able to leave the rest of it alone for most tests. Once you've got your script ready, there are a few global variables that you might also want to tweak:
- CCCAutoRepeat
1 by default. If set to a non-0 value, after running a series of tests at a certain number of iterations per frame, another test will automatically be initiated at a different number of iterations per frame. Tests will continue until the frame rate of one of the tests drops below CCCMinFrameRate (in fps)
- CCCFramesPerTest
50 by default. The length of each test, including the buffers before each test, in frames.
- CCCHotkey
49 (N) by default. Specifies the key to press to initiate the test.
- CCCIterationsPerFrame
- 0 by default. The number of times each segment of code will run per frame (except when <=0, where it will run once per frame). If CCCAutoRepeat is set to a non-0 value, it will increment itself automatically after each series of tests.
- CCCIterationsPerFrameIncr
- 500 by default. The value that is added to CCCIterationsPerFrame after multiplying it by CCCIterationsPerFrameMult when automatically incrementing CCCIterationsPerFrame if CCCAutoRepeat is set to a non-0 value.
- CCCIterationsPerFrameMult
- 1 by default. The value that CCCIterationsPerFrame is multiplied by before incrementing it by CCCIterationsPerFrameIncr when automatically incrementing CCCIterationsPerFrame if CCCAutoRepeat is set to a non-0 value.
- CCCMinFrameRate
30 by default. After the frame rate of one of the tests drops below this value, automatic tests will stop. You'll want to edit this value depending on what sort of baseline frame rate you're experiencing at the time.
- CCCNumCodeSnippets
2 by default. The number of code snippets to compare. No more than 3 are currently supported, although CCCQuestScript can easily be extended to compare more code snippets.
- CCCNumTests
5 by default. The number of times to repeat a test before incrementing CCCIterationsPerFrame. If CCCAutoRepeat is set to 0, only this many tests will be run.
- CCCQuitWhenComplete
1 by default. If set to a non-0 value, New Vegas will automatically quit once your tests have completed. If set to 0, the console will be opened instead.
Once you've got everything set up, I recommend using test.txt to set you up in a controlled environment and specify an output file (Output.txt by default). To do this, start Fallout New Vegas and open the console as soon as you're able to. Then, run the following console command:
bat test
You should then be moved to the testing cell called TestJoshWeapons. Once you're here, press the hotkey specified by CCCHotkey (N by default) and leave all other controls alone. You'll hear the noise of the Pip-Boy light being turned on after each set of tests, and once all tests are complete you'll hear the level up noise and the console will open. I recommend quitting right after this so as not to clutter your output file with more console input/output.
If you leave the controls alone in GameMode for 2 minutes, the vanity camera will activate. I've included another plugin (Disable Vanity Camera.esp) with this package that you can use to effectively disable the vanity camera for tests running longer than 2 minutes.
Once your tests are complete, you can find your output file (Output.txt by default) in your "fallout new vegas" folder.
If you have any questions, suggestions, or feedback, you can contact me as Cipscis on the BGS or Nexus forums, or via email at mark@cipscis.com
http://www.newvegasnexus.com/downloads/file.php?id=37129
Cipscis
EDIT:
Added support for up to 3 code snippets to be compared (easy to add more, but I haven't needed to yet) and the option to automatically quit after the tests have finished.
Cipscis