View Single Post
Old 02-13-2012, 09:50 AM   #3
Kitriel
New Member
 
Join Date: Jul 2010
Posts: 10
Kitriel is on a distinguished road
Re: High volume scripting question

First, thanks for the response Dentin.

Second, just to be clear, I don't actually have threading implemented. I tried it, and took it out because at that moment I had no need for it and it just made everything needlessly complex.

The game runs smooth as butter except for this one issue. I accidentally stumbled onto this issue when I implemented randomly generated areas and putting an idle script on each mob in the areas generated. At around 60 idle scripts, the game starts to hiccup every second. At 250 it becomes unplayable. The issue is that all of these idle scripts are being executed at once, and the game has to wait for all of them to finish before it can continue.

I tried staggering them slightly, by tracking the exact millisecond the script executes and adding a second to that(instead of the simple execute all idle scripts each second), so that for example script 1 executes at 0.2sec and script 2 executes at 0.21sec and so on. Although it helped slightly, the issue is still there.

And that's why i'm here, because atm i am just stumped as to what to do or how to fix this.

-Kitriel
Kitriel is offline   Reply With Quote