Sunday, January 9, 2011

DotNetFish - Progress is being made

You just can't see it yet. I got the first iteration of the tiling process push to github. However, it is still rough. I added a few safeguards to show a red tile if there was an error, just so I could get some other work done. The initial map tiler does the following logic to assign a tile to an edge. I have a csv file that defines the edge points for each tile in the tileset. 1. check the edges for changes between water and land. 2. take these points and convert them to the 12 possible points that can be used on a tile. 3. find the tile that matches those 2 points and assign that tile to the arraylist There are a couple of problems with this that I have found. 1. It might be possible to have more or less than 2 edges. This can be an issue with really small streams having 2 edges, and also some tiles with water on the edge only have 1 edge depending on the color. So any tiles like that will be red. I will probably need to add some 2 edge tiles, but that can be a future improvement. Dealing with 1 edge tiles is more tricky, and I haven't figured out a good method to deal with them yet, other than expanding the range of colors that count as water. 2. Edge tiles might not match up properly. The next iteration needs to do things differently. Right now it doesn't check the surrounding tiles to see where its edges are. It needs to do this, and if a surrounding tile has an edge, it needs to use it first. This should prevent any issues with tiles not lining up properly, as long as the CSV file is correct. (I probably need to write a small program to generate the CSV automatically). The next step is to get the Editor to save/load the map, and get it to show the map in the editor. Once I get the tiler finished, I'll try to put up another post showing how that works in code.

No comments:

Post a Comment