Monday, August 23, 2010

Writing is hard!

Man!

Having never written a blog before, this is tough to find things to talk about without discussing code. Afterall that is my speciality.

Anyways, the creation of games has struck me as funny. Looking back at some of my previous games, at the progress from day 1 with my MS Paint placeholder art to the most recent releases with proper art and some real functionality blows me away. It also makes me wonder where this game will lead me.

I've already learned some new ideas and I'm only on day two. AI is my newest hurdle I've hit with my games. Pathfinding is where I stand now. I have a decent a* build from Arabian Knights. I thought it would be easy to port to this game but BEHOLD! It turns out grid based movement with "walls" has to be thought of backwards.

Check this screenshot (I love MS Paint.. or rather Paint.net):

The grid base I made doesn't actually have walls. (You can see the cell sizes from some wierd tile bleeding, still working on it.)

Every tile has a wall on one side, and the tile beside it has to match that wall with it's own wall.

So, I've got corners, hallways, ends (walls on 3 sides) and just straight walls. With these tiles, I've built this.

As far as pathfinding goes, instead of looking to the next tile and checking whether it is walkable or not, it has to look at the first tile, check which direction it's going and then decide (based off of which tile it is) whether it can go in that direction.

Took me two or three hours or so to re-vamp my basic a* but she's up and running.

I was tempted to scrap the whole thing today. I just about made the cells half the size and paint in walls in to full cells, thus being able to use my regular a* but I figured since I was almost done, there's nothing like adding more styles in to your code base.

Well that's a wrap.

No comments:

Post a Comment