ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator Adjust "time needed" for path
person icon
veganpete
Registered User
Quote
2023-11-23 10:19:13

Anyone know of a simple way to dynamically change "time needed" using code please?

embedded external image
🔎︎


Thanks.

person icon
just_in_case
Moderator
Quote
2023-11-23 10:57:16

Without editing the source you can't change it, that is why I suggested to you to not go with the inbuilt path system for your NPC's, but you can use my custom path behavior available to download from Neophyte here:- https://vazahat.github.io/cc_beh...
there is a video tutorial for the usage, it allows you to have more control over the path system for your game, if you want you can use @sven's path node behaviors as well. That will also help you out.

person icon
veganpete
Registered User
Quote
2023-11-23 11:36:43

Thanks Just_In_Case. The main reason I like to use paths for simple motion is that it automatically accelerates/decelerates the speed as it reaches the end of the path (as long as it's closed circle path). It automatically adjusts speed between the path nodes using a tweening calculation, based on the distance between nodes and the time required to reach it. Like when you throw a ball up in the air, it constantly changes speed between leaving your hand and reaching it again in a closed loop.

I don't think the A.i. path system will do that, it just seems to keep a constant speed (based on node.movementspeed), even when changing direction - to me, this makes the animation look jerky/digital instead of being smooth/organic. Obviously the A.i. speed can be tweened using code - but it wouldn't be easy for me to do.

person icon
just_in_case
Moderator
Quote
2023-11-23 14:08:23

Yeah, one can easily tween the movement in the custom path behavior as well. All you need is the Lerp function and it will smooth the movement of the AI. When I get completely satisfied with the 2D player controller I will probably push an update to the custom path behavior as well.
:)

person icon
VP
Guest
Quote
2023-11-23 14:20:11

Ah,"LERP", I've seen that mentioned before. Thanks.

For now, Ive changed one of the dogs to A.i. path and (he) switches between walk/run animations and speed, as suggested by Luposian. Looks quite good and is probably better than simple"follow path". I'll go ahead and swap them all over to the A.i. path system. The just walk between 2 nodes andswitch variables at each end.

Only small issue is when the dog turns around to walk in the opposite direction; it clips through the geometry - no big deal really - I can probably fix it with a single variable to trigger "Look in Direction of path node".

Thanks again for the idea.


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |