GDQuest / godot-steering-ai-framework

A complete framework for Godot to create beautiful and complex AI motion. Works both in 2D and in 3D.

Home Page:http://gdquest.com/docs/godot-steering-ai-framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bring Separation and Cohesion into similar math

Razoric480 opened this issue · comments

Currently, putting equal parts Cohesion and Separation leads to math that vastly favours Cohesion, and requires Separation be given a decay_coefficient in the hundreds of thousands to millions range, and to give it a blended strength that is an order of magnitude stronger than the Cohesion.

Putting a 1:1 ratio of the two behaviors should cause close-to-zero amounts of acceleration, after an adjustment period, without large amounts of tweaking.

Though it should be done in a way that does not compromise the difference between Separation and Cohesion:

  • Cohesion should still be a behavior that tries to move towards the proximity's center of mass
  • Separation should still be a behavior that tries to move away from other units in the proximity, with closer units causing higher values.