• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Very simple path finding system?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

Is there any system/library which does rect to rect path finding? That is, it finds a path from rect A to a location in rect B. But it is not truly a path in the traditional sense--I put an image below to explain.

In this image, suppose that each big square/box is its own disjoint rect (physically disjoint and also walkability wise too). The tiny little boxes in each rect are "teleports" that allow one to enter the rect of that color.

Thus to get from the black box to the green box, you need to simply travel to the tiny green box in the black box.

To get from the Red box to the black box, first go to the green box (via the tiny green box), then go to the tiny black box inside the green box, and voila, inside the black box.

(blue line indicates where to go)
t53x20.png


Note I am not using waygates (rather arbitrary teleporters).

So basically my function would take as input the player's current rect, and then output which teleport they need to take incrementally.

So how would I do this? I would like to create this system without using arbitrary notions of reachablity, i.e. I should not have to stipulate somewhere that

(blackBox --> greenBox)

(greenBox --> blackBox or redBox)

(redBox --> greenBox).

Otherwise I'd then have to *arbitrarily* come up with each box, and *arbitrarily* define the relation between each one (i.e. whether it exists). And then do my favorite search.

Or is there no other solution?
 
Status
Not open for further replies.
Top