• Breaking News

    A star implementation Hello, I am starting to implement A star in my game and I want to get your advice before doing so. Currently I have 2048x2048 map, which I plan to turn into a graph, where each node is coordinate - for example (512,512) and its children are the nodes around it - (513,513),(512,513),(513,512),etc. For the implementation of the graph I am looking at linked list of nodes, where each node contains array of its children. Each node will have bool whether this coordinate is occupied or not. After I have the graph I will run A* on it to get the shortest path. So I have some questions: - Is this the right way to approach this problem? - Will the movement of units be "blocky"? If an unit has to go in diagonal path to an enemy, will he go directly there in straight line or in some weird way, because my coordinates will not support floating point in the graph? - How is this problem solved in games like Starcraft? How is it solved for very big maps? - How can I access graph node directly, instead of traversing the whole graph? If my unit is at (1024,1024) and the root of the graph is (0,0) I dont want to traverse the whole thing, just to get to my unit position. Thanks for your answers! https://ift.tt/eA8V8J

    Hello, I am starting to implement A star in my game and I want to get your advice before doing so. Currently I have 2048x2048 map, which I plan to turn into a graph, where each node is coordinate - for example (512,512) and its children are the nodes around it - (513,513),(512,513),(513,512),etc. For the implementation of the graph I am looking at linked list of nodes, where each node contains array of its children. Each node will have bool whether this coordinate is occupied or not. After I have the graph I will run A* on it to get the shortest path. So I have some questions: - Is this the right way to approach this problem? - Will the movement of units be "blocky"? If an unit has to go in diagonal path to an enemy, will he go directly there in straight line or in some weird way, because my coordinates will not support floating point in the graph? - How is this problem solved in games like Starcraft? How is it solved for very big maps? - How can I access graph node directly, instead of traversing the whole graph? If my unit is at (1024,1024) and the root of the graph is (0,0) I dont want to traverse the whole thing, just to get to my unit position. Thanks for your answers!

    from GameDev.net http://bit.ly/2UCGnCI

    ليست هناك تعليقات

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728