i just check the anti collision paper holly shit that looks like a nightmare, kudos to you for implementing that thing! I have a question tho, why not just use a flow field? I was wondering if the ClearPath algorithm is worth the hassle if u don't really care about collisions, is there a boost from using that algorithm compared to just using a flowfield?
Очень хороший ролик, много полезной информации для меня. Если я тебя внимательно слушал, то не было ни одного упоминания о A* алгоритме по поиску оптимального пути. Почему? Наслышан, что этот алгоритм используется в 90% всех стратегий в реальном времени.
Упомянул в 6:35. А* это хороший алгоритм для нахождения путей от точки до точки. Он имеет свое место, но ограниченно эффективен когда требуется много похожих путей. Не эффективно было бы вычислять индивидуальный А* путь для каждого война и заново вычислять когда воин «сбился». Для этой задачи подход «полей» лучше потому что хоть 500 воинов могут использовать одно «поле». Это относительно современная идея которая набирает популярность.
@@eduardpermyakov Ещё есть вопросы про то как происходит атака или следование за юнитом(ами). Я правильно понимаю, что при любом изменении координат преследуемого(ых) юнита(ов) "поле" полностью перасчитывается? Не создаст ли это проблемы если много "преследуемых" разными группами юнитов? И есть ли способ оптимизировать перерасчёт "поля"?
@@8Gothiclord Верно что нужно будет высчитывать новое поля для каждого «чанка» (комнаты) где юниты подвинулись. Если они в движении, то это происходит в каждом кадре. В этом случае всё равно вычисляется всего несколько полей потому что все юниты одной факции на одном чанке будут использовать одно поле. Десять или тысяча юнитов потребуют почти одно и то же количество вычислений если площадь под ними занимает столько-же чанков. Можно ускорить само вычисление, но не избавиться от этих вычислений потому что, фундаментально, когда меняются позиции юнитов, эффективные пути меняются. Можно как-то пожертвовать эффективностью путей, не сразу бросая старые поля. Можно побаловаться с параметрами (размер чанков). Но алгоритм как он есть нормально работает для моих целей.
Hi how do you do to make A* with flow fields, i mean how do you do to have every single grid with the direction?. Do you have a paper or references that you can give me? Im doing my final degree project about this. Im from Spain so sorry for my english
Currently, no. I had an idea to potentially add additional forces to constrain the units in a formation such that they try as much as possible to keep their position relative to other units. Say, there are 3 units. The left-most one will have a force pushing it left of the other two, the center one will be pushed right of its' "left neighbour" and left of of its' "right neighbour", etc. This way the units will keep their relative positions but still break formation of there are stronger forces (ex. they are forced to funnel through a narrow passage). I've not actually implemented this, so I'm not sure how well it will work in practice.
In your last example of the goblins attacking those enemy units. Say the enemy player were to retreat those units. What happens then? Will the goblins keep chasing those units or do they give up at some point?
They keep chasing up to the point where there are no more enemies in a certain range. Then they give up. So the running units have to be faster than the goblins to "get away".
The code for the engine is on GitHub (link in the description of the video). Might take a bit of effort to study the C code, but it's there if you have the time and energy for it. There wasn't any one tutorial I followed. I skimmed through near everything I could find on the topic and ultimately the current result is a combination of what I learned from a lot of different (incomplete) sources, plus some of my own ideas. I had to iterate a bunch too before the code got to where it was. The video should give you enough ideas to start googling: "flow-field pathfinding", "clearpath", "flocking behaviours", "heierarchial pathfinding".