Sythivo / AIEngine

A Roblox module
MIT License
8 stars 1 forks source link

[AI]; Chasing Player Loop #2

Closed S7vie closed 1 year ago

S7vie commented 1 year ago

Okay so, I'm not sure if this is a bug or not but, I put debugging on the OnChaseEnded OnChaseStarted events;

Note: Theres a [StringValue] titled "State" in the AI which controls some things like playing a spotted sound after the player has been seen and I modify its value upon the firing of the events (if that makes sense)

When the AI chases, it prints Not Chasing and Chasing(from the debugging I put) at the same time while the AI is chasing a Player now I haven't tested this AI yet with 2 Players but it does that for some reason

before I put the modification of the State value on the OnChaseEnded and OnChaseStarted events but since they were repeating I had to move them to where the AI chases the Player AI.Movement:MoveTo(PlayerPosition) and that works but I still don't get why it repeats it

Sythivo commented 1 year ago

Are you using the Chase Example mechanic from the source?

Keep in mind examples are made for users to understand the uses of AIEngine.

Can you provide more details such as the lua code of where the issue happen?

S7vie commented 1 year ago

Yes, I'm getting on studio in a bit and I will send you the printed info and the lines of code.

S7vie commented 1 year ago

Do keep in mind; I don't have much experience with making AIs

And there's another bug where the AI runs into walls and stops there [Roaming Mechanism] but it's probably the AgentParams that I have to modify

S7vie commented 1 year ago

Apologies for the crappy quality : Roblox being itself image image image

Sythivo commented 1 year ago

Where are the prints located for you debugging on when the AI stops chasing and starts?

Sythivo commented 1 year ago

If the state changes rapidly it could well effect the Chase.

Try using the AI's api OnStateChange and print the value of the new State, and while testing check for any rapid changes in the State.

Another debug attempt you can try is print/warn inside the heartbeat, you should print AI.TargetPlayer, and the Player from scanner, before ChaseStarted is fired.

I would have to take a look at the example mechanics myself.

S7vie commented 1 year ago

The state does not change, in the image I sent where the AI was chasing, on the other side the Output is visible; showing the prints

S7vie commented 1 year ago

Oh, the prints on the code?

S7vie commented 1 year ago

I'll send in a bit.

S7vie commented 1 year ago

Can you add me on [Discord]: ( 7_81C )[Username]

Since, I have to wait like at least [a hour] for a reply on here

And if you're asking if I do need help, then yes; it's not a small bug that I can pass on from, it affects the gameplay (how?) I will explain there

Sythivo commented 1 year ago

Solved