Войти в систему

Home
    - Создать дневник
    - Написать в дневник
       - Подробный режим

LJ.Rossia.org
    - Новости сайта
    - Общие настройки
    - Sitemap
    - Оплата
    - ljr-fif

Редактировать...
    - Настройки
    - Список друзей
    - Дневник
    - Картинки
    - Пароль
    - Вид дневника

Сообщества

Настроить S2

Помощь
    - Забыли пароль?
    - FAQ
    - Тех. поддержка



Пишет nancygold ([info]nancygold)
@ 2024-09-04 21:31:00


Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Настроение: annoyed
Музыка:Hitoshi Sakimoto - The Eastern Front
Entry tags:computing

Pathfinding algorithm to go with ECS
Like the entity systems and the procedural terrain generation, pathfinding has its own ugly pitfall.
It starts with a naive person googling "good pathfinding algorithm".
Such search leads to articles advertising exclusively A*.
Yet A* is neither good, nor simple, nor suitable for good video games.
A* has a fuckload of issues
* Requires binary tree to housekeep the priority queue of non-visited cells.
* Depends on nonsense like the heuristics function, which is obvious only for euclidean spaces.
* Convoluted even with the lambda functions.
* Fails on compressed spaces and doesn't work with advanced unit abilities, like teleport.
* Can't be easily parallelized.
* Non-incremental.
* Doesn't integrate the multigoal and inverted goal spaces.
* Really inefficient on larger spaces.
* Really inefficient for larger number of agents.
* Really hard to use with the Sims style smart objects.
* Invites ugly hacks, like path sharing and caching, which lead to inconsistencies.
* Pure A* is never used in practice. For example, Starcraft did the dirichlet tessellation into convex polygon zones, which have simple line paths inside of them. Other games use it only inside very small hierarchically organized subspaces. Or something like https://en.wikipedia.org/wiki/Rapidly_exploring_random_tree

Inexperienced people wont even be able to see these issues until they have polluted their project with the nigger A* degeneracy.

So why do the retards promote A*, if there are much better and easier to implement approaches like the data-driven gradient ascend and hierarchical gradient ascend, which can be run within the ECS framework? No idea. Academic conservatism? Obscurantism? Afro-centrism?

Anyway, here is the actually working algorithm
https://home.cs.colorado.edu/~ralex/papers/PDF/OOPSLA06antiobjects.pdf

It doesn't require complex data structures or logic, works on 3d space, and doesn't have any of the A*'s deficiencies. It is incremental. It handless smart objects like nothing, works with both unexplored territory (the unexplored territory itself generates the fading gradient) as well as fog of war scouting. With the with 2 overlayed gradient maps trick and a tokenized propagation, one can integrate it with several different goals types, if one goals is allowed to depend on another. I.e. it can implicitly perform the dirichlet tesselation.



(Добавить комментарий)


(Анонимно)
2024-09-05 00:56 (ссылка)
>data-driven gradient ascend and hierarchical gradient ascend,

First, it's ascent, a noun, not ascend a verb. Second, this shit isn't googlable. Did you make these names up right now? I'm pretty sure you are not talking about Spectral Graph Theory.

>why promote A*,

Computational complexity for the simplest case? If you have teleports, varying costs of traversing different terrain, of course you need some advanced Dijkstra-like something, optimized for your particular use case. That's what programming is about.

>Pure A* is never used in practice

So? It's good for the base case from which you can build upon,tweak heuristic, introduce segmentation, caching, Hierarchial pathfinding A* (HAA* / HPA*), D* Lite, which are all A* variants, etc.

>collaborative diffusion

it solves a different problem though, and unlikely to be efficient in like roguelike mazes autoexplore function for example.

>dirichlet tesselation.

Voronoi tesselation, you fucking racist.

(Ответить) (Ветвь дискуссии)


[info]nancygold
2024-09-05 01:09 (ссылка)
>it solves a different problem though, and unlikely to be efficient in like roguelike mazes autoexplore function for example.

It solves the same problem. Just incrementally. The ascent happens for units following the gradient produced by the diffusion. It is very efficient, for 128x128 map it takes about 128 steps to cover entire map. I.e. if you do 2 steps per frame, you have O(1) pathfinding available all the time. And most of the time the maze is doesn't change, so once the gradient is ready, you need to update the4 gradient only when the goal changes or an obstacle is introduced/removed (usually the changes are local).

(Ответить) (Уровень выше)


(Анонимно)
2024-09-05 01:10 (ссылка)
>autoexplore function

Or simply go to point T function. But it is much more useful for monster behavior targeting the player.

(Ответить) (Уровень выше) (Ветвь дискуссии)


[info]nancygold
2024-09-05 01:15 (ссылка)
Again, for "go to T" you can introduce hierarchical gradients by placing beacons. These will auto-connection into a network, which can propagate higher level gradient in a few steps.

(Ответить) (Уровень выше) (Ветвь дискуссии)


[info]nancygold
2024-09-05 01:17 (ссылка)
In ECS that will be producing beacon entities, and connecting them once their gradients collide. Four-color theorem guarantees you can do that with just four ovelapping gradients.

(Ответить) (Уровень выше)


(Анонимно)
2024-09-05 01:38 (ссылка)
You can improve A* in similar (hierarchical) way, and I bet these variants are just faster, complexity wise, if we factor out the collaboration aspect, or else we would have had it as the default textbook algorithm already.

To tell you where and if you are wrong I need to implement or find the implementations of these algorithms and test it on like 10k randomly generated mazes, collect data. Not sure if I'll find the time for such entertainment.

(Ответить) (Уровень выше) (Ветвь дискуссии)


[info]nancygold
2024-09-05 01:42 (ссылка)
No sense polishing a turd. Again, A* is deficient by design.
But to cite the paper
"This runs counter to our body syntonic experience."

basically it is your nature being a nigger pushes you towards using things like A*.

Instead of choosing the white data driven algorithms, niggers cling to their OOP Africa.

(Ответить) (Уровень выше) (Ветвь дискуссии)


(Анонимно)
2024-09-05 01:54 (ссылка)
>OOP Africa.

If the guy made any complexity or speed improvements for the shortest path problem he would have published it in an algorithmic journal or conference, instead he did it OOPSLA conference, which stands for "Object-Oriented Programming, Systems, Languages & Applications", and primarily talks about reversing intuition, etc, not algorithmic aspects.

When people prove that the actual "nigger" is you, you quickly forget that and move on.

(Ответить) (Уровень выше) (Ветвь дискуссии)


[info]nancygold
2024-09-05 02:25 (ссылка)
Gradient ascent is a well known algorithm.
Publishing it is like patenting linked lists and spinlocks.
But yeah, Dijkstra indeed appropriated the brute force search in his name.

I think it was later published by different people under the "flow field pathfinding."
They use flow direction vector, instead of gradient, but it is literally the same.

"N. L. Manuel, N. İnanç, and M. Y. Erten, “Control of mobile robot formations using A-star algorithm and artificial potential fields,” Journal of Mechatronics, Electrical Power, and Vehicular Technology, vol. 12, no. 2, pp. 57–67, 2021,
doi: 10.14203/j.mev.2021.v12.57-67."


took Turk-niggers 15 years to plagiarize a lambda papers style memo.

(Ответить) (Уровень выше) (Ветвь дискуссии)


(Анонимно)
2024-09-05 03:26 (ссылка)
>Gradient ascent is a well known algorithm.

For optimization.

>Dijkstra indeed appropriated the brute force search in his name.

That's how science works. He was first. Сперва добейся.

>flow field pathfinding

Shouldn't be faster for a single unit than A* derived algos, because it just does more work.

(Ответить) (Уровень выше) (Ветвь дискуссии)


[info]nancygold
2024-09-05 11:42 (ссылка)
>Shouldn't be faster for a single unit than A* derived algos, because it just does more work.

A* is not incremental, so it will be slower. Then to fix the A* issues, you will have to do far more work, like maintaining an index of cells which are part of paths to invalidate the paths on space update. And again, A* is useless of anything but the most primitive games.

(Ответить) (Уровень выше)


(Анонимно)
2024-09-05 18:24 (ссылка)
skill issue

(Ответить)