Skip to main content
deleted 1 character in body
Source Link
Daniel Oliveira
  • 1.3k
  • 1
  • 14
  • 36

Calculate Calculating the shortest route between two points

I have been working in the past weeks on a multiplayer HTML5 game, using nodejs and websockets.

I've been stuck in this problem for a little while. Imagine that I have this tilesheet map implemented with an array (as shown below).

1 or brown tiles - there is an obstacle in the way and the player can not pass through it.

0 or green tiles - are free paths where the player is allowed to move.

Access any tile on the map by calling:

 array[x][y]

tilesheet map - calculate the shortest route

I would like to create the fastest algorithm possible to find out the shortest route (if there is one) between two points of the map. How would you approach this problem? I know this is common problem.

Example:

Player at the position (1,7) fires a bullet with some AI that will toward the enemy player at the position (6,0). Bullet has to calculate the shortest route between the 2 players and if there aren´t any it would just explode against ana wall.

Question:

How to efficiently find the shortest route between two points?

Calculate the shortest route

I have been working in the past weeks on a multiplayer HTML5 game, using nodejs and websockets.

I've been stuck in this problem for a little while. Imagine that I have this tilesheet map implemented with an array (as shown below).

1 or brown tiles - there is an obstacle in the way and the player can not pass through it.

0 or green tiles - are free paths where the player is allowed to move.

Access any tile on the map by calling:

 array[x][y]

tilesheet map - calculate the shortest route

I would like to create the fastest algorithm possible to find out the shortest route (if there is one) between two points of the map. How would you approach this problem? I know this is common problem.

Example:

Player at the position (1,7) fires a bullet with some AI that will toward the enemy player at the position (6,0). Bullet has to calculate the shortest route between the 2 players and if there aren´t any it would just explode against an wall.

Question:

How to efficiently find the shortest route between two points?

Calculating the shortest route between two points

I have been working in the past weeks on a multiplayer HTML5 game, using nodejs and websockets.

I've been stuck in this problem for a little while. Imagine that I have this tilesheet map implemented with an array (as shown below).

1 or brown tiles - there is an obstacle in the way and the player can not pass through it.

0 or green tiles - are free paths where the player is allowed to move.

Access any tile on the map by calling:

 array[x][y]

tilesheet map - calculate the shortest route

I would like to create the fastest algorithm possible to find out the shortest route (if there is one) between two points of the map. How would you approach this problem? I know this is common problem.

Example:

Player at the position (1,7) fires a bullet with some AI that will toward the enemy player at the position (6,0). Bullet has to calculate the shortest route between the 2 players and if there aren´t any it would just explode against a wall.

Question:

How to efficiently find the shortest route between two points?

I have been working in the past weeks on a multiplayer HTML5 game, using nodejsnodejs and websocketswebsockets.

I've been stuck in this problem for a little while. Imagine that I have this tilesheet map implemented with an array (as shown belowas shown below). The numbers "1"/brown tiles means that

1 or brown tiles - there is an obstacle in the way and the player can not pass through it. The "0"/green tiles

0 or green tiles - are free paths where the player is allowed to move. I can access

Access any tile on the map by calling:

 array[x][y]

tilesheet map - calculate the shortest route

I would like to create the fastest algorithm possible to find out the shortest route (if there is one) between two points of the map. How would you approach this problem? I know this is common problem.

Example:

Player at the position (1,7) fires a bullet with some AI that will toward the enemy player at the position (6,0). Bullet has to calculate the shortest route between the 2 players and if there aren´t any it would just explode against an wall.

Question:

How to efficiently find the shortest route between two points?

I have been working in the past weeks on a multiplayer HTML5 game, using nodejs and websockets.

I've been stuck in this problem for a little while. Imagine that I have this tilesheet map implemented with an array (as shown below). The numbers "1"/brown tiles means that there is an obstacle in the way and the player can not pass through it. The "0"/green tiles are free paths where the player is allowed to move. I can access any tile on the map by calling:

 array[x][y]

tilesheet map - calculate the shortest route

I would like to create the fastest algorithm possible to find out the shortest route (if there is one) between two points of the map. How would you approach this problem? I know this is common problem.

Example:

Player at the position (1,7) fires a bullet with some AI that will toward the enemy player at the position (6,0). Bullet has to calculate the shortest route between the 2 players and if there aren´t any it would just explode against an wall.

Question:

How to efficiently find the shortest route between two points?

I have been working in the past weeks on a multiplayer HTML5 game, using nodejs and websockets.

I've been stuck in this problem for a little while. Imagine that I have this tilesheet map implemented with an array (as shown below).

1 or brown tiles - there is an obstacle in the way and the player can not pass through it.

0 or green tiles - are free paths where the player is allowed to move.

Access any tile on the map by calling:

 array[x][y]

tilesheet map - calculate the shortest route

I would like to create the fastest algorithm possible to find out the shortest route (if there is one) between two points of the map. How would you approach this problem? I know this is common problem.

Example:

Player at the position (1,7) fires a bullet with some AI that will toward the enemy player at the position (6,0). Bullet has to calculate the shortest route between the 2 players and if there aren´t any it would just explode against an wall.

Question:

How to efficiently find the shortest route between two points?

simplify for understanding the question
Source Link

I have been working in the past weeks on a multiplayer HTML5 game, using nodejs and websockets.

I've been stuck in this problem for a little while. Imagine that I have this tilesheet map implemented with an array (as shown below). The numbers "1"/brown tiles means that there is an obstacle in the way and the player can not pass through it. The "0"/green tiles are free paths where the player is allowed to move. I can access any tile on the map by calling:

 array[x][y]

tilesheet map - calculate the shortest route

I would like to create the fastest algorithm possible to find out the shortest route (if there is one) between two points of the map. How would you approach this problem? I know this is common problem.

Example:

Player at the position (1,7) fires a bullet with some AI that will toward the enemy player at the position (6,0). Bullet has to calculate the shortest route between the 2 players and if there aren´t any it would just explode against an wall.

Question:

How to efficiently find the shortest route between two points?

Regards, Daniel

I have been working in the past weeks on a multiplayer HTML5 game, using nodejs and websockets.

I've been stuck in this problem for a little while. Imagine that I have this tilesheet map implemented with an array (as shown below). The numbers "1"/brown tiles means that there is an obstacle in the way and the player can not pass through it. The "0"/green tiles are free paths where the player is allowed to move. I can access any tile on the map by calling:

 array[x][y]

tilesheet map - calculate the shortest route

I would like to create the fastest algorithm possible to find out the shortest route (if there is one) between two points of the map. How would you approach this problem? I know this is common problem.

Example:

Player at the position (1,7) fires a bullet with some AI that will toward the enemy player at the position (6,0). Bullet has to calculate the shortest route between the 2 players and if there aren´t any it would just explode against an wall.

Question:

How to efficiently find the shortest route between two points?

Regards, Daniel

I have been working in the past weeks on a multiplayer HTML5 game, using nodejs and websockets.

I've been stuck in this problem for a little while. Imagine that I have this tilesheet map implemented with an array (as shown below). The numbers "1"/brown tiles means that there is an obstacle in the way and the player can not pass through it. The "0"/green tiles are free paths where the player is allowed to move. I can access any tile on the map by calling:

 array[x][y]

tilesheet map - calculate the shortest route

I would like to create the fastest algorithm possible to find out the shortest route (if there is one) between two points of the map. How would you approach this problem? I know this is common problem.

Example:

Player at the position (1,7) fires a bullet with some AI that will toward the enemy player at the position (6,0). Bullet has to calculate the shortest route between the 2 players and if there aren´t any it would just explode against an wall.

Question:

How to efficiently find the shortest route between two points?

Source Link
Daniel Oliveira
  • 1.3k
  • 1
  • 14
  • 36
Loading