Like everyone else, I use a 3D camera and WASD movement.
I'm looking for some ideas to make it go faster, since this trigger is run a total of 1200 times per second across all players.
I have:
- Several separate triggers that set a bool[12] to true when you press the key and to false when you release it.
- A trigger that:
Puts the booleans into a bitfield (0-31)
Executes a switch statement
Each switch option sets the destination point based on unit move/backpedal/turn/strafe speed (may be 0) and the destination angle based on turn speed (may be 0);
Then move unit to (point) facing (angle).
I looked at another third person demo map and it seemed to use a giant stack of if(and(each of the four keypresses)) then triggers. Is this faster than the bitfield + switch approach? My way seems faster because the most common inputs are 'nothing' and 'only forward' which are 0 and 1 respectively, ending the switch statement early. But then I'm not a programmer.
In War3 it was often said that you had to 'drop out of the GUI to optimise your code for speed' but what is it you can do in Galaxy that the GUI won't do?
Like everyone else, I use a 3D camera and WASD movement.
I'm looking for some ideas to make it go faster, since this trigger is run a total of 1200 times per second across all players.
I have: - Several separate triggers that set a bool[12] to true when you press the key and to false when you release it.
- A trigger that:
I looked at another third person demo map and it seemed to use a giant stack of if(and(each of the four keypresses)) then triggers. Is this faster than the bitfield + switch approach? My way seems faster because the most common inputs are 'nothing' and 'only forward' which are 0 and 1 respectively, ending the switch statement early. But then I'm not a programmer.
In War3 it was often said that you had to 'drop out of the GUI to optimise your code for speed' but what is it you can do in Galaxy that the GUI won't do?