Team Spartan Cookies & Milk Forums
Questions on global cpu time quota server. - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Starfall (https://teamscm.co.uk/forum-7.html)
+--- Thread: Questions on global cpu time quota server. (/thread-1428.html)

Pages: 1 2


Questions on global cpu time quota server. - Yuri6037 - 26-10-2015

Hey all,

This mainly addresses to anyone who knows global cpu time quota on the server.

I have just a few questions... I'm asking that because I already got that error so many time with a ship with 6 server instances...
On what is based this global cpu time quota calculation ? Is it based on cpuTime() output or is it based on the average ?
What realy is that quota, how does it work ?

And for the last question, a question that I'm not sure anyone will answer...
What is the value set in server config for this quota ?


In the hope of answers to my questions,
Thanks by advance,
Yuri6037


RE: Questions on global cpu time quota server. - Person8880 - 26-10-2015

The quota is based on the average CPU time usage per tick. If you want to monitor your usage, use cpuAverage().

The current quota is set at 1500µs, if you're going anywhere near 100µs consistently you're probably doing something bad.


RE: Questions on global cpu time quota server. - Yuri6037 - 26-10-2015

Well my AI at full combat time (calculate enemy stats/analysis/weapon auto re target) brings the average to 1100 micro seconds plus about 400/500 for my old SG control screen. Without taking care of the other processors...


RE: Questions on global cpu time quota server. - Person8880 - 26-10-2015

That's way too high for something like that. I'd look over what you're doing and consider what is and isn't needed, and also consider not doing it every tick.


RE: Questions on global cpu time quota server. - Yuri6037 - 26-10-2015

I'll tell you what I'm doing :
Enemy analyzing (getConstraints on enemy ship, note that the code is not finished so it's not currently running with the rest of combat systems)
Weapon retarget (that's what pumps much, for loop in think for good precision)
Self test analysis (done on EntityTakeDamage when hits the ship itself, enables alets/do final warp intended to save itself)

By the way, I forget thank you so much for giving me the algorithm used and for the server.cfg variable. I'll make a Starfall screen that will display each 5 seconds my global cup time in % so I know what processor is the problem even if I'm practically sure the problem is LanAI weapon retarget.


RE: Questions on global cpu time quota server. - rouing - 26-10-2015

(26-10-2015, 06:41 PM)Yuri6037 Wrote: I'll tell you what I'm doing :
Enemy analyzing (getConstraints on enemy ship, note that the code is not finished so it's not currently running with the rest of combat systems)
Weapon retarget (that's what pumps much, for loop in think for good precision)
Self test analysis (done on EntityTakeDamage when hits the ship itself, enables alets/do final warp intended to save itself)

By the way, I forget thank you so much for giving me the algorithm used and for the server.cfg variable. I'll make a Starfall screen that will display each 5 seconds my global cup time in % so I know what processor is the problem even if I'm practically sure the problem is LanAI weapon retarget.

Alot of that is very very low usage things.


RE: Questions on global cpu time quota server. - Destiny's Player - 26-10-2015

The first two should only run on setting the target, the third one should only run on EntityTakeDamage. Or something like that, not sure, I'm kinda braindead at the moment.


RE: Questions on global cpu time quota server. - Yuri6037 - 26-10-2015

(26-10-2015, 10:17 PM)Destinys Player Wrote: The first two should only run on setting the target, the third one should only run on EntityTakeDamage. Or something like that, not sure, I'm kinda braindead at the moment.

The third is already on EntityTakeDamage the problem is not here.
The first one will be ran on set target when done (I still need to make some tests in case I'm not allowed to getConstraints on other's entities)
The second must run in think : cause : imagine moving target, how would you retarget ?


RE: Questions on global cpu time quota server. - TheOneAndOnlyTee - 27-10-2015

I loop through my weapons every 0.4 seconds and i've got no problems with moving targets, a think hook for it is just insane.
My weapons usage was about 20-30us but i refined it down to 15-20, ordering the weapons by count; ie i've got 10 beam emitters and 2 torps so i put beam emitter action at the top

Also i wasn't even aware that you could do getConstraints on other people's entities, doesn't that require perms?


RE: Questions on global cpu time quota server. - Yuri6037 - 27-10-2015

(27-10-2015, 02:41 AM)T-17 Wrote: I loop through my weapons every 0.4 seconds and i've got no problems with moving targets, a think hook for it is just insane.
My weapons usage was about 20-30us but i refined it down to 15-20, ordering the weapons by count; ie i've got 10 beam emitters and 2 torps so i put beam emitter action at the top

Also i wasn't even aware that you could do getConstraints on other people's entities, doesn't that require perms?

Well I haven't tested... If you read in details you'll see it's an idea I got.
I'll make some tests with that... By the way I saw find works for all entities even other's entities, so I think it should work with my custom getConstraints.