Options for a Diablo 2 like world?

TL;DR: what graph / set up do you use in a large world of multiple connected maps?
I have my game world consist of multiple maps, where each map is procedural generated (they just end up having a bunch of colliders so I don’t think the procedural part matters too much). And the maps are connected in some semi random way.
The connected maps have the same y value, and there is no elevation currently within a map. But there can be dungeons etc. where i put them in a different y plane.
Currently I am using layered grid graph for each map, but I am having trouble “connecting” them. There seems to be no way to find path from one graph to another. I ended up enlarging each graph and have them overlap a bit and by manipulating the index of each graph I can kind of path form map A to B.
The other option I can think of is using a moving graph centered on the player. But I also have co-op in my game where if I were to support more than 4 players the performance can be an issue?

This probably won’t help you at all, but in my use case I have multiple procedurally generated GridGraphs, none of which are connected, but all of which my agents move between (including the player, which is not a pathfinding agent). The graphs are all on the same Z-axis value, although they really could be at any unique, non-overlapping location. The approach I take is to simply manage moving agents from one graph to the next. My graphs occupy logical rooms, so my use case involves agents entering and exiting rooms, which involves starting and stopping their pathfinding when they do so.

It’s a KISS approach, and works pretty well for my use case. I guess what I’d ask is, if you’re finding it difficult to connect your graphs, do you need multiple connected graphs, or could you get away with larger graphs, and when needed manage moving agents between graphs?

My connections are not too complex either, because each map (room) is decently large and a map typically only connect to no more than 2 other maps.

I feel like your use case is extremely similar to mine. So basically you have some custom logic to move agents from one graph to another? For example when the player in room A want to path to a point in room B, you may have it path to the edge of A and start a new path from there to the destination in B.

I think I will give this a try, thanks for the help!

1 Like

My rooms are connected by doors, so any unit can enter and exit through doors. Pathfinding agents simply pause their movement by setting the value of AIPath.canMove. They also do not path from one graph to another, they just repath onto the room’s graph once they enter it.

I see, your gameplay defines clearly the action of going from one room to another, but I don’t have doors and want to make the transition seamless. I’ll see if I can make it work with some extra handling.