Wednesday, June 12, 2013

The Trouble With Doors

Using a tilemap to generate large maps is awesome, but there are some drawbacks too. The first drawback is doors. My first iteration of the map needed a hall to connect one room to another. This illustration proves this point.

My first pass at a map with a more schematic view introduces the door factor. I am glad I took some time to generate this graphic because now a door can be on any side of the tile.

Each tile can have the potential of a door on any of it's 4 sides. A tile will need to have a door property, up down right left, and will have some logic to determine the players direction going through it. The door, nearest the player is looks similar the the above map accept it only takes 2 tiles instead of 3 tiles to display. An open door will be considered open for shooting Line of Sight and for movement but a closed one will block both. This creates some issues with the pathfinding because now a tile can have a enemy in it and not be passable. Hmmm. I think a second pass checking the property of the current tile and the next tile in the path list, with some condition statements, will fix this. Looking at shared walls more pathfinding issues based on the grid show up. I will need to come back to this or scrap it for this version.  On second thought...doors are OK, and shared walls are out. 

Thinking more about doors and walls I will come back tp both later. I need to keep focused in finishing the the ai, game goals, bug fixing before I change the scope of the astar pathfinding. 

No comments:

Post a Comment