Tuesday, April 8, 2014

Path finding

Hey guys, I'm here with another blog update.  Today I want to show you the progress I've made on the implementation of pathfinding algorithms that the simulated people in the game world will utilize.

If you're familiar with building and sim games you know that a huge part of the gameplay revolves around creating the world for your sims to live inside of.  Obviously a large part of living in a world is knowing how to navigate inside of it.  Pathfinding is the mathematical solution to having our sims be able to navigate through the world you build.  Without it they would run into walls, nobody would ever figure out how to leave their rooms, let alone graduate and this would make the game pretty unfun.


It's pretty difficult to show off this type of thing in screenshots so I've made a video for you to check out:


In case you're curious to get a little technical, I've begun here with a simple implementation of the A* algorithm.  A* is a very basic and extremely reliable path finding technique which has been used in games for a very long time. Think of the game world as a grid in two-dimensional space each cell of the grid capable of being given properties which define it.  One property can obviously be impassable, this is the basic property I have implemented so far visible here in the video.
These properties can give weights to paths during the calculation, and these weights result in a "cost" of movement to certain tiles.  For example we can give negative weights to grassy tiles and positive weights to pathways to increase the likelihood that our path will choose to follow a more realistic looking route, when presented with one.

The next logical step in the implementation will be multiple characters navigating multiple paths at the same time.  I will be showing this off in another post so stay tuned!

2 comments:

  1. Good show! Nicely done sir. Things are coming along quite nicely. Can't wait, it's all developing so fast. lol. Very good job on the navigation.

    That char looks familiar lmao.

    ReplyDelete