Comments (5)
Hey kkoch. Thanks for the issue.
Do you think your problem could be solved with only one new method setAcceptableThreshold
?
Why might an explicit setWeightedGrid function be necessary ?
from easystarjs.
The purpose of setWeightedGrid
would be to assign costs to each tile based on its value. If i ran something like this:
var easystar = new EasyStar.js();
easystar.setGrid(this.map);
easystar.setAcceptableTiles([true]);
easystar.enableDiagonals();
Even if the values in map are numeric it wouldnt call easystar.setTileCost(tileType, multiplicativeCost);
for each number in there would it? My thought is having a setWeightedGrid function that assigns the cost to each tile according to its number and maybe flag it as a weighted cell so it could react to changes in the values.
I havent really looked into the source too much yet so I'm not sure exactly what would have to be done to accomplish this.
from easystarjs.
Thinking about it more, it wouldnt have to actually set the tile cost but maybe flag it as numerically weighted and when we look at the tile to get the cost we could just return the value
from easystarjs.
I understand now. You want to use setWeightedGrid as a way to batch-set tile costs, or even possibly create a second data structure to store these weighted values separately from the associated values from setGrid.
After thinking about it some more, I think this use case is pretty specific to your own needs. Something like this makes more sense to me as functionality that sits compositionally outside of EasyStar itself. You could keep track of these impassable tiles separately in your own code, and make them impassable with EasyStar by using the API calls setAcceptableTiles()
or avoidAdditionalPoint()
.
from easystarjs.
no problem, thanks!
from easystarjs.
Related Issues (20)
- Demo Uncaught ReferenceError: EasyStar is not defined at easy-star-demo.js:97:4
- Multiple End Points
- Is this still updated?
- Custom checkAdjacentNode or isTileWalkable HOT 2
- Possibility to define for each tile which directions are allowed. HOT 1
- Proposal: replace callbacks by Promises HOT 3
- Feature Request: Move to 'within range' of target HOT 6
- Broken links on website due to latest release being incorrectly tagged HOT 1
- Additionnal points and corner cutting
- setDirectionalCondition can be more efficient if a Set is used HOT 1
- state of project HOT 8
- finding path out of unwalkable area
- Are there any forks or strategies that utilize a 3rd axis?
- How do you import this please? HOT 1
- modifying grid values between setGrid and and findPath/calculate causes wrong results HOT 1
- Tactical RPG use HOT 1
- How to get the shortest path HOT 4
- Is "setAcceptableTiles" always necessary?
- "End Point Is Not An Acceptable Tile" HOT 1
- bower.json file reference 0.4.3 but the distribution file is 0.4.4 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easystarjs.