Post 21 May 2013, 13:57 by Lewin
If we go ahead with using markup for text then we can enable strings (and string arrays) in global variables so that might help.
You can do more load balancing than just calling HighCPUloadTextCreation every 30 ticks. Only update 1 player every 5 or 10 ticks, as Krom suggested. Regarding performance, it doesn't matter if your function only runs every 30 ticks or every single tick, if it takes too long to run it will still cause some lag. Lag every 3 seconds is almost as bad as continuous lag from the player's perspective. At 1x speed we need to do 1 tick per 100ms. So we get 100ms to do game logic updates and script OnTick, then leftover time is used for rendering. If we don't finish the game logic or script OnTick within 100ms then the next tick will be delayed, causing lag. So you should try to spread the load over multiple ticks, rather than just making it run less frequently.