Sythivo / AIEngine

A Roblox module
MIT License
8 stars 1 forks source link

AIEngine: (AI Roaming Issue) #3

Closed S7vie closed 1 year ago

S7vie commented 1 year ago

@Sythivo Alright so, I kind of fixed this issue but I still wanna mention it for more information on it, when the [AI] computes the [Path] :ComputeAsync( (startPosition), (endPosition) ) ---- The [AI] does not move at all when AI.Character:GetPivot().Position is used. (just a heads up: this is in the actual AIEngine module, although you probably already knew that)

After I modified the (startPosition) to AI.Character.PrimaryPart.Position - Vector3.new(0, AI.Character.Humanoid.HipHeight, 0), it was fixed for a while until the [AI] randomly stops while (Roaming). The one thing that I figured out is, when I moved the [AI] when it was just stuck on the same Point it started going to the same point, again.

I haven't put a [Stuck Teleportation] System yet, though.

Sythivo commented 1 year ago

It is likely you have your Pivot offset from the model completely somewhere else, As testing GetPivot was the same as GetPrimaryPartCFrame in a sense that it has a Primary part and the pivot offset is zero.

The height adjustment can also be adjusted to the floor using Pivot which should improve PathFinding performance.

Make sure you are using the updated AIEngine as there was some additional changes for the CyclicLoop.

S7vie commented 1 year ago

It's the updated one.

Sythivo commented 1 year ago

It would be issues on the model you are using, if you have to use AI.Character.PrimaryPart.Position - Vector3.new(0, AI.Character.Humanoid.HipHeight, 0) then you are free to use that, pivot in the other hand is recommend, not only for its ease but your preferred point location.

Try editing the pivot of your models, to the Floor, by entering edit pivot mode, and drag the pivot down the to feet or bottom of the model.

image

And drag the pivot of a model to the feet.

image

It would look like this.

You can play around with the pivot locations until you have what you want on the AIEngine performance, if this still does not work, I'll have to check internally.

S7vie commented 1 year ago

ok

S7vie commented 1 year ago

i will inform when i try and see

S7vie commented 1 year ago

I tried it out yesterday and it works, but there's one last issue: The AI goes near walls when patrolling and chasing, (like going near a wall that is blocked off then going to the actual PathFinding waypoint)

Is this because of the AgentParameters?

Edit - ; One thing that irritates me the most is that I have to wait several hours or even days for a response, it was unnecessary to unadd

Sythivo commented 1 year ago

I have a busy schedule, I cannot keep someone added, and it isn't normal for me to have lots of people added.

It really mostly depends on your AgentParameters, try adjusting the radius.

GalladeR475 commented 1 year ago

Try changing the AgentRadius of AgentParameters I suppose tweaking that will fix your issue.

S7vie commented 1 year ago

that's the thing, i tried exactly doing that before commenting

it makes the PathFinding worse (Radius)

S7vie commented 1 year ago

I have no idea if it's a Pivot issue or something

Sythivo commented 1 year ago

If that only happens and not pivot like in your old attempt to fix it, then It could be a Pivot issue. If that would be the case, try micro adjusting the Pivot, moving it more higher, or more lower, etc.

S7vie commented 1 year ago

I'll try