Open pandaro opened 8 years ago
Yeah, same.
I don't think it's your commits today, I noticed lag yesterday
Never mind. What I thought I was noticing was just my antivirus software or something. When did you start noticing more lag in the late game?
Ugh, yes, huge spikes in cpu usage in the late game. I think it will be extremely tedious to find the cause, because the symptom doesn't arise until very late in the game.
hm i can only seem to reproduce it with more than one AI team
can you check your commits of 19/7, maybe is here
you mean https://github.com/eronoobos/BABAR-The-Shardifant/commit/d35126a6d13d4930701f99f03423c5ed7131f326 ? or the day before?
i've narrowed it down to either defenders or attackers. if i destroy every attacker/defender the lag goes away, and comes back if i give some. possibly my new attack movement algorithm is just that expensive?
except that everything is smooth in the early game, even if i give it a bunch of attackers
you mean d35126a ? or the day before?
yeah i referred to this, but was just an idea. I try to find out where are jump out the dog from the grape.
so... the lag income when the amount of mobile attackers are high (like 100 or more)
hm ok. that should not have changed for the worse recently. if anything, it should have gotten better (the distance calculations no longer involve square root, and are done every 5 seconds instead of every 2), but possibly it's doing something unexpected
maybe the the problem was already here and i don't noticed before as an aside, there is a way or can be create a way to monitor the computing work file by file, to have an idea on how much power consume for example taskqueuebehaviour? this can be implement only file by file? or we can have an system to do this before? i dont know but, in shardlua, where a "behaviour:update()" is called, can we know for example the time needed for doing all the callin? this can be a system to monitor the resources consumption
i got some stats for modules, i need to add behaviours, because it's clear that that's where most of the computing time is going:
will link to commits when the statistics-gathering stuff is more complete
wtf but how fast are you in expire my desire i will try it now!
wait, i take a look with your (on my idea) new nice timerRespons add-on
you can see that unit handler is on the top of the hill, but we have a complex conjure of callin that push up lag: turtlehandler:mostturtled targethandler:checkhorizontalline targethandler:checkradious targethandler:isbombardposition targethandler:check4
and ShardSpringLua.sdd/luarules/gadgets/ai/unithandler.lua contain the Update that are always on top on resources drain this update is the update that call all the update inside all the behaviours?
yup, that leads to unit.lua, in which each unit updates its behaviours
https://github.com/eronoobos/ShardSpringLua/commit/ed3a86bde5c7f6964dd84cd86b24fdada3cb48bd
Oops, forgot you need to give all the behaviours a :Name() for this to be useful
ok, the form is this?
function DefendBehaviour:Name() return "defendbehaviour" end
we need to check all behaviours to see if there are this function?
and handlers files are checked too?
Yes. I already did it in my local repo but I'm not at my computer do can't push
Modules already have name functions
using debug i see that there are 3 number per function showed, what exactly mean each number? as an aside interesting data can be: total amount of call for each function media of duration of function call just a issues
Three numbers are: Sum | min | max Milliseconds per call for all calls from the last 4 seconds
https://github.com/eronoobos/ShardSpringLua/commit/a3b1eeb2795eb5435e8d398df8b5507875da2021 easier to read, but hope you have enough screen space
i'm just going to leave it here collecting info for a while
oops, it went off the screen. maybe 10 pixels high per row was better than 15. hm, i should have the widget print all this to the info log at the end of the game. that way i can just leave a game running (even a headless game) and walk away.
screenshot before it went off screen
things i see to optimize, going by their maximum ms: RaiderBehaviour:Update TaskQueueBehaviour:Update (presumably this only because it leads to ProgressQueue) TurtleHandler:MostTurtled AttackHandler:DoMovement
ideas 1- cut the timer counter at 3rd or 2nd after "," (0.00 or 0.000) 2- delete all the function and refill screen every 4 seconds adding only called function 3- save in a file output list like the one linked
turtlehandler:mostturtled targethandler:checkhorizontalline targethandler:checkradious targethandler:isbombardposition targethandler:check4
this function for me is a problem when the battle become great, i noticed a particular case of lag, when AI have adv and after, that show this 5 function all "red" at same time. where this 5 function are called each other?
https://github.com/eronoobos/BABAR-The-Shardifant/blob/dae418bc6b7b6a608c561cadaf787687ab89c115/taskqueuebehaviour.lua#L393 https://github.com/eronoobos/BABAR-The-Shardifant/blob/dae418bc6b7b6a608c561cadaf787687ab89c115/turtlehandler.lua#L585 https://github.com/eronoobos/BABAR-The-Shardifant/blob/dae418bc6b7b6a608c561cadaf787687ab89c115/targethandler.lua#L1128 (check4 is called many times by checkradius)
so it's looking for positions to build big plasma cannons
i will rewrite the defense placements because you say that but now is not the time, i will work on fix and fix again
these things are not related
oh sorry, plasma are not defense
you online? can we talk a bit?
i thought my overhaul of attackhandler and attackbehaviour would help, but it did not
the lag makes it basically unplayable in the late game. maybe it's the big plasma cannon placement
i suspect that there something in the building placement of t2 ground eco that cause the lag, one of this can be the plasma
now using debugging rising me some doubts:
this is the 3rd line
[f=0041390] CountBehaviour:Update 0 39.7018089 0.001 0.00000429 9250307
just a question
where the f..k is called countbehaviour:update simple there is not in all the shard so why is called? why is called 9250307 times
because it's called for every unit every frame. but it has nothing defined, so an empty function is called
is insignificant ok... another info: i checked the big plasma in taskqueuebehaviour find position system i do not think is a real problem deleting the calls don't get a real benefit for lag but i noticed that in 99% of find location for plasma, no position is find
is not insignificant maybe, there is not a way to set up custom behaviours with dedicated function? if i need a behaviour without update... or other calls..
Behavoiurs that do not define an Update or UnitCreated or whatever just call an empty function when those conditions come up.
Re editing i rechecked all plasma and nukes i forgot to delete t1 plasma a large problem is here effectively. and starting with most turtled so for normal nuke i can resolve by using nano search or other location system but is not the solution other plasma need a line of sight i think and a bombard position too what you think?
Behavoiurs that do not define an Update or UnitCreated or whatever just call an empty function when those conditions come up.
is an idea or what?
is an idea or what?
It's not an idea. It's what already happens. I'm trying to explain why I don't see the purpose of the custom behaviours you describe.
i noticed a increase of "lag" in advanced state of battle, i think is lasts commits, possible? you notice?