Re: High volume scripting question
Kitriel,
Instead of scheduling the events to happen one second from now, schedule them to happen at 1 second plus or minus 200 ms. This way your long term timing at once per second will be preserved, but after a very few iterations they'll be spread out all over the place instead of bunched up.
However, I think you've answered your original question: if the server and/or machine is becoming unplayable at a mere 250 scripts per second, then you simply cannot do high-volume scripting with the tools you've picked. Lua is powerful and convenient, but it's interpreted; it's not designed for speed or performance. If you really want to do high-volume work, you'll probably have to switch to a higher speed language like C.
Good luck!
-dentin
Alter Aeon MUD
|