man_s_our Posted November 10, 2023 Report Share Posted November 10, 2023 while working on patching Unit AI component for adding support for separating rider/horse entities. I found that when ordering a rider to hunt animals that are in FOW I always get the error Failed to construct Vector3D/Vector2D object. (although in the last patch the hunt and gather works well despite the error) these two versions of code are usually source of error (line 2136 in the component): let cmpTargetPosition = Engine.QueryInterface(this.order.data.target, IID_Position); let pos = cmpTargetPosition.GetPosition(); and let cmpTargetPosition = QueryMiragedInterface(this.order.data.target, IID_Position); let pos = cmpTargetPosition.GetPosition(); both are throwing the same error but only the first one works perfectly despite the error. 1 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted November 11, 2023 Report Share Posted November 11, 2023 @Freagarach @vladislavbelov Quote Link to comment Share on other sites More sharing options...
man_s_our Posted November 11, 2023 Author Report Share Posted November 11, 2023 after some debugging. I found out the thing that trigger this error is when the position is requested too many times in a moment. I don't know whether this is intended for security reasons or just a bug in the position component code. Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted November 14, 2023 Report Share Posted November 14, 2023 On 11/11/2023 at 11:29 AM, man_s_our said: after some debugging. I found out the thing that trigger this error is when the position is requested too many times in a moment. I don't know whether this is intended for security reasons or just a bug in the position component code. Do you have steps to reproduce? Quote Link to comment Share on other sites More sharing options...
man_s_our Posted November 15, 2023 Author Report Share Posted November 15, 2023 21 hours ago, vladislavbelov said: Do you have steps to reproduce? it would be reproduced whenever is in infinite recursion. in my case infinite state switching. when I detected the bug I fixed it and now working on fixing other bugs. the rest of the bugs left mostly related to not having proper states. one of them caused unit motion in fleeing state to not work properly as if the detected range was increased than real range. which cause the hunt target not fleeing if hunted by rider. Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted November 15, 2023 Report Share Posted November 15, 2023 4 hours ago, man_s_our said: it would be reproduced whenever is in infinite recursion. in my case infinite state switching. when I detected the bug I fixed it and now working on fixing other bugs. In that case the error might happen because of stack overflow/out of memory. If you replace it by a loop (with the same number of steps like for the recursion) in theory it shouldn't fail. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.