• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Very simple path finding system?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
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