Limit to the number of console functions?
by Matthew "Ashteth" Kee · in Torque Game Builder · 06/16/2008 (6:22 pm) · 3 replies
My game seems to crash when I add above a certain number of console functions to the C++ code. When I remove console functions (it doesn't matter which ones) the game runs fine. Any thoughts on why this would occur and has anyone else encountered something similar?
#2
ConsoleFunctions: 2714
ConsoleMethods: 2044
It appears that when I have somewhere in the neighborhood of 2600~2700 console functions, the program crashes before even loading. When I remove console functions and recompile (it doesn't matter which console functions), the program goes back to functioning normally. Keep in mind that none of the Console Functions should even execute without user input from a command prompt. When functioning normally, my game does nothing but load a command prompt and wait for input. This is a weird problem because I can cause my program to crash by adding a console function that does nothing and is never executed. This is why I am wondering if there is a limitation as to how many functions the TorqueScript virtual machine can handle. It doesn't seem like I have a ridiculous number of functions.
06/17/2008 (12:56 pm)
Doing a quick search, my code currently has these C++ functions:ConsoleFunctions: 2714
ConsoleMethods: 2044
It appears that when I have somewhere in the neighborhood of 2600~2700 console functions, the program crashes before even loading. When I remove console functions and recompile (it doesn't matter which console functions), the program goes back to functioning normally. Keep in mind that none of the Console Functions should even execute without user input from a command prompt. When functioning normally, my game does nothing but load a command prompt and wait for input. This is a weird problem because I can cause my program to crash by adding a console function that does nothing and is never executed. This is why I am wondering if there is a limitation as to how many functions the TorqueScript virtual machine can handle. It doesn't seem like I have a ridiculous number of functions.
#3
I don't have access to TGB right now, but I think you could trace the "ConsoleFunction" macro backwards and see what happens upon loading.
06/17/2008 (4:05 pm)
They may not be used, but they must be initialised. If you examine a "ConsoleFunction" or a "ConsoleMethod", you will notice that they are macros for other functions. These functions are loaded into the TorqueScript methods for use within the game during initialisation which is probably where your problem lies.I don't have access to TGB right now, but I think you could trace the "ConsoleFunction" macro backwards and see what happens upon loading.
Associate James Ford
Sickhead Games