Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: RICK on October 17, 2019, 03:05:58 PM

Title: Npc Jumping Agent
Post by: RICK on October 17, 2019, 03:05:58 PM
Hi

 I'm working on some Npc AI. I want my agent to jump across, up and down navmeshes. I currently use Unity personal version, so I don't have the off mesh
link function. On YouTube I found a video by Mdotstrange. He made a c# script that enables the agent to do this and provided a link to download the project.

I played around with it, controlling it with Playmaker. Has anyone seen this and used it in a project? It works but I have a problem after the first jump. The start
of the jump does not reset to its current jump, it always starts at the first jump.
For instance, if it makes 4 jumps, it will start at the first jump and follow the paths
through the other jumps to the last jump. I don't know how to script so I don't
Know how to fix it.

I contacted Mdotstrange about 5 weeks ago and he said he would make a playmaker action to fix the problem. About 4 weeks ago I sent him a link to
download my JumpingAgent project to look at, and asked him if he had any luck with fixing the script. I have not heard from him since then. I don't want to pester him about a free asset. It would be very useful if I could get it to work.


Thanks,

Rick C
 
Title: Re: Npc Jumping Agent
Post by: jeanfabre on November 13, 2019, 03:03:10 AM
Hi,

 can you send me the project you are testing withm and I'll see what I can do.

It's likely because you simply need to reset the start and end position before you jump or something like that.

 Bye,

 Jean
Title: Re: Npc Jumping Agent
Post by: RICK on November 14, 2019, 09:04:17 AM
Hello,

Thanks Jean, I would appreciate the help. I will send you a PM with a link to my
dropbox where you can get the project file.

Rick C
Title: Re: Npc Jumping Agent
Post by: jeanfabre on November 21, 2019, 02:55:08 AM
Hi,

 haven't forgot your case :) just lack of time, will check either tomorow or monday.

please bump if you haven't heard back from me on tuesday, ok?

Bye,

 Jean
Title: Re: Npc Jumping Agent
Post by: jeanfabre on November 27, 2019, 02:19:29 AM
Hi,

 ok, I'll need direction, I got your project, but it's just too big... Which scene shall I open?

Bye,

 Jean
Title: Re: Npc Jumping Agent
Post by: RICK on November 27, 2019, 03:30:44 PM
Hi Jean,

I think I gave you the project. My computer crashed and I'm going to have to reload Windows and Unity.  I will get back to you tomorrow when I get everything straight.

Thanks,

Rick C
Title: Re: Npc Jumping Agent
Post by: jeanfabre on December 02, 2019, 03:33:44 AM
Hi,

The target for your jump is the capsule. how do you move this target for your next jump?

It would help if your scene was easier to play, right now the camera is not pointing to the player, and I don't have a x box controller, so I hacked around and I could play the jump, move the capsule and try to jump again, and I could see it was buggy, but wether it's buggy because of your logic or the logic inside the AgentJumpToTarget, I am not sure.

 Did mdotstrange provided some samples with this script that works across multiple jumps?

Bye,

 Jean
Title: Re: Npc Jumping Agent
Post by: RICK on December 02, 2019, 02:31:07 PM
Hi Jean,

Sorry, I should have used get mouse button down.  I use the scene view in play mode. After the first jump, I grab the target in the scene view and move it. The JumpingAgent game object is the original JumpingAgent that came with the project. I only added a Playmaker FSM to call the needed methods to make it work. As you can see in the FSM, it loops back to the start state after the jump is complete. For some reason after the first completed jump, all additional jump paths are stacked and the agent will follow all the paths. the only thing I did to the script was: 1  // delete the using.SirenX.Odin.. above if you don't have it and 2 delete the lines with [Button] . After the jump cycle I would think the next jump cycle calculations would start new calculations.

The Playmaker FSM I added to the Unreal Female Rigged Game Object has extra states that only controls the walking and jump animations. Walk animation stops when the agent gets to the edge and the walk animation will stop when it gets to the target. 

Thanks,

Rick C

Title: Re: Npc Jumping Agent
Post by: jeanfabre on December 13, 2019, 07:38:34 AM
Hi,

 Did you check if there was some samples for this system? I would contact the author again, I looked at the code, but it's very unclear to me where the problem could be, it could either be because you are missing something in the setup or a problem indeed in the script itself, but to make sure of that, I need a sample where it works ( or at least made by the author claiming it works)

Bye,

Jean
Title: Re: Npc Jumping Agent
Post by: RICK on December 13, 2019, 08:51:07 AM
Hi,

I had initial contact with Mdotstrange in September, he said he would make some playmaker action to fix the problem. After a couple of weeks, I sent a follow up email and didn't get a response. Here is the link where I got his project.

https://github.com/mdotstrange/MyUnityScripts/blob/master/JumpingAgent.unitypackage

Thanks,

Rick C
Title: Re: Npc Jumping Agent
Post by: jeanfabre on December 16, 2019, 02:49:25 AM
Hi,

 does it features a working sample?

Bye,

 Jean
Title: Re: Npc Jumping Agent
Post by: RICK on December 16, 2019, 10:27:29 AM
Hi,

Mdotstrange used Odin- Inspector Serializer in his project which provided him a way to customize windows in the inspector. He had 2 buttons in the Agent Jump to Target script in the inspector window, Get Start Point And Move To Position and Perform Jump buttons. I didn't have that asset so I followed the instructions to remove certain lines of code, then I set up a Playmaker FSM to call the 2 methods to make it work.

Thanks,

Rick C
Title: Re: Npc Jumping Agent
Post by: jeanfabre on December 17, 2019, 12:56:57 AM
Hi

 But did you get a working sample at all?

Bye,

 Jean
Title: Re: Npc Jumping Agent
Post by: RICK on December 17, 2019, 02:58:40 AM
Hi,

When I first opened the project, there was no means for me to activate the JumpingAgent in play mode without the Odin Serializer asset, so per the instructions in the script, I deleted certain lines of code, then I set up a playmaker FSM to call the appropriate methods. It worked except for jumps after the initial jump.

Rick C
Title: Re: Npc Jumping Agent
Post by: jeanfabre on December 17, 2019, 03:11:49 AM
Hi,

 That's problematic, because we have no way to know if this system works to begin with...

I don't think it's wise to use this system.

could you not do it manually? you know the start and end of the offmesh link, you can then animate from start to end, and have a curve for the jump height.

I would cut this problem in two,

1: make a cube jump from A to B ( with different height between A and B)
2: use offmeshlink to get A and B and apply the jump made in 1.)


Bye,

 Jean
Title: Re: Npc Jumping Agent
Post by: RICK on December 17, 2019, 03:52:46 AM
Hi,

The reason I wanted to use this is because I don't have off mesh link capability because I am using Unity personal version. I will try to work on my own Npc Jumping system with Playmaker.

Thanks,

Rick C
Title: Re: Npc Jumping Agent
Post by: jeanfabre on December 17, 2019, 12:29:18 PM
Hi,

 personal edition was a very long time ago.... now all features are included, what version are you using?

Bye,

 Jean
Title: Re: Npc Jumping Agent
Post by: RICK on December 17, 2019, 07:48:23 PM
Hi,

I use 2017.1.5f1.   


Rick C
Title: Re: Npc Jumping Agent
Post by: RICK on December 17, 2019, 09:33:46 PM
Hi Jean,

Do you mean the newer Unity personal version includes all features? Does it now allow for use of IK?

Rick C

Title: Re: Npc Jumping Agent
Post by: RICK on December 17, 2019, 10:12:54 PM
Jean,

 OK, I downloaded Unity version 2019.3. I have been looking for some kind of tutorials for using Playmaker and path finding, particularly using off mesh links. I got the path finding package from the Eco system. Are there any samples I can get somewhere?

Thanks,

Rick C
Title: Re: Npc Jumping Agent
Post by: jeanfabre on December 18, 2019, 12:51:40 AM
Hi,

 Good, I don't think there are any samples for pathfinding that is up to date. Let me dig on my backups and work on something/ update them.

 I am quite busy atm, so please ping me end of next week to remind me if I haven't come up with anything.

Bye,

 Jean
Title: Re: Npc Jumping Agent
Post by: RICK on December 18, 2019, 01:10:50 AM
Hi,

OK, but since I upgraded Unity versions, I'm having a problem with my Playmaker character controller involving itween. I was just writing a post about it while you were posting. I will finish writing the the post about it.

Thanks,

Rick C
Title: Re: Npc Jumping Agent
Post by: RICK on December 18, 2019, 01:15:42 AM
Jean,

After upgrading to Unity 2019.3, Imported my main character from the old Unity version including the dependencies. It is based on Kudold 3rd person Playmaker character controller. I hate upgrading Unity versions because it's a big headache with Playmaker, especially with my character. The attached screenshot is the main FSM. It has many more smaller FSMs. Some FSMs use itween actions. I guess itween is a older tweening solution because I had to use a add-on to install it in the new Unity version. Some additional itween scripts were added to some of the components that was not there in the older version.

Thanks,

Rick C
Title: Re: Npc Jumping Agent
Post by: jeanfabre on December 18, 2019, 01:22:01 AM
Hi,

 ouch... this fsm is way too big. you need to optimise this fsm, you can't work and maintain a stable system like that

itween is deprecated, but you can still bring it back from the welcome screen under "addons/Legacy system"


if you were using 2017, you don't need to upgrade, offmeshlink is available in the free version.

Bye,

 Jean

Title: Re: Npc Jumping Agent
Post by: RICK on December 18, 2019, 03:21:41 AM
Hi Jean,

Yes I know the FSM is big, I combined 3 different Kubold controllers into 1. I had a basic movement controller, a sword fighting movement controller and a rifle shooting movement controller.  I tried to use the 3 different movements with separate FSMs, sending events, testing bools and so forth, but it caused lags in my animations. The mecanim state machine is also complex, I have close to 800 animations. It's been working great so far.

I use the Unity Hub, so I now have versions 2017 and 2019. I think I read somewhere that DoTween was the best tweening solution. I think I will try to convert to that. I will see if off link mesh works in version 2017.

Thanks,

Rick C