Would the game increase in performance if I used Integers instead of Real variables? For instance, I have the shields set at 100.00%. Shields regeneration is based on the efficiency of another variable, the Shield Generator, and the speed of its repair is based on the Crew Complement. Imagine this with all the other functions of the Battlestar, such as Weapons, Engines, Hull, etc.. If I used all integers and started with a large number like 100000 and when it comes to display it, I just show the value divided by 1000, would that help any?
Also, I have a bunch of logic statements that are have multiple conditions and/or nested if's. Which one is theoretically faster?
- Code: Select all
if (condition1)
{
if (condition 2)
{
if (condition 3)
{
perform function;
}
}
}
or:
- Code: Select all
if (condition1 && condition2 && condition3) perform function;
I'm assuming the first one would be faster, even though the code is longer, since it only has to perform the first condition test and bypass the rest. Then, it would have to be up to my logic to make sure I ask the right question (test) in the right order.
But, according to GE, which would perform better?
Thanks.