Torque2d Path

2D version of the Torque engine.

Moderator: marauder2k9

3 posts Page 1 of 1
marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Sun Dec 22, 2019 6:07 pm
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?
marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Tue Dec 24, 2019 12:14 pm
Ive started to work on a path implementation and some steering behaviors using the moveto functions as a starting point.
marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Fri Dec 27, 2019 3:31 pm
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
3 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests