![]() ![]() At the same time, this mesh structure is complicated to understandīy us humans but it's very easy for the computer. With this system, the number of zones is reduced a lot, and calculus on the Why such a complicated structure? Because it allows the module which calculates the gradient to work much faster. It's linked with zones 5 (NW) and 6 (WSW,WNW). It's linked with zones 5 (NNW,NNE), 7 (ENE,ESE) and 4 (WSW,WNW,NW). It's linked with zones 3 (NNW,NNE,NE), 7 (SE), 6 (SSE,SSW), 4 (SW,WSW,WNW) and 2 (NW). It's linked with zones 2 (NNW,NNE), 4 (NE), 5 (ENE), 6 (ESE) and 1 (WSW,WNW,NW). It's linked with zones 5 (SSW), 4 (SW) and 2 (WSW,WNW). It's linked with zones 3 (ENE,ESE), 5 (SE), 4 (SSE,SSW) and 1 (SW,WSW,WNW). It's linked with zones 2 (ENE) and 4 (ESE). ********** In this mesh, there are 7 zones: zone 1 has a size of 4. Then the mesh structure would be: ********** ********** The * represent walls, that's to say squares where fighters can not go. Supposing that you level structure is: ********** There are 12 directions: North-North-West (NNW) North-West (NW) West-North-West (WNW) West-South-West (WSW) South-West (SW) South-South-West (SSW) South-South-East (SSE) South-East (SE) East-South-East (ESE) East-North-East (ENE) North-East (NE) North-North-East (NNE) Example Well, let me give you an example, Or any nice value like that, and the gradient isĪnd each connection is associated to a direction. ![]() This mesh system is a structure of squares connected Gradient (the distance from a point to your cursor)įor every single point of the map. Mesh Introduction The first Liquid War algorithm used to calculate the To figure out when you have reached this state. Or something really close but I don't know any easy way In the long term, the algo will always find the best solution You found is the best, and the algorithm never ends. The best one but you can never figure out if the solution ![]() In fact, this algorithm finds solutions which approach If there were 100 teams with 10 players only. Cons The Liquid War algorithm is very poor compared to other algorithms when: You have several targetĭestinations, that's to say Liquid War would be really slow The size does, but the complexity, ie the number of walls, Level doesn't influence much the speed of the algorithm. Of Liquid War! When you have no clue about how your map will look like, Pros The Liquid War algorithm for path-finding is very efficient: When you have to move lots of different points Still the basis of the algorithm remained the same. I mean levels with wide areas for teams to move. The consequences were a performance increase, Later, I enhanced the algorithm, as I coded it. "mmm, cool, we could make a game with that!". In fact the Liquid War algorithm has been invented before History The Liquid War algorithm has been invented by my friend Lowest gradient value, ie is the closest to yourĬursor. Move them toward the adjacent point that has the Once you have this gradient calculated, it's not hard Liquid War does this with a 10% error tolerance,Īnd it's enough for keeping the game interesting. Your cursor, assuming that he takes the shortest way. Of the level, and the value of this gradient is theĭistance required for a little pixel/fighter to reach In fact, a "gradient" is calculated for all the points Now the point is to calculate this fast, real fast. Points of the level to your cursor is calculated. Level and/or your machine), the distance from all the Update, this occurs 10 or 100 times/sec depending on the Basically, at each round (by round I mean a game logical Still the path finding algorithm is an interesting one,įor it's not a common method that we used. That your army always takes the shortest way to reach Finally, at k=4, all shortest paths are found.Copying Core algorithm Introduction General remarks If you have played Liquid War, you must have noticed At k=2, paths going through the vertices are found. At k=1, paths that go through the vertex 1 are found: in particular, the path 2→1→3 is found, replacing the path 2→3 which has fewer edges but is longer. Prior to the first iteration of the outer loop, labeled k=0 above, the only known paths correspond to the single edges in the graph. Let dist be a |V| × |V| array of minimum distances initialized to ∞ (infinity)ĭist ← w(u,v) // the weight of the edge (u,v) A single execution of the algorithm will find the lengths (summed weights) of the shortest paths between all pairs of vertices, though it does not return details of the paths themselves. Floyd Warshall algorithm is an algorithm for finding shortest paths in a weighted graph with positive or negative edge weights (but with no negative cycles). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |