how much time is too much?

For AI and campaign script related discussions and questions
Post Reply
Originway
Trained
Trained
Posts: 412
Joined: 08 Aug 2012, 06:22

how much time is too much?

Post by Originway »

just what kind of timings are we supposed to be shooting for with javascript?
is there a good reference that we can check to make sure we don't slow the game down too much?
I saw this post
vexed wrote:Anything above 5ms is way too much. (heck, I would think anything above 3ms, but I am not sure what kind of overhead we have with the script stuff right now.)

While it may not seem like much, once you start adding in more AIs, then that 5ms can quickly climb to 45ms for 9 AI players.

I also think that if a function really is that slow, it would be much better to have support on the C++ side, but it should be a widely used function, and not something specific to the AI in question.
and he says 5 ms is too high? is that correct? how do you quickly calculate that with the max number of units for each player?
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: how much time is too much?

Post by aubergine »

Use the performance log to see how long your script is taking to do things.

Find the event handlers that are slowest and find ways to speed them up.

Using some caching and other tricks you can greatly improve performance, take a look at NullBot 3 for examples.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: how much time is too much?

Post by Duha »

aubergine wrote:Use the performance log to see how long your script is taking to do things.

Find the event handlers that are slowest and find ways to speed them up.

Using some caching and other tricks you can greatly improve performance, take a look at NullBot 3 for examples.
Slow, fast, 5ms, 10ms. All depends of you computer :)
http://addons.wz2100.net/ developer
Post Reply