Connecting recast graphs or an alternative

Greetings, we are currently developing an open world survival game where the terrains in the world are procedural and generated on run-time. previously it was recommended to use a recast graph for the ability to use graph update objects and scan selectively instead of the whole graph. however, we currently have 9 terrains in the world and we came across the need for opening a connection between the 9 graphs so that if an agent follows a player from one terrain to the next it should be able to continue navigation.

My question is if this is possible with recast graphs and if there is a better way doing this i am all ears :smile:

Cheers,
Mohamed

2 Likes

I have the same issue, Also I want to start the scan process each time a chunk of terrain is generated (My world map is made of square terrain chunks generated procedurally), so I want to scan each chunk and link later the data.

Also it would be awesome only load in realtime the graphs needed not the entire map.

I would like to know if this is posible and some hints to start working with it.

mmm, there will be an answer?, at least are yes or no. Im waiting to start the pathfinding in my project because of this, I think after bought a license at least we deserve an small support, I see activity from the Creator in the forum, but not responses at all on this.

Hi

Sorry for the late answer. I missed this question.

@mohamedserry
Using a recast graph should work fine for that. However note that recast graphs are relatively slow to calculate which can be a problem for loading time in your game. You might want to use a grid graph instead if the worlds are not too large. Using multiple terrains should be no problem.

@ruben_buron
Mainly same response. Recast graphs can be updated in another thread, however no pathfinding can be done while that is happening which depending on the world size can have implications for responsiveness and performance. Have you looked that the “Procedural” example scene? That might be a better fit if you only need pathfinding in a relatively small region around the player.

Hi,

Thanks for your response, I thought about use grid graphs in the past but I cant imagine as a good idea to have in the server a grid graph for each player, I even thought of a gridgraph for each zone(terrain tile) where the players are located, but Im not sure the performance was acceptable (I tested 1 grid graph, and I dont hink I can handle a min of 20-30 grid graphs).

I can handle the idea about forget to load dinamically recast graphs, so its affordable to me to load at start all recastgraphs, my questions is how can I scan small pieces and put it all together, connecting them.

If there is no automatic proper manner to do this, but it could be done in code , its fine, but is that possible?

Ah, it’s on a server.

You can first scan the recast graph with no objects in the world, that will give you an empty graph. You can then use graph updates to recalculate the tiles that you want to update.

See http://arongranberg.com/astar/docs/graph-updates.php

You will however have to set the maximum size of the world up front.