GithubHelp home page GithubHelp logo

Avoiding specific Nodes about jumper HOT 6 OPEN

Yonaba avatar Yonaba commented on July 17, 2024
Avoiding specific Nodes

from jumper.

Comments (6)

mtdowling avatar mtdowling commented on July 17, 2024

+1. This would be great. I currently am running into an issue in a tile based game where I want to path find to a node that isn't walkable, but attempting to walk into the node is the desired behavior (e.g., walking into a tavern increases health but the player can't actually walk through a tavern).

from jumper.

vadi2 avatar vadi2 commented on July 17, 2024

You also want to allow avoiding edges along with nodes. I've run into practical examples where you, for example, don't want to completely block a room off (because it has several other exits that you do want to use) but just a particular exit between two rooms (it's temporarily inaccessible or you don't want to walk through there).

from jumper.

Yonaba avatar Yonaba commented on July 17, 2024

@mtdowling , @vadi2 : Can you please provide some sketches explaining the problem you are running into and the expected behaviour ?
It'll help, thanks.

from jumper.

vadi2 avatar vadi2 commented on July 17, 2024

In my case I'm using an existing pathfinding system that's been developed and improved through the needs of players - we found that in practice, we need all of:

a) room-based locking: for when a room should not be entered into (you enter and die, for example, or it is enemy territory)
b) exits-based locking: particular exits can be disabled in a case where the logic dictates that you don't want to lock a room but a particular exit is unavailable, for example there is a door that you haven't got a key for
c) room-based weighting: some rooms take longer to cross than others (for example, a wading through a river - you'd rather pick 3 land tiles than 1 river tile)
d) exit-based weighting: some exits can be slower to traverse than others, for example there is rubble in them.

from jumper.

Yonaba avatar Yonaba commented on July 17, 2024

Thanks for all those details @vadi2,

a) Room-based locking
Should't this be solved by setting the underlying tiles as unwalkable ?

b) Exits-based locking
This is something I tried in the past. I wanted to see if was possible to pathfind with nodes that have specific rules for crossing: for instances, tiles that can only be entered from the north, etc. I implemented it via bitmasks (with this approach), but the result was not much satisfying, and most of al, it was not working really well (I think I did not investigated it well enough, though).
But I am willing to reconsider the problem (see #21). Hopefully, that will work.

c) Room-based weighting, d) Exit-based weighting
It reminds me of a features I wanted to take a look at (#9) and I feel like it potentially solves this. I wanted to include weighting for nodes. Actually, adding a weight value to a node is supposed to increade the penalty for going through that node. So that the pathfinder will attempt to avoid this very node without completely ignoring it. I actually implemented it already (as a side experiment in a different branch, but the intent was to provide a simple solution to avoid stacking when routing a group of agents). You can take a look at it here, and there's also a video available.

from jumper.

vadi2 avatar vadi2 commented on July 17, 2024

(a) probably is, I included it for completeness.

The rest of the stuff is interesting - when I'll have time, I'll try using jumper out in Mudlet (mudlet.org). It's a C++ MUD client embedding Lua for scripting. Pathfinding is handled on the C++ side by Boost's A* implementation, with a rich API available to Lua (http://wiki.mudlet.org/w/Manual:Mapper_Functions). The map data is stored on the C++ side but every detail is retrievable in Lua, so you can in effect pull all the data out and use your own pathfinding algorithms - making it possible to play with Jumper in it.

from jumper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.