Jump to content
  • Advertisement
Sign in to follow this  

Combining multiple movement forces for object update

This topic is 2771 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

At the moment I have incredibly basic AI and updating for monster movement that all acts on a single movement vector, which is pretty awful. AI just directly alters the movement vector, and in order to allow the monster to move around things, the AI sets the vector every few frames

So if I apply a push force from an attack, the monster will move backward until it's next AI update and then it will just snap back to it's own walk vector, it won't push against the force acting on it or anything, it just overrides it. I would like to split it up so that a force vector and an AI Vector are combined to produce a final vector used during update to move it.

Things for it to consider:
1: Moving toward its attack target (if it has one)
2: Moving away from fellow monsters it is touching
3: Following the side of walls when it encounters them, attempting to move round them
4: Being pushed back by player attacks, explosions, or environmental effects like magnets which have specific strengths.

The first three are under AI control, so it's speed is capped to the movement speed of the monster. However, the last, external forces, shouldn't be capped, as it could be blown across a room if a force is high enough. I don't know how I could combine these two, so when the mob's own movement vector is applied it doesn't go over the cap but if it has been pushed externally it isn't capped.

Help on how I can combine these would be really appreciated.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!