Giter Club home page Giter Club logo

a-star-sharp's People

Contributors

bradhannah avatar davecusatis avatar dmforeacre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

a-star-sharp's Issues

End point is not walkable

Hey I really love your A* implementation, thanks you, it is very lightweight and exactly what I was looking for!

But I quickly found out that the end location is not ALWAYS set to walkable if your MapData sets it to not walkable.

Even tho you wanted the end locaton to be ALWAYS walkable judging by the code:
Node end = new Node( new Vector2( (int)( End.X / Node.NODE_SIZE ), (int)( End.Y / Node.NODE_SIZE ) ), true );
but you actually did not implement an override to make sure that it is actually walkable.
if ( !ClosedList.Contains( n ) && n.Walkable )

that means if my MapData says the NPC is not walkable because he has collision obviously,
it won't find a path.

To get around this I would need to know the end position before I define my MapData and set the end location to walkable, but what I'm looking for is only defining the MapData once without knowing the end location so I don't have to make a lot of different MapDatas just so I can find another location on the same map.

  • Can you please add a check/bool that make sure that the end is set to always walkable even if in you MapData it is not?

I know that in most cases you want to know if the end is actually reachable but in my case I know already that the end is always walkable, but I don't want to make thousands of new MapDatas just to overwrite the collison, I mean I'm doing that right now and it is turbo slow..

License

Can you add a license to it please?

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.