Well, I've taken a look at how the FPSC engine processes the AI scripts, and I've considered a few ways to increase it's performance, however, I neither have the time nor the patience to implement it.
In a nutshell the engine looks like this:
-Parse first line until finding either semicolon or colon
-if semicolon was found, move onto next line
-Label A
-if colon was found, parse next "condition"
-parse until finding either "=" or "," or ":"
-"=" found
----parse numbers or ranges
-"," found
----continue parsing conditions as per the above method
-":" found
----move into "action" parsing, Label B
-Goto Label A
-Label B
-parse actions as we have parsed conditions, until end of line is found
Now... mind you, this is done REAL TIME. From I've uncovered (And this may or may not have been changed) the engine parses AI every loop. It does not store the actions and conditions into an entity array for later recalling. Now, for it to parse the AI like this ALL THE TIME and still get 30+ FPS at all is amazing, by my own standards, lol.
I've considered the fact that the AI scripts could be treated the same as images are in FPSC. Try to find the "faster loading" file type of the script (.dds for the images) and if it cannot find one, then create one. For scripts it would try to find a binary/decimal version of the script file to read and parse or it will parse it RIGHT NOW and create one on the fly for later use. This would:
A) Decrease loading time later on down the road
B) Allow the engine to parse the scripts FASTER, while still doing it on the fly.
Another method I've thought of would be to parse ALL scripts used inside a level, and store them within an array assigned to each entity. I ditched that idea because scripts can become extremely large and FPSC is already memory intensive as it is, WITHOUT having umpteen thousand arrays of measureless capacity. However, if this idea were put to use in a memory safe manner, then it would allow the engine NOT to have to parse scripts on the fly and simply recall them from memory! That could potentially increase framerate with characters on screen practically ten-fold!!!
But, i still think TGC is doing a fine job of getting more and more characters on screen at the same time.
I hope they do more in the future to help out the AI and framerate issues, but one can only hope at this point.
The one and only,
~PlystirE~
Urlforce:
Dude, I'd rather be declared a dbpro noob than an fpsc legend any day!