marauder2k9 Posted December 22, 2019 Share Posted December 22, 2019 I wanted to add some more randomness to the movement to the enemies in my game, i noticed there used to be t2dpaths in torque2d, they had linear movement and bezier type movements has anyone used these before? Is someone working on implementing them again? I might try and implement something similar but if someone is already working on it may as well join forces instead of doing the work over again. I think there is already a behavior template made by someone for path movement but would it be better if this was hard coded? Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted December 24, 2019 Author Share Posted December 24, 2019 Ive started to work on a path implementation and some steering behaviors using the moveto functions as a starting point. Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted December 27, 2019 Author Share Posted December 27, 2019 So far all in script, i have created a behavior that takes a list of positions and pushes them to an array that is then looped through with another behavior creating moveto actions for a target sceneobject that then follows the path and on each completion of the moveto action it loads in another moveto action to the next node in the path. Rather interesting addition i have added the ability to send a shape to the behavior this then counts the number of vertices in the shape and gets the vertices world positions and creates an array of them that is then used as a path by another sceneobject. The behavior to follow a set path is attached to the sceneobject. Still implementing steering behaviors to work with this, which i think is impossible without some source code changes to the moveto action as moveto sets the force vector directly to the next point without the ability of adding a steering force as is. In script this may be possible without using moveto but i think it would require triggers to be placed at each node in the path to change the force direction and apply a steering force to point to the next node. Doing this and adding a steering function to the moveto function should be less taxing i think but i might try it both ways and see if theres any noticeable frame drop. Working on an AI toy with pathfinding and steering behaviors 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.