Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    10
  • comments
    0
  • views
    911

[Project Peril] Improved pathfinding, multi-threaded servers

Sign in to follow this  
Crayz92

937 views

GridClearance.png.7467f77970fc469812473489b62d6235.png

This week I improved on my old pathfinding code. Previously I used a basic A* algorithm to calculate pathing, now it is slightly modified to support units of different size. When a map is first loaded a square-grid which depicts walkable terrain is generated behind the scenes. Red cubes represent unwalkable ground (i.e there’s a wall or obstacle there), yellow cubes represent walkable ground with a clearance value of 1, green cubes have a clearance value of 2, magenta cubes have a clearance value of 3, white cubes 4, black cubes 5, and blue cubes 6+. Clearance value depicts how far away from an obstacle that point on the grid is. This is how we determine if a unit is too big to walk in an area.. if the unit is size 5 and we center the unit on a grid point with a clearance value of 2, the unit’s bounds will extend onto unwalkable area, thus we prohibit the unit from entering any nodes who’s clearance value is smaller than its size. Read more about clearance-based pathfinding hereSee a demonstration video here

I also implemented a multi-threaded architecture for game servers. This means that each game hosted on a server gets its own dedicated thread allowing for games to be processed parallel to each other. So if one game hits a frame spike and processes really slow the other games will not be affected since they are executing in parallel and do not have to wait in line.

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!