Before the last server reboot everything was working fine (only chat methods had a bug). But now most of find functions are broken they all crashs !
For example when I use ents.self:getConstraints() it instantly crashs and not on my files on server starfall addon files : addons/starfall/lua/starfall/libs_sv/constrain.lua:98: Operations quota exceeded. Ops: 500500 !
What happened ? Did someone lowered the OPS limit ? Did you broke the functions ? What have you done so I can no longer make any AI working on my MainShip with more than 700 entities ?
06-08-2015, 10:19 AM, (This post was last modified: 06-08-2015, 10:28 AM by LocInt.)
What you described can happen if your Ship has many props and you are looping through them. One factot can also be how many more props are spawned on the server. But i dobt think something got changed because my stuff works fine.
06-08-2015, 01:18 PM, (This post was last modified: 06-08-2015, 01:25 PM by Yuri6037.)
SuperPlayer, it's not the iterating code that crashes ! Just call local tbl = ents.self():getConstraints() and it will instantly crash with the error I gave...
EDIT : I'll see by removing my OPS Limit Iterator bypass lib, but I'm praticaly sure the problem happens inside the function getConstraints !
EDIT 2 : That was exactly what I was thinking, removing my bypass lib call results in the same problem at the same location in my file and at the same location on server Starfall lib file ! They forcely made something to Starfall, because the problem is strange and realy weird, whem spaming the Starfall Processor paste tool, LanAI finishes by loading like before !!
getConstraints iterates through all the entities that entity is constrained too. The issue with that is: On larger ships it will try throwing 500 or so entities into a table instantly. As a result you cap over 500K ops and you quota out. It is best to use a custom get constraints function that uses coroutines to avoid this issue on larger ships.
What is this love you speak of?
06-08-2015, 03:59 PM, (This post was last modified: 06-08-2015, 04:00 PM by Yuri6037.)
Rouing just the simple code local tbl = ents.self():getConstraints() causes instant crash ! Without any loop it still crahses ! If I had access to ents.GetAll() I could bypass it but I haven't access to it !
06-08-2015, 04:01 PM, (This post was last modified: 06-08-2015, 04:23 PM by rouing.)
(06-08-2015, 03:59 PM)Yuri6037 Wrote: Rouing just the simple code local tbl = ents.self():getConstraints() causes instant crash !
Yes. getConstraints has to do ALOT OF WORK on LARGE SHIPS. You need to under stand that if you run it on a large ship: It is trying to INSTANTLY PUSH ALL THE ENTS TO ONE ARRAY. INSTANTLY (almost). Create another getConstraints using coroutines.
use getSingleContstrainedEnts()
There was a bug that was part of the reason for the chat methods bug, where the time and ops quota would stop being measured. You probably had code running under this scenario which did not trigger the quota before but now does.
As Rouing has been saying, constraint searching is a slow operation due to recursion through every constraint in the system. Large ships will hit it quite quickly.
(06-08-2015, 05:46 PM)Person8880 Wrote: There was a bug that was part of the reason for the chat methods bug, where the time and ops quota would stop being measured. You probably had code running under this scenario which did not trigger the quota before but now does.
As Rouing has been saying, constraint searching is a slow operation due to recursion through every constraint in the system. Large ships will hit it quite quickly.
So you mean that it's finished and when you reach 800 entities you can't make an AI that needs to iterate over all entities.