View Single Post
03-31-09, 07:31 PM   #32
watchout
A Fallenroot Satyr
Join Date: Mar 2008
Posts: 20
More tips:
  • Turn off what you don't need. Think about whether you really always need those 1000 lines of OnEvent/OnUpdate function. Maybe you can split it into smaller functions that you switch on rare events? (like entering/leaving combat or switching gear, etc.)
  • reuse your frames
  • maybe split multiple events on multiple frames so that C-code handles the distribution and you don't have to manually check if it's actually the right event when the handler is called
  • Strings generate their hashes when created - that's pretty fast but it can't hurt to keep string generations at a minimum.
  • Use numbers over strings where possible.
  • Don't create functions that are called only directly (that means not through some table like I did in my example above) and in one place.
  • Memory usually comes cheap, while processor time is expensive.
@Aezay: of course, I just saw it and... just... had to say it... aaah the dark side of the force is beckoning!
  Reply With Quote